Commit d1a2556f authored by Riri Novita's avatar Riri Novita

Merge branch 'dev/riri' into 'ENV-DEV'

Fixing Issue UAT

See merge request !2052
parents 2156322c af827e20
...@@ -1129,7 +1129,7 @@ export default class ProfitLossMR extends Component { ...@@ -1129,7 +1129,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[7]) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[7]), 1)} value={fixNumber(Number(tableMeta.rowData[7]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[7]), 1)}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
: :
...@@ -1163,7 +1163,7 @@ export default class ProfitLossMR extends Component { ...@@ -1163,7 +1163,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[7]) == 0 ? "0.0" : 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])}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
} }
...@@ -1219,7 +1219,7 @@ export default class ProfitLossMR extends Component { ...@@ -1219,7 +1219,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[8]) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[8]), 1)} value={fixNumber(Number(tableMeta.rowData[8]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[8]), 1)}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
: :
...@@ -1234,7 +1234,7 @@ export default class ProfitLossMR extends Component { ...@@ -1234,7 +1234,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[8]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[8]), 1) : Number(tableMeta.rowData[8])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[8]), 1) : Number(tableMeta.rowData[8]) == 0 ? "0.0" : Number(tableMeta.rowData[8])}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
} }
...@@ -1254,7 +1254,7 @@ export default class ProfitLossMR extends Component { ...@@ -1254,7 +1254,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[9]) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[9]), 1)} value={fixNumber(Number(tableMeta.rowData[9]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[9]), 1)}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
: :
...@@ -1269,7 +1269,7 @@ export default class ProfitLossMR extends Component { ...@@ -1269,7 +1269,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[9]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[9]), 1) : Number(tableMeta.rowData[9])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[9]), 1) : Number(tableMeta.rowData[9]) == 0 ? "0.0" : Number(tableMeta.rowData[9])}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
} }
...@@ -1290,7 +1290,7 @@ export default class ProfitLossMR extends Component { ...@@ -1290,7 +1290,7 @@ export default class ProfitLossMR extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
value={Number(tableMeta.rowData[10]) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[10]), 1)} value={fixNumber(Number(tableMeta.rowData[10]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[10]), 1)}
// decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} // decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
: :
...@@ -1306,7 +1306,7 @@ export default class ProfitLossMR extends Component { ...@@ -1306,7 +1306,7 @@ export default class ProfitLossMR 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[10]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[10]), 1) : Number(tableMeta.rowData[10])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[10]), 1) : Number(tableMeta.rowData[10]) == 0 ? "0.0" : Number(tableMeta.rowData[10])}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, "actual") handleChange(event.target.value, tableMeta, "actual")
...@@ -1324,7 +1324,7 @@ export default class ProfitLossMR extends Component { ...@@ -1324,7 +1324,7 @@ export default class ProfitLossMR extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
value={Number(tableMeta.rowData[10]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValue(value, tableMeta)), 1) : Number(handleValue(value, tableMeta))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValue(value, tableMeta)), 1) : Number(handleValue(value, tableMeta)) == 0 ? "0.0" : Number(handleValue(value, tableMeta))}
// value={Number(handleValue(tableMeta, 2)).toFixed(1)} // value={Number(handleValue(tableMeta, 2)).toFixed(1)}
/> />
</span> : </span> :
...@@ -1341,7 +1341,7 @@ export default class ProfitLossMR extends Component { ...@@ -1341,7 +1341,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[10]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormula(value, tableMeta, 2)), 1) : Number(handleFormula(value, tableMeta, 2))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormula(value, tableMeta, 2)), 1) : Number(handleFormula(value, tableMeta, 2)) == 0 ? "0.0" : Number(handleFormula(value, tableMeta, 2))}
/> />
} }
/> />
...@@ -1357,7 +1357,7 @@ export default class ProfitLossMR extends Component { ...@@ -1357,7 +1357,7 @@ export default class ProfitLossMR extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(tableMeta.rowData[10]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[10]), 1) : Number(tableMeta.rowData[10])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[10]), 1) : Number(tableMeta.rowData[10]) == 0 ? "0.0" : Number(tableMeta.rowData[10])}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
} }
...@@ -1405,7 +1405,7 @@ export default class ProfitLossMR extends Component { ...@@ -1405,7 +1405,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[23]) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[23]), 1)} value={fixNumber(Number(tableMeta.rowData[23]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[23]), 1)}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
: :
...@@ -1420,7 +1420,7 @@ export default class ProfitLossMR extends Component { ...@@ -1420,7 +1420,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleTotal(tableMeta.rowData[11], tableMeta)) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleTotal(tableMeta.rowData[11], tableMeta)), 1) : Number(handleTotal(tableMeta.rowData[11], tableMeta))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleTotal(tableMeta.rowData[11], tableMeta)), 1) : Number(handleTotal(tableMeta.rowData[11], tableMeta)) == 0 ? "0.0" : Number(handleTotal(tableMeta.rowData[11], tableMeta))}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
} }
...@@ -1453,7 +1453,7 @@ export default class ProfitLossMR extends Component { ...@@ -1453,7 +1453,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[12]) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[12]), 1)} value={fixNumber(Number(tableMeta.rowData[12]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[12]), 1)}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
: :
...@@ -1468,7 +1468,7 @@ export default class ProfitLossMR extends Component { ...@@ -1468,7 +1468,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[12]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[12]), 1) : Number(tableMeta.rowData[12])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[12]), 1) : Number(tableMeta.rowData[12]) == 0 ? "0.0" : Number(tableMeta.rowData[12])}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
} }
...@@ -1554,7 +1554,7 @@ export default class ProfitLossMR extends Component { ...@@ -1554,7 +1554,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[13]) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[13]), 1)} value={fixNumber(Number(tableMeta.rowData[13]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[13]), 1)}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
: :
...@@ -1569,7 +1569,7 @@ export default class ProfitLossMR extends Component { ...@@ -1569,7 +1569,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[13]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariance(tableMeta, 1, 0)), 1) : Number(handleVariance(tableMeta, 1, 0))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariance(tableMeta, 1, 0)), 1) : Number(handleVariance(tableMeta, 1, 0)) == 0 ? "0.0" : Number(handleVariance(tableMeta, 1, 0))}
// value={Number(tableMeta.rowData[13]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariance(tableMeta, 1, 0)), 1) : Number(handleVariance(tableMeta, 1, 0))} // value={Number(tableMeta.rowData[13]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariance(tableMeta, 1, 0)), 1) : Number(handleVariance(tableMeta, 1, 0))}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
...@@ -1592,7 +1592,7 @@ export default class ProfitLossMR extends Component { ...@@ -1592,7 +1592,7 @@ export default class ProfitLossMR extends Component {
placeholder="" placeholder=""
suffix={'%'} suffix={'%'}
disabled={true} disabled={true}
value={Number(tableMeta.rowData[14]) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[14]), 1)} value={fixNumber(Number(tableMeta.rowData[14]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[14]), 1)}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
: :
...@@ -1608,7 +1608,7 @@ export default class ProfitLossMR extends Component { ...@@ -1608,7 +1608,7 @@ export default class ProfitLossMR extends Component {
placeholder="" placeholder=""
suffix={'%'} suffix={'%'}
disabled={true} disabled={true}
value={Number(tableMeta.rowData[14]) == 0 ? "0.0" : fixNumber(Number(handleVariancePercent(tableMeta, 1, 1)), 1)} value={fixNumber(Number(handleVariancePercent(tableMeta, 1, 1)), 1) == 0 ? "0.0" : fixNumber(Number(handleVariancePercent(tableMeta, 1, 1)), 1)}
// value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariancePercent(tableMeta, 1, 1)), 1) : Number(handleVariancePercent(tableMeta, 1, 1))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariancePercent(tableMeta, 1, 1)), 1) : Number(handleVariancePercent(tableMeta, 1, 1))}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
// value={11} // value={11}
...@@ -1635,7 +1635,7 @@ export default class ProfitLossMR extends Component { ...@@ -1635,7 +1635,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[15]) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[15]), 1)} value={fixNumber(Number(tableMeta.rowData[15]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[15]), 1)}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
: :
...@@ -1650,7 +1650,7 @@ export default class ProfitLossMR extends Component { ...@@ -1650,7 +1650,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[15]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariance(tableMeta, 2, 2)), 1) : Number(handleVariance(tableMeta, 2, 2))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariance(tableMeta, 2, 2)), 1) : Number(handleVariance(tableMeta, 2, 2)) == 0 ? "0.0" : Number(handleVariance(tableMeta, 2, 2))}
// value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariance(tableMeta, 2, 2)), 1) : Number(handleVariance(tableMeta, 2, 2))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariance(tableMeta, 2, 2)), 1) : Number(handleVariance(tableMeta, 2, 2))}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
...@@ -1673,7 +1673,7 @@ export default class ProfitLossMR extends Component { ...@@ -1673,7 +1673,7 @@ export default class ProfitLossMR extends Component {
placeholder="" placeholder=""
suffix={'%'} suffix={'%'}
disabled={true} disabled={true}
value={Number(tableMeta.rowData[16]) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[16]), 1)} value={fixNumber(Number(tableMeta.rowData[16]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[16]), 1)}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
: :
...@@ -1689,7 +1689,7 @@ export default class ProfitLossMR extends Component { ...@@ -1689,7 +1689,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[16]) == 0 ? "0.0" : fixNumber(Number(handleVariancePercent(tableMeta, 2, 3)), 1)} value={fixNumber(Number(handleVariancePercent(tableMeta, 2, 3)), 1) == 0 ? "0.0" : fixNumber(Number(handleVariancePercent(tableMeta, 2, 3)), 1)}
// value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariancePercent(tableMeta, 2, 3)), 1) : Number(handleVariancePercent(tableMeta, 2, 3))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariancePercent(tableMeta, 2, 3)), 1) : Number(handleVariancePercent(tableMeta, 2, 3))}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
...@@ -1715,7 +1715,7 @@ export default class ProfitLossMR extends Component { ...@@ -1715,7 +1715,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[17]) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[17]), 1)} value={fixNumber(Number(tableMeta.rowData[17]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[17]), 1)}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
: :
...@@ -1730,7 +1730,7 @@ export default class ProfitLossMR extends Component { ...@@ -1730,7 +1730,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariance(tableMeta, 3, 4)), 1) : Number(handleVariance(tableMeta, 3, 4))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariance(tableMeta, 3, 4)), 1) : Number(handleVariance(tableMeta, 3, 4)) == 0 ? "0.0" : Number(handleVariance(tableMeta, 3, 4))}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
} }
...@@ -1752,7 +1752,7 @@ export default class ProfitLossMR extends Component { ...@@ -1752,7 +1752,7 @@ export default class ProfitLossMR extends Component {
placeholder="" placeholder=""
suffix={'%'} suffix={'%'}
disabled={true} disabled={true}
value={Number(tableMeta.rowData[18]) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[18]), 1)} value={fixNumber(Number(tableMeta.rowData[18]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[18]), 1)}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
: :
...@@ -1769,7 +1769,7 @@ export default class ProfitLossMR extends Component { ...@@ -1769,7 +1769,7 @@ export default class ProfitLossMR extends Component {
style={{ color: Number(tableMeta.rowData[18]).toFixed(1) < this.state.minValue || Number(tableMeta.rowData[18]).toFixed(1) > this.state.maxValue ? 'red' : '#000000b0', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: Number(tableMeta.rowData[18]).toFixed(1) < this.state.minValue || Number(tableMeta.rowData[18]).toFixed(1) > this.state.maxValue ? 'red' : '#000000b0', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
suffix={'%'} suffix={'%'}
disabled={true} disabled={true}
value={Number(tableMeta.rowData[18]) == 0 ? "0.0" : fixNumber(Number(handleVariancePercent(tableMeta, 3, 5)), 1)} value={fixNumber(Number(handleVariancePercent(tableMeta, 3, 5)), 1) == 0 ? "0.0" : fixNumber(Number(handleVariancePercent(tableMeta, 3, 5)), 1)}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/> />
} }
......
...@@ -1055,7 +1055,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1055,7 +1055,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value.tbc) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbc), 2) : fixNumber(Number(value.tbc), 1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? (fixNumber(Number(value.tbc), 2) == 0 ? "0.0" : fixNumber(Number(value.tbc), 2)) : (fixNumber(Number(value.tbc), 1) == 0 ? "0.0" : fixNumber(Number(value.tbc), 1))}
/> />
} }
/> />
...@@ -1069,7 +1069,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1069,7 +1069,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value.tbc) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta, 1)), 1) : Number(handleParent(tableMeta, 1))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta, 1)), 1) : Number(handleParent(tableMeta, 1)) == 0 ? "0.0" : Number(handleParent(tableMeta, 1))}
/> />
</span> </span>
: :
...@@ -1086,7 +1086,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1086,7 +1086,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="input" placeholder="input"
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(value.tbc) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(value.tbc), 1) : Number(value.tbc)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value.tbc), 1) : Number(value.tbc) == 0 ? "0.0" : Number(value.tbc)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 0) handleChange(event.target.value, tableMeta, 0)
// console.log(dataTable2) // console.log(dataTable2)
...@@ -1108,7 +1108,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1108,7 +1108,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value.tbc) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 1)), 1) : Number(handleValueFormula(value, tableMeta, 1))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 1)), 1) : Number(handleValueFormula(value, tableMeta, 1)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 1))}
/> />
} }
/> />
...@@ -1135,7 +1135,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1135,7 +1135,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value.fcp) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.fcp), 2) : fixNumber(Number(value.fcp), 1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? (fixNumber(Number(value.fcp), 2) == 0 ? "0.0" : fixNumber(Number(value.fcp), 2)) : (fixNumber(Number(value.fcp), 1) == 0 ? "0.0" : fixNumber(Number(value.fcp), 1))}
/> />
} }
/> />
...@@ -1149,7 +1149,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1149,7 +1149,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta, 2)), 1) : Number(handleParent(tableMeta, 2))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta, 2)), 1) : Number(handleParent(tableMeta, 2)) == 0 ? "0.0" : Number(handleParent(tableMeta, 2))}
/> />
</span> </span>
: :
...@@ -1165,7 +1165,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1165,7 +1165,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)} disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
placeholder="input" placeholder="input"
value={Number(value.fcp) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.fcp), 2) : fixNumber(Number(value.fcp), 1)) : (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp) : Number(value.fcp))} value={this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.fcp), 2) : fixNumber(Number(value.fcp), 1)) : (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? (Number(value.fcp) == 0 ? "0.0" : Number(value.fcp)) : (Number(value.fcp) == 0 ? "0.0" : Number(value.fcp)))}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
// console.log(dataTable2) // console.log(dataTable2)
...@@ -1187,7 +1187,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1187,7 +1187,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value.fcp) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) : Number(handleValueFormula(value, tableMeta, 2))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 2)), 1) : Number(handleValueFormula(value, tableMeta, 2)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 2))}
/> />
} }
/> />
...@@ -1213,7 +1213,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1213,7 +1213,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value.tbf) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? (fixNumber(Number(value.tbf), 2) == 0 ? "0.0" : fixNumber(Number(value.tbf), 2)) : (fixNumber(Number(value.tbf), 1) == 0 ? "0.0" : fixNumber(Number(value.tbf), 1))}
/> />
} }
/> />
...@@ -1227,7 +1227,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1227,7 +1227,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta, 3)), 1) : Number(handleParent(tableMeta, 3))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta, 3)), 1) : Number(handleParent(tableMeta, 3)) == 0 ? "0.0" : Number(handleParent(tableMeta, 3))}
/> />
</span> </span>
: :
...@@ -1243,7 +1243,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1243,7 +1243,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)} disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
placeholder="input" placeholder="input"
value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)) : (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf) : Number(value.tbf))} value={this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value.tbf), 2) : fixNumber(Number(value.tbf), 1)) : (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? (Number(value.tbf) == 0 ? "0.0" : Number(value.tbf)) : (Number(value.tbf) == 0 ? "0.0" : Number(value.tbf)))}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
// console.log(dataTable2) // console.log(dataTable2)
...@@ -1265,7 +1265,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1265,7 +1265,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 2) : fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1)) : (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleValueFormula(value, tableMeta, 3)) : Number(handleValueFormula(value, tableMeta, 3)))} value={this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 2) : fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1)) : (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? (Number(handleValueFormula(value, tableMeta, 3)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 3))) : (Number(handleValueFormula(value, tableMeta, 3)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 3))))}
/> />
} }
/> />
...@@ -1288,7 +1288,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1288,7 +1288,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) : Number(handleValueFormula(value, tableMeta, 3))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) : Number(handleValueFormula(value, tableMeta, 3)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 3))}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[14].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[14].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -1305,7 +1305,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1305,7 +1305,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) : Number(handleValueFormula(value, tableMeta, 3))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) : Number(handleValueFormula(value, tableMeta, 3)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 3))}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -1324,7 +1324,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1324,7 +1324,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) : Number(handleValueFormula(value, tableMeta, 3))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) : Number(handleValueFormula(value, tableMeta, 3)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 3))}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[14].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[14].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -1341,7 +1341,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1341,7 +1341,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value.tbf) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) : Number(handleValueFormula(value, tableMeta, 3))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 3)), 1) : Number(handleValueFormula(value, tableMeta, 3)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 3))}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -1386,7 +1386,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1386,7 +1386,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[16]) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(tableMeta.rowData[16]), 2) : fixNumber(Number(tableMeta.rowData[16]), 1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? (fixNumber(Number(tableMeta.rowData[16]), 2) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[16]), 2)) : (fixNumber(Number(tableMeta.rowData[16]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[16]), 1))}
/> />
} }
/> />
...@@ -1400,7 +1400,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1400,7 +1400,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[16]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta, 4)), 1) : Number(handleParent(tableMeta, 4))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta, 4)), 1) : Number(handleParent(tableMeta, 4)) == 0 ? "0.0" : Number(handleParent(tableMeta, 4))}
/> />
</span> </span>
: :
...@@ -1455,7 +1455,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1455,7 +1455,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(handleTotal(value, tableMeta, 4)), 2) : fixNumber(Number(handleTotal(value, tableMeta, 4)), 1)) : (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleTotal(value, tableMeta, 4)) : Number(handleTotal(value, tableMeta, 4)))} value={this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(handleTotal(value, tableMeta, 4)), 2) : fixNumber(Number(handleTotal(value, tableMeta, 4)), 1)) : (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? (Number(handleTotal(value, tableMeta, 4)) == 0 ? "0.0" : Number(handleTotal(value, tableMeta, 4))) : (Number(handleTotal(value, tableMeta, 4)) == 0 ? "0.0" : Number(handleTotal(value, tableMeta, 4))))}
/> />
} }
/> />
...@@ -1499,7 +1499,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1499,7 +1499,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[11]) == 0 ? "0.0" : String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(tableMeta.rowData[11]), 2) : fixNumber(Number(tableMeta.rowData[11]), 1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? (fixNumber(Number(tableMeta.rowData[11]), 2) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[11]), 2)) : (fixNumber(Number(tableMeta.rowData[11]), 1) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[11]), 1))}
/> />
} }
/> />
...@@ -1513,7 +1513,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1513,7 +1513,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[11]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta, 4)), 1) : Number(handleParent(tableMeta, 4))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleParent(tableMeta, 4)), 1) : Number(handleParent(tableMeta, 4)) == 0 ? "0.0" : Number(handleParent(tableMeta, 4))}
/> />
</span> </span>
: :
...@@ -1528,7 +1528,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1528,7 +1528,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[11]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value), 2) : fixNumber(Number(value), 1)) : (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value) : Number(value))} value={this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? fixNumber(Number(value), 2) : fixNumber(Number(value), 1)) : (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? (Number(value) == 0 ? "0.0" : Number(value)) : (Number(value) == 0 ? "0.0" : Number(value)))}
/> />
} }
/> />
......
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