Commit 47fbff1e authored by Riri Novita's avatar Riri Novita

update BS

parent 181e3be6
...@@ -66,7 +66,7 @@ export default class BalanceSheetMR extends Component { ...@@ -66,7 +66,7 @@ export default class BalanceSheetMR extends Component {
componentDidMount() { componentDidMount() {
this.getSettingControl() this.getSettingControl()
this.getLatestUpdate() this.getLatestUpdate()
this.handleViewOnly() // this.handleViewOnly()
} }
handleViewOnly() { handleViewOnly() {
...@@ -1237,7 +1237,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1237,7 +1237,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(val), 1)} value={fixNumber(Number(val), 1) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/> />
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
...@@ -1251,7 +1251,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1251,7 +1251,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ? "0.0" : Number(val)}
/> />
} }
/> />
...@@ -1306,7 +1306,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1306,7 +1306,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[7]), 1) : Number(tableMeta.rowData[7])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[7]), 1) : Number(tableMeta.rowData[7]) == 0 ? "0.0" : Number(tableMeta.rowData[7])}
/> />
// : // :
// tableMeta.rowData[0] === 2 ? // tableMeta.rowData[0] === 2 ?
...@@ -1403,7 +1403,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1403,7 +1403,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[8]).toFixed(1)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[8]), 1) : Number(tableMeta.rowData[8]) == 0 ? "0.0" : Number(tableMeta.rowData[8])}
/> />
// : // :
// tableMeta.rowData[0] === 2 ? // tableMeta.rowData[0] === 2 ?
...@@ -1500,7 +1500,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1500,7 +1500,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(1)} value={fixNumber(Number(tableMeta.rowData[9]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[9]), 1)}
/> />
: :
tableMeta.rowData[0] === 3 ? tableMeta.rowData[0] === 3 ?
...@@ -1515,7 +1515,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1515,7 +1515,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)} disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
value={Number(tableMeta.rowData[9]).toFixed(1)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[9]), 1) : Number(tableMeta.rowData[9]) == 0 ? "0.0" : Number(tableMeta.rowData[9])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1535,7 +1535,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1535,7 +1535,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" && this.props.periode == 2021 && this.props.month.month_id == 1 ? false : true} disabled={String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" && this.props.periode == 2021 && this.props.month.month_id == 1 ? false : true}
value={String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" && this.props.periode == 2021 && this.props.month.month_id == 1 ? Number(tableMeta.rowData[9]).toFixed(1) : Number(handleValueFormula(tableMeta, 9)).toFixed(1)} value={Number(tableMeta.rowData[9]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" && this.props.periode == 2021 && this.props.month.month_id == 1 ? fixNumber(Number(tableMeta.rowData[9]), 1) : fixNumber(Number(handleValueFormula(tableMeta, 9)), 1)) : (String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" && this.props.periode == 2021 && this.props.month.month_id == 1 ? Number(tableMeta.rowData[9]) : Number(handleValueFormula(tableMeta, 9)))}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1551,27 +1551,47 @@ export default class BalanceSheetMR extends Component { ...@@ -1551,27 +1551,47 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValue(tableMeta, 2)).toFixed(1)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValue(tableMeta, 2)), 1) : Number(handleValue(tableMeta, 2)) == 0 ? "0.0" : Number(handleValue(tableMeta, 2))}
/> />
</span> : </span> :
tableMeta.rowData[0] === 7 ? tableMeta.rowData[0] === 7 ?
(Number(handleValueFormula(tableMeta, 9)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 9)).toFixed(1) <= Number(this.state.maxValue)) ? this.props.defaultCurrency.id == 1 ?
<NumberFormat (fixNumber(Number(handleValueFormula(tableMeta, 9)), 1) >= Number(this.state.minValue) && fixNumber(Number(handleValueFormula(tableMeta, 9)), 1) <= Number(this.state.maxValue)) ?
thousandSeparator={true} <NumberFormat
style={{ thousandSeparator={true}
fontSize: 12, style={{
textAlign: 'right', fontSize: 12,
borderColor: 'transparent', textAlign: 'right',
margin: 0, borderColor: 'transparent',
width: 96, margin: 0,
backgroundColor: 'transparent' width: 96,
}} backgroundColor: 'transparent'
type="text" }}
placeholder="" type="text"
disabled={true} placeholder=""
value={Number(handleValueFormula(tableMeta, 9)).toFixed(1)} disabled={true}
/> : value={fixNumber(Number(handleValueFormula(tableMeta, 9)), 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> /> :
<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={fixNumber(Number(handleValueFormula(tableMeta, 9)), 1)}
/>
</LightTooltip>
:
(Number(handleValueFormula(tableMeta, 9)) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 9)) <= Number(this.state.maxValue)) ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ style={{
...@@ -1580,15 +1600,31 @@ export default class BalanceSheetMR extends Component { ...@@ -1580,15 +1600,31 @@ export default class BalanceSheetMR extends Component {
borderColor: 'transparent', borderColor: 'transparent',
margin: 0, margin: 0,
width: 96, width: 96,
backgroundColor: 'transparent', backgroundColor: 'transparent'
color: 'red'
}} }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormula(tableMeta, 9)).toFixed(1)} value={Number(handleValueFormula(tableMeta, 9)) == 0 ? "0.0" : Number(handleValueFormula(tableMeta, 9))}
/> /> :
</LightTooltip> <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, 9)) == 0 ? "0.0" : Number(handleValueFormula(tableMeta, 9))}
/>
</LightTooltip>
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -1601,7 +1637,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1601,7 +1637,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(1)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[9]), 1) : Number(tableMeta.rowData[9]) == 0 ? "0.0" : Number(tableMeta.rowData[9])}
/> />
} }
/> />
...@@ -1640,7 +1676,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1640,7 +1676,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[10]).toFixed(1)} value={fixNumber(Number(tableMeta.rowData[10]), 1)}
/> />
: :
tableMeta.rowData[0] === 2 ? tableMeta.rowData[0] === 2 ?
...@@ -1651,7 +1687,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1651,7 +1687,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValue(tableMeta, 2)).toFixed(1)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValue(tableMeta, 2)), 1) : Number(handleValue(tableMeta, 2)) == 0 ? "0.0" : Number(handleValue(tableMeta, 2))}
/> />
</span> : </span> :
// tableMeta.rowData[0] === 7 ? // tableMeta.rowData[0] === 7 ?
...@@ -1701,7 +1737,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1701,7 +1737,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[10]).toFixed(1)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[10]), 1) : Number(tableMeta.rowData[10]) == 0 ? "0.0" : Number(tableMeta.rowData[10])}
/> />
} }
/> />
...@@ -1785,7 +1821,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1785,7 +1821,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[11]).toFixed(1)} value={fixNumber(Number(tableMeta.rowData[11]), 1)}
/> />
: :
// tableMeta.rowData[0] === 7 ? // tableMeta.rowData[0] === 7 ?
...@@ -1835,7 +1871,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1835,7 +1871,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleVariance(tableMeta, 1, 2)).toFixed(1)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariance(tableMeta, 1, 2)), 1) : Number(handleVariance(tableMeta, 1, 2)) == 0 ? "0.0" : Number(handleVariance(tableMeta, 1, 2))}
/> />
} }
/> />
...@@ -1855,7 +1891,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1855,7 +1891,7 @@ export default class BalanceSheetMR extends Component {
placeholder="" placeholder=""
suffix={'%'} suffix={'%'}
disabled={true} disabled={true}
value={Number(tableMeta.rowData[12]).toFixed(1)} value={fixNumber(Number(tableMeta.rowData[12]), 1)}
/> />
// : // :
// tableMeta.rowData[0] === 7 ? // tableMeta.rowData[0] === 7 ?
...@@ -1906,7 +1942,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1906,7 +1942,7 @@ export default class BalanceSheetMR extends Component {
placeholder="" placeholder=""
suffix={'%'} suffix={'%'}
disabled={true} disabled={true}
value={Number(handleVariancePercent(tableMeta, 1, 3)).toFixed(1)} value={fixNumber(Number(handleVariancePercent(tableMeta, 1, 3)), 1)}
/> />
} }
/> />
...@@ -1929,7 +1965,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1929,7 +1965,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[13]).toFixed(1)} value={fixNumber(Number(tableMeta.rowData[13]), 1)}
/> />
// : // :
// tableMeta.rowData[0] === 7 ? // tableMeta.rowData[0] === 7 ?
...@@ -1979,7 +2015,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1979,7 +2015,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleVariance(tableMeta, 2, 4)).toFixed(1)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariance(tableMeta, 2, 4)), 1) : Number(handleVariance(tableMeta, 2, 4)) == 0 ? "0.0" : Number(handleVariance(tableMeta, 2, 4))}
/> />
} }
/> />
...@@ -1999,7 +2035,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1999,7 +2035,7 @@ export default class BalanceSheetMR extends Component {
placeholder="" placeholder=""
suffix={'%'} suffix={'%'}
disabled={true} disabled={true}
value={Number(tableMeta.rowData[14]).toFixed(1)} value={fixNumber(Number(tableMeta.rowData[14]), 1)}
/> />
: :
// tableMeta.rowData[0] === 7 ? // tableMeta.rowData[0] === 7 ?
...@@ -2050,7 +2086,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2050,7 +2086,7 @@ export default class BalanceSheetMR extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
suffix={'%'} suffix={'%'}
value={Number(handleVariancePercent(tableMeta, 2, 5)).toFixed(1)} value={fixNumber(Number(handleVariancePercent(tableMeta, 2, 5)), 1)}
/> />
} }
/> />
...@@ -2073,7 +2109,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2073,7 +2109,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[15]).toFixed(1)} value={fixNumber(Number(tableMeta.rowData[15]), 1)}
/> />
: :
// tableMeta.rowData[0] === 7 ? // tableMeta.rowData[0] === 7 ?
...@@ -2123,7 +2159,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2123,7 +2159,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleVariance(tableMeta, 3, 6)).toFixed(1)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariance(tableMeta, 3, 6)), 1) : Number(handleVariance(tableMeta, 3, 6)) == 0 ? "0.0" : Number(handleVariance(tableMeta, 3, 6))}
/> />
} }
/> />
...@@ -2143,7 +2179,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2143,7 +2179,7 @@ export default class BalanceSheetMR extends Component {
suffix={'%'} suffix={'%'}
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[16]).toFixed(1)} value={fixNumber(Number(tableMeta.rowData[16]), 1)}
/> />
: :
// tableMeta.rowData[0] === 7 ? // tableMeta.rowData[0] === 7 ?
...@@ -2194,7 +2230,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2194,7 +2230,7 @@ export default class BalanceSheetMR extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
suffix={'%'} suffix={'%'}
value={Number(handleVariancePercent(tableMeta, 3, 7)).toFixed(1)} value={fixNumber(Number(handleVariancePercent(tableMeta, 3, 7)), 1)}
/> />
} }
/> />
...@@ -2340,7 +2376,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2340,7 +2376,7 @@ export default class BalanceSheetMR extends Component {
defaultValue={tableMeta.rowData[17]} defaultValue={tableMeta.rowData[17]}
inputProps={{ inputProps={{
style: { style: {
color: Number(tableMeta.rowData[12]).toFixed(1) < this.state.minValue || Number(tableMeta.rowData[12]).toFixed(1) > this.state.maxValue ? "#5198ea" : '#5198ea', color: fixNumber(Number(tableMeta.rowData[12]), 1) < this.state.minValue || fixNumber(Number(tableMeta.rowData[12]), 1) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'left' textAlign: 'left'
} }
}} }}
...@@ -2379,7 +2415,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2379,7 +2415,7 @@ export default class BalanceSheetMR extends Component {
style={{ margin: 0 }} style={{ margin: 0 }}
// value={value} // value={value}
control={ control={
tableMeta.rowData[18] === "" && (Number(tableMeta.rowData[14]).toFixed(1) < this.state.minValue || Number(tableMeta.rowData[14]).toFixed(1) > this.state.maxValue) ? tableMeta.rowData[18] === "" && (fixNumber(Number(tableMeta.rowData[14]), 1) < this.state.minValue || fixNumber(Number(tableMeta.rowData[14]), 1) > this.state.maxValue) ?
<LightTooltip title={"MTD Explanation vs MB is Reqiured"} arrow> <LightTooltip title={"MTD Explanation vs MB is Reqiured"} arrow>
<Input <Input
disableUnderline={true} disableUnderline={true}
...@@ -2452,7 +2488,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2452,7 +2488,7 @@ export default class BalanceSheetMR extends Component {
defaultValue={tableMeta.rowData[18]} defaultValue={tableMeta.rowData[18]}
inputProps={{ inputProps={{
style: { style: {
color: Number(tableMeta.rowData[14]).toFixed(1) < this.state.minValue || Number(tableMeta.rowData[14]).toFixed(1) > this.state.maxValue ? "#5198ea" : '#5198ea', color: fixNumber(Number(tableMeta.rowData[14]), 1) < this.state.minValue || fixNumber(Number(tableMeta.rowData[14]), 1) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'left' textAlign: 'left'
} }
}} }}
...@@ -2562,7 +2598,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2562,7 +2598,7 @@ export default class BalanceSheetMR extends Component {
defaultValue={tableMeta.rowData[19]} defaultValue={tableMeta.rowData[19]}
inputProps={{ inputProps={{
style: { style: {
color: Number(tableMeta.rowData[16]).toFixed(1) < this.state.minValue || Number(tableMeta.rowData[16]).toFixed(1) > this.state.maxValue ? "#5198ea" : '#5198ea', color: fixNumber(Number(tableMeta.rowData[16]), 1) < this.state.minValue || fixNumber(Number(tableMeta.rowData[16]), 1) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'left' textAlign: 'left'
} }
}} }}
...@@ -3120,4 +3156,4 @@ export default class BalanceSheetMR extends Component { ...@@ -3120,4 +3156,4 @@ export default class BalanceSheetMR extends Component {
</div> </div>
) )
} }
} }
\ No newline at end of file
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