Commit c69b2c5c authored by Riri Novita's avatar Riri Novita

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into riri

parents 80c7dec5 ac4ec3f5
...@@ -182,7 +182,9 @@ export default class BalanceSheetMR extends Component { ...@@ -182,7 +182,9 @@ export default class BalanceSheetMR extends Component {
item.balance_sheet.mtd_vs_mb === null ? "" : item.balance_sheet.mtd_vs_mb, item.balance_sheet.mtd_vs_mb === null ? "" : item.balance_sheet.mtd_vs_mb,
item.balance_sheet.mtd_vs_rb === null ? "" : item.balance_sheet.mtd_vs_rb, item.balance_sheet.mtd_vs_rb === null ? "" : item.balance_sheet.mtd_vs_rb,
item.balance_sheet.actual_formula, item.balance_sheet.actual_formula,
item.order item.order,
item.condition_it_should_be,
item.condition_if_wrong
]) ])
} }
if (item.children !== null) { if (item.children !== null) {
...@@ -227,7 +229,9 @@ export default class BalanceSheetMR extends Component { ...@@ -227,7 +229,9 @@ export default class BalanceSheetMR extends Component {
item.balance_sheet.mtd_vs_mb === null ? "" : item.balance_sheet.mtd_vs_mb, item.balance_sheet.mtd_vs_mb === null ? "" : item.balance_sheet.mtd_vs_mb,
item.balance_sheet.mtd_vs_rb === null ? "" : item.balance_sheet.mtd_vs_rb, item.balance_sheet.mtd_vs_rb === null ? "" : item.balance_sheet.mtd_vs_rb,
item.balance_sheet.actual_formula, item.balance_sheet.actual_formula,
item.order item.order,
item.condition_it_should_be,
item.condition_if_wrong
]) ])
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
...@@ -360,13 +364,15 @@ export default class BalanceSheetMR extends Component { ...@@ -360,13 +364,15 @@ export default class BalanceSheetMR extends Component {
item.mtd_vs_rb, item.mtd_vs_rb,
item.actual_formula, item.actual_formula,
item.order, item.order,
item.condition_it_should_be,
item.condition_if_wrong,
item.error item.error
] ]
}) })
console.log(dataTable) console.log(dataTable)
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: true, isUpload: true }, () => { this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: true, isUpload: true }, () => {
this.state.dataTable.map(item => { this.state.dataTable.map(item => {
if (item[22].length > 0) { if (item[24].length > 0) {
// console.log('masuk') // console.log('masuk')
this.setState({ buttonError: true, errorPreview: true }) this.setState({ buttonError: true, errorPreview: true })
} }
...@@ -726,7 +732,7 @@ export default class BalanceSheetMR extends Component { ...@@ -726,7 +732,7 @@ export default class BalanceSheetMR extends Component {
let indexID = dataTable2.findIndex((val) => val[21] == item) let indexID = dataTable2.findIndex((val) => val[21] == item)
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = dataTable2[indexID][colIdx] let valuezz = dataTable2[indexID][colIdx]
if (item == dataTable2[tableMeta.rowIndex][22]) { if (item == dataTable2[tableMeta.rowIndex][24]) {
anjay.push(0) anjay.push(0)
} else { } else {
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
...@@ -1077,22 +1083,58 @@ export default class BalanceSheetMR extends Component { ...@@ -1077,22 +1083,58 @@ export default class BalanceSheetMR extends Component {
} }
/> />
</div> : </div> :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 7)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 7)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 7)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[7]).toFixed(1)} value={Number(handleValueFormula(tableMeta, 7)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[7]).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1128,22 +1170,58 @@ export default class BalanceSheetMR extends Component { ...@@ -1128,22 +1170,58 @@ export default class BalanceSheetMR extends Component {
} }
/> />
</div> : </div> :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 8)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 8)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 8)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[8]).toFixed(1)} value={Number(handleValueFormula(tableMeta, 8)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[8]).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1199,22 +1277,58 @@ export default class BalanceSheetMR extends Component { ...@@ -1199,22 +1277,58 @@ export default class BalanceSheetMR extends Component {
value={Number(handleValue(tableMeta, 2)).toFixed(1)} value={Number(handleValue(tableMeta, 2)).toFixed(1)}
/> />
</span> : </span> :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 9)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 9)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 9)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(1)} value={Number(handleValueFormula(tableMeta, 9)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1253,22 +1367,58 @@ export default class BalanceSheetMR extends Component { ...@@ -1253,22 +1367,58 @@ export default class BalanceSheetMR extends Component {
value={Number(handleValue(tableMeta, 2)).toFixed(1)} value={Number(handleValue(tableMeta, 2)).toFixed(1)}
/> />
</span> : </span> :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 10)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 10)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 10)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[10]).toFixed(1)} value={Number(handleValueFormula(tableMeta, 10)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[10]).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
) )
...@@ -1341,22 +1491,58 @@ export default class BalanceSheetMR extends Component { ...@@ -1341,22 +1491,58 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 11)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 11)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 11)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleVariance(tableMeta, 1, 2)).toFixed(1)} value={Number(handleValueFormula(tableMeta, 11)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleVariance(tableMeta, 1, 2)).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1364,23 +1550,59 @@ export default class BalanceSheetMR extends Component { ...@@ -1364,23 +1550,59 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 12)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 12)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 12)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: Number(tableMeta.rowData[12]) < this.state.minValue || Number(tableMeta.rowData[12]) > this.state.maxValue ? 'red' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
suffix={'%'}
disabled={true} disabled={true}
value={Number(handleVariancePercent(tableMeta, 1, 3)).toFixed(1)} value={Number(handleValueFormula(tableMeta, 12)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: Number(tableMeta.rowData[12]) < this.state.minValue || Number(tableMeta.rowData[12]) > this.state.maxValue ? 'red' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
suffix={'%'}
disabled={true}
value={Number(handleVariancePercent(tableMeta, 1, 3)).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1392,22 +1614,58 @@ export default class BalanceSheetMR extends Component { ...@@ -1392,22 +1614,58 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 13)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 13)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 13)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleVariance(tableMeta, 2, 4)).toFixed(1)} value={Number(handleValueFormula(tableMeta, 13)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleVariance(tableMeta, 2, 4)).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1415,23 +1673,59 @@ export default class BalanceSheetMR extends Component { ...@@ -1415,23 +1673,59 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 14)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 14)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 14)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? 'red' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
suffix={'%'} value={Number(handleValueFormula(tableMeta, 14)).toFixed(1)}
value={Number(handleVariancePercent(tableMeta, 2, 5)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? 'red' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
suffix={'%'}
value={Number(handleVariancePercent(tableMeta, 2, 5)).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1443,22 +1737,58 @@ export default class BalanceSheetMR extends Component { ...@@ -1443,22 +1737,58 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 15)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 15)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 15)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleVariance(tableMeta, 3, 6)).toFixed(1)} value={Number(handleValueFormula(tableMeta, 15)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleVariance(tableMeta, 3, 6)).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1466,23 +1796,59 @@ export default class BalanceSheetMR extends Component { ...@@ -1466,23 +1796,59 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> tableMeta.rowData[0] === 7 ?
<FormControlLabel (Number(handleValueFormula(tableMeta, 16)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 16)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={val} thousandSeparator={true}
control={ style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 16)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? 'red' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
suffix={'%'} value={Number(handleValueFormula(tableMeta, 16)).toFixed(1)}
value={Number(handleVariancePercent(tableMeta, 3, 7)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? 'red' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
suffix={'%'}
value={Number(handleVariancePercent(tableMeta, 3, 7)).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1557,24 +1923,60 @@ export default class BalanceSheetMR extends Component { ...@@ -1557,24 +1923,60 @@ export default class BalanceSheetMR extends Component {
/> />
</LightTooltip> </LightTooltip>
: :
<Input // tableMeta.rowData[0] === 7 ?
disableUnderline={true} // (Number(handleValueFormula(tableMeta, 17)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 17)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // <NumberFormat
type="text" // thousandSeparator={true}
placeholder="" // style={{
// disabled={Number(tableMeta.rowData[12]) < this.state.minValue || Number(tableMeta.rowData[12]) > this.state.maxValue ? false : true} // fontSize: 12,
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // textAlign: 'right',
defaultValue={tableMeta.rowData[17]} // borderColor: 'transparent',
inputProps={{ // margin: 0,
style: { // width: 96,
color: Number(tableMeta.rowData[12]) < this.state.minValue || Number(tableMeta.rowData[12]) > this.state.maxValue ? "#5198ea" : '#5198ea', // backgroundColor: 'transparent'
textAlign: 'right' // }}
} // type="text"
}} // placeholder=""
onBlur={(event) => { // disabled={true}
handleText(event.target.value, tableMeta, 17) // value={Number(handleValueFormula(tableMeta, 17)).toFixed(1)}
}} // /> :
/> // <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
// <NumberFormat
// thousandSeparator={true}
// style={{
// fontSize: 12,
// textAlign: 'right',
// borderColor: 'transparent',
// margin: 0,
// width: 96,
// backgroundColor: 'transparent',
// color: 'red'
// }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValueFormula(tableMeta, 17)).toFixed(1)}
// />
// </LightTooltip>
// :
<Input
disableUnderline={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// disabled={Number(tableMeta.rowData[12]) < this.state.minValue || Number(tableMeta.rowData[12]) > this.state.maxValue ? false : true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[17]}
inputProps={{
style: {
color: Number(tableMeta.rowData[12]) < this.state.minValue || Number(tableMeta.rowData[12]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'right'
}
}}
onBlur={(event) => {
handleText(event.target.value, tableMeta, 17)
}}
/>
} }
/>} />}
</div> </div>
...@@ -1611,24 +2013,60 @@ export default class BalanceSheetMR extends Component { ...@@ -1611,24 +2013,60 @@ export default class BalanceSheetMR extends Component {
/> />
</LightTooltip> </LightTooltip>
: :
<Input // tableMeta.rowData[0] === 7 ?
disableUnderline={true} // (Number(handleValueFormula(tableMeta, 18)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 18)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // <NumberFormat
type="text" // thousandSeparator={true}
placeholder="" // style={{
// disabled={Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? false : true} // fontSize: 12,
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // textAlign: 'right',
defaultValue={tableMeta.rowData[18]} // borderColor: 'transparent',
inputProps={{ // margin: 0,
style: { // width: 96,
color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? "#5198ea" : '#5198ea', // backgroundColor: 'transparent'
textAlign: 'right' // }}
} // type="text"
}} // placeholder=""
onBlur={(event) => { // disabled={true}
handleText(event.target.value, tableMeta, 18) // value={Number(handleValueFormula(tableMeta, 18)).toFixed(1)}
}} // /> :
/> // <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
// <NumberFormat
// thousandSeparator={true}
// style={{
// fontSize: 12,
// textAlign: 'right',
// borderColor: 'transparent',
// margin: 0,
// width: 96,
// backgroundColor: 'transparent',
// color: 'red'
// }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValueFormula(tableMeta, 18)).toFixed(1)}
// />
// </LightTooltip>
// :
<Input
disableUnderline={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// disabled={Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? false : true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[18]}
inputProps={{
style: {
color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'right'
}
}}
onBlur={(event) => {
handleText(event.target.value, tableMeta, 18)
}}
/>
} }
/>} />}
</div> </div>
...@@ -1665,24 +2103,60 @@ export default class BalanceSheetMR extends Component { ...@@ -1665,24 +2103,60 @@ export default class BalanceSheetMR extends Component {
/> />
</LightTooltip> </LightTooltip>
: :
<Input // tableMeta.rowData[0] === 7 ?
disableUnderline={true} // (Number(handleValueFormula(tableMeta, 19)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 19)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // <NumberFormat
type="text" // thousandSeparator={true}
placeholder="" // style={{
// disabled={Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? false : true} // fontSize: 12,
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // textAlign: 'right',
defaultValue={tableMeta.rowData[19]} // borderColor: 'transparent',
inputProps={{ // margin: 0,
style: { // width: 96,
color: Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? "#5198ea" : '#5198ea', // backgroundColor: 'transparent'
textAlign: 'right' // }}
} // type="text"
}} // placeholder=""
onBlur={(event) => { // disabled={true}
handleText(event.target.value, tableMeta, 19) // value={Number(handleValueFormula(tableMeta, 19)).toFixed(1)}
}} // /> :
/> // <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
// <NumberFormat
// thousandSeparator={true}
// style={{
// fontSize: 12,
// textAlign: 'right',
// borderColor: 'transparent',
// margin: 0,
// width: 96,
// backgroundColor: 'transparent',
// color: 'red'
// }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValueFormula(tableMeta, 19)).toFixed(1)}
// />
// </LightTooltip>
// :
<Input
disableUnderline={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// disabled={Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? false : true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[19]}
inputProps={{
style: {
color: Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'right'
}
}}
onBlur={(event) => {
handleText(event.target.value, tableMeta, 19)
}}
/>
} }
/>} />}
</div> </div>
......
...@@ -73,7 +73,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -73,7 +73,7 @@ export default class CorporateAnnualTargetMR extends Component {
} }
componentDidMount() { componentDidMount() {
this.getItemHierarki() // this.getItemHierarki()
this.getLatestUpdate() this.getLatestUpdate()
this.getKPIType() this.getKPIType()
this.getMaxAch() this.getMaxAch()
......
...@@ -805,7 +805,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -805,7 +805,7 @@ export default class FixedAssetsMovementMR extends Component {
{ {
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 4 ? tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 4 ?
null : null :
tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 5 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
...@@ -827,7 +827,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -827,7 +827,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value).toFixed(1)} value={Number(tableMeta.rowData[6]).toFixed(1)}
/> />
} }
/> />
...@@ -840,7 +840,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -840,7 +840,7 @@ export default class FixedAssetsMovementMR extends Component {
{ {
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 4 ? tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 4 ?
null : null :
tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 5?
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
...@@ -862,7 +862,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -862,7 +862,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value).toFixed(1)} value={Number(tableMeta.rowData[7]).toFixed(1)}
/> />
} }
/> />
...@@ -896,7 +896,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -896,7 +896,7 @@ export default class FixedAssetsMovementMR extends Component {
} }
/> />
</div> : </div> :
tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 5 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
...@@ -918,7 +918,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -918,7 +918,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value).toFixed(1)} value={Number(tableMeta.rowData[8]).toFixed(1)}
/> />
} }
/> />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment