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

update BS

parent 181e3be6
......@@ -66,7 +66,7 @@ export default class BalanceSheetMR extends Component {
componentDidMount() {
this.getSettingControl()
this.getLatestUpdate()
this.handleViewOnly()
// this.handleViewOnly()
}
handleViewOnly() {
......@@ -1237,7 +1237,7 @@ export default class BalanceSheetMR extends Component {
type="text"
placeholder=""
disabled={true}
value={fixNumber(Number(val), 1)}
value={fixNumber(Number(val), 1) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/>
:
<div style={{ flex: 1 }}>
......@@ -1251,7 +1251,7 @@ export default class BalanceSheetMR extends Component {
type="text"
placeholder=""
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 {
type="text"
placeholder=""
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 ?
......@@ -1403,7 +1403,7 @@ export default class BalanceSheetMR extends Component {
type="text"
placeholder=""
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 ?
......@@ -1500,7 +1500,7 @@ export default class BalanceSheetMR extends Component {
type="text"
placeholder=""
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 ?
......@@ -1515,7 +1515,7 @@ export default class BalanceSheetMR extends Component {
type="text"
placeholder=""
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) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1535,7 +1535,7 @@ export default class BalanceSheetMR extends Component {
type="text"
placeholder=""
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) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1551,27 +1551,47 @@ export default class BalanceSheetMR extends Component {
type="text"
placeholder=""
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> :
tableMeta.rowData[0] === 7 ?
(Number(handleValueFormula(tableMeta, 9)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 9)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
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>
this.props.defaultCurrency.id == 1 ?
(fixNumber(Number(handleValueFormula(tableMeta, 9)), 1) >= Number(this.state.minValue) && fixNumber(Number(handleValueFormula(tableMeta, 9)), 1) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
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>
<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
thousandSeparator={true}
style={{
......@@ -1580,15 +1600,31 @@ export default class BalanceSheetMR extends Component {
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 9)).toFixed(1)}
/>
</LightTooltip>
value={Number(handleValueFormula(tableMeta, 9)) == 0 ? "0.0" : Number(handleValueFormula(tableMeta, 9))}
/> :
<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 }}>
<FormControlLabel
......@@ -1601,7 +1637,7 @@ export default class BalanceSheetMR extends Component {
type="text"
placeholder=""
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 {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[10]).toFixed(1)}
value={fixNumber(Number(tableMeta.rowData[10]), 1)}
/>
:
tableMeta.rowData[0] === 2 ?
......@@ -1651,7 +1687,7 @@ export default class BalanceSheetMR extends Component {
type="text"
placeholder=""
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> :
// tableMeta.rowData[0] === 7 ?
......@@ -1701,7 +1737,7 @@ export default class BalanceSheetMR extends Component {
type="text"
placeholder=""
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 {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[11]).toFixed(1)}
value={fixNumber(Number(tableMeta.rowData[11]), 1)}
/>
:
// tableMeta.rowData[0] === 7 ?
......@@ -1835,7 +1871,7 @@ export default class BalanceSheetMR extends Component {
type="text"
placeholder=""
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 {
placeholder=""
suffix={'%'}
disabled={true}
value={Number(tableMeta.rowData[12]).toFixed(1)}
value={fixNumber(Number(tableMeta.rowData[12]), 1)}
/>
// :
// tableMeta.rowData[0] === 7 ?
......@@ -1906,7 +1942,7 @@ export default class BalanceSheetMR extends Component {
placeholder=""
suffix={'%'}
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 {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[13]).toFixed(1)}
value={fixNumber(Number(tableMeta.rowData[13]), 1)}
/>
// :
// tableMeta.rowData[0] === 7 ?
......@@ -1979,7 +2015,7 @@ export default class BalanceSheetMR extends Component {
type="text"
placeholder=""
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 {
placeholder=""
suffix={'%'}
disabled={true}
value={Number(tableMeta.rowData[14]).toFixed(1)}
value={fixNumber(Number(tableMeta.rowData[14]), 1)}
/>
:
// tableMeta.rowData[0] === 7 ?
......@@ -2050,7 +2086,7 @@ export default class BalanceSheetMR extends Component {
placeholder=""
disabled={true}
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 {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[15]).toFixed(1)}
value={fixNumber(Number(tableMeta.rowData[15]), 1)}
/>
:
// tableMeta.rowData[0] === 7 ?
......@@ -2123,7 +2159,7 @@ export default class BalanceSheetMR extends Component {
type="text"
placeholder=""
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 {
suffix={'%'}
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[16]).toFixed(1)}
value={fixNumber(Number(tableMeta.rowData[16]), 1)}
/>
:
// tableMeta.rowData[0] === 7 ?
......@@ -2194,7 +2230,7 @@ export default class BalanceSheetMR extends Component {
placeholder=""
disabled={true}
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 {
defaultValue={tableMeta.rowData[17]}
inputProps={{
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'
}
}}
......@@ -2379,7 +2415,7 @@ export default class BalanceSheetMR extends Component {
style={{ margin: 0 }}
// value={value}
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>
<Input
disableUnderline={true}
......@@ -2452,7 +2488,7 @@ export default class BalanceSheetMR extends Component {
defaultValue={tableMeta.rowData[18]}
inputProps={{
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'
}
}}
......@@ -2562,7 +2598,7 @@ export default class BalanceSheetMR extends Component {
defaultValue={tableMeta.rowData[19]}
inputProps={{
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'
}
}}
......@@ -3120,4 +3156,4 @@ export default class BalanceSheetMR extends Component {
</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