Commit 49bef4bc authored by Riri Novita's avatar Riri Novita

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

update Issue dan RO

See merge request !2000
parents 181e3be6 729937a9
......@@ -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,11 +1551,12 @@ 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)) ?
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={{
......@@ -1569,7 +1570,7 @@ export default class BalanceSheetMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 9)).toFixed(1)}
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
......@@ -1586,7 +1587,42 @@ export default class BalanceSheetMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 9)).toFixed(1)}
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={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent'
}}
type="text"
placeholder=""
disabled={true}
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>
:
......@@ -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'
}
}}
......
......@@ -1569,7 +1569,7 @@ export default class ProfitLossMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[13]) == 0 ? "0.0" : fixNumber(Number(handleVariance(tableMeta, 1, 0)), 1)}
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}
/>
......@@ -1650,7 +1650,7 @@ export default class ProfitLossMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[15]) == 0 ? "0.0" : fixNumber(Number(handleVariance(tableMeta, 2, 2)), 1)}
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))}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/>
......@@ -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' }}
suffix={'%'}
disabled={true}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleVariancePercent(tableMeta, 3, 5)), 1) : Number(handleVariancePercent(tableMeta, 3, 5))}
value={Number(tableMeta.rowData[18]) == 0 ? "0.0" : fixNumber(Number(handleVariancePercent(tableMeta, 3, 5)), 1)}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
/>
}
......
......@@ -98,7 +98,7 @@ export default class ProfitLossROO extends Component {
this.getLatestUpdate()
console.log(this.props);
// this.getSettingControl()
this.handleViewOnly()
// this.handleViewOnly()
}
handleViewOnly() {
......@@ -367,26 +367,50 @@ export default class ProfitLossROO extends Component {
console.log('test');
// this.setState({ loading: true })
let data = []
if (this.props.defaultCurrency.id == 2) {
this.state.dataTable.map(i => {
data.push({
"item_report_id": i[1],
"notes": String(i[6]),
"last_year_total": String(Number(i[7]).toFixed(1)),
"january": String(Number(i[8]).toFixed(1)),
"february": String(Number(i[9]).toFixed(1)),
"march": String(Number(i[10]).toFixed(1)),
"april": String(Number(i[11]).toFixed(1)),
"may": String(Number(i[12]).toFixed(1)),
"june": String(Number(i[13]).toFixed(1)),
"july": String(Number(i[14]).toFixed(1)),
"august": String(Number(i[15]).toFixed(1)),
"september": String(Number(i[16]).toFixed(1)),
"october": String(Number(i[17]).toFixed(1)),
"november": String(Number(i[18]).toFixed(1)),
"december": String(Number(i[19]).toFixed(1)),
"current_year_total": String(Number(i[20]).toFixed(1)),
"last_year_total": String(Number(i[7])),
"january": String(Number(i[8])),
"february": String(Number(i[9])),
"march": String(Number(i[10])),
"april": String(Number(i[11])),
"may": String(Number(i[12])),
"june": String(Number(i[13])),
"july": String(Number(i[14])),
"august": String(Number(i[15])),
"september": String(Number(i[16])),
"october": String(Number(i[17])),
"november": String(Number(i[18])),
"december": String(Number(i[19])),
"current_year_total": String(Number(i[20])),
})
})
} else {
this.state.dataTable.map(i => {
data.push({
"item_report_id": i[1],
"notes": String(i[6]),
"last_year_total": String(fixNumber(Number(i[7]), 1)),
"january": String(fixNumber(Number(i[8]), 1)),
"february": String(fixNumber(Number(i[9]), 1)),
"march": String(fixNumber(Number(i[10]), 1)),
"april": String(fixNumber(Number(i[11]), 1)),
"may": String(fixNumber(Number(i[12]), 1)),
"june": String(fixNumber(Number(i[13]), 1)),
"july": String(fixNumber(Number(i[14]), 1)),
"august": String(fixNumber(Number(i[15]), 1)),
"september": String(fixNumber(Number(i[16]), 1)),
"october": String(fixNumber(Number(i[17]), 1)),
"november": String(fixNumber(Number(i[18]), 1)),
"december": String(fixNumber(Number(i[19]), 1)),
"current_year_total": String(fixNumber(Number(i[20]), 1)),
})
})
}
let payload = {
"rolling_outlook_id": this.props.rollingOutlookID,
"company_id": this.props.company.company_id,
......@@ -447,18 +471,18 @@ export default class ProfitLossROO extends Component {
"item_report_id": i[1] === undefined ? 0 : i[1],
"item_report": i[2] === undefined ? "" : String(i[2]).trim(),
"notes": i[3] === undefined ? "" : reg.test(String(i[3])) === false ? "" : String(i[3]).trim(),
"january": i[5] === undefined ? "0" : reg.test(String(fixNumber(Number(i[5]), 1))) === false ? "0" : String(fixNumber(Number(i[5]), 1)).trim(),
"february": i[6] === undefined ? "0" : reg.test(String(fixNumber(Number(i[6]), 1))) === false ? "0" : String(fixNumber(Number(i[6]), 1)).trim(),
"march": i[7] === undefined ? "0" : reg.test(String(fixNumber(Number(i[7]), 1))) === false ? "0" : String(fixNumber(Number(i[7]), 1)).trim(),
"april": i[8] === undefined ? "0" : reg.test(String(fixNumber(Number(i[8]), 1))) === false ? "0" : String(fixNumber(Number(i[8]), 1)).trim(),
"may": i[9] === undefined ? "0" : reg.test(String(fixNumber(Number(i[9]), 1))) === false ? "0" : String(fixNumber(Number(i[9]), 1)).trim(),
"june": i[10] === undefined ? "0" : reg.test(String(fixNumber(Number(i[10]), 1))) === false ? "0" : String(fixNumber(Number(i[10]), 1)).trim(),
"july": i[11] === undefined ? "0" : reg.test(String(fixNumber(Number(i[11]), 1))) === false ? "0" : String(fixNumber(Number(i[11]), 1)).trim(),
"august": i[12] === undefined ? "0" : reg.test(String(fixNumber(Number(i[12]), 1))) === false ? "0" : String(fixNumber(Number(i[12]), 1)).trim(),
"september": i[13] === undefined ? "0" : reg.test(String(fixNumber(Number(i[13]), 1))) === false ? "0" : String(fixNumber(Number(i[13]), 1)).trim(),
"october": i[14] === undefined ? "0" : reg.test(String(fixNumber(Number(i[14]), 1))) === false ? "0" : String(fixNumber(Number(i[14]), 1)).trim(),
"november": i[15] === undefined ? "0" : reg.test(String(fixNumber(Number(i[15]), 1))) === false ? "0" : String(fixNumber(Number(i[15]), 1)).trim(),
"december": i[16] === undefined ? "0" : reg.test(String(fixNumber(Number(i[16]), 1))) === false ? "0" : String(fixNumber(Number(i[16]), 1)).trim(),
"january": i[5] === undefined ? "0" : reg.test(String(Number(i[5]))) === false ? "0" : String(Number(i[5])).trim(),
"february": i[6] === undefined ? "0" : reg.test(String(Number(i[6]))) === false ? "0" : String(Number(i[6])).trim(),
"march": i[7] === undefined ? "0" : reg.test(String(Number(i[7]))) === false ? "0" : String(Number(i[7])).trim(),
"april": i[8] === undefined ? "0" : reg.test(String(Number(i[8]))) === false ? "0" : String(Number(i[8])).trim(),
"may": i[9] === undefined ? "0" : reg.test(String(Number(i[9]))) === false ? "0" : String(Number(i[9])).trim(),
"june": i[10] === undefined ? "0" : reg.test(String(Number(i[10]))) === false ? "0" : String(Number(i[10])).trim(),
"july": i[11] === undefined ? "0" : reg.test(String(Number(i[11]))) === false ? "0" : String(Number(i[11])).trim(),
"august": i[12] === undefined ? "0" : reg.test(String(Number(i[12]))) === false ? "0" : String(Number(i[12])).trim(),
"september": i[13] === undefined ? "0" : reg.test(String(Number(i[13]))) === false ? "0" : String(Number(i[13])).trim(),
"october": i[14] === undefined ? "0" : reg.test(String(Number(i[14]))) === false ? "0" : String(Number(i[14])).trim(),
"november": i[15] === undefined ? "0" : reg.test(String(Number(i[15]))) === false ? "0" : String(Number(i[15])).trim(),
"december": i[16] === undefined ? "0" : reg.test(String(Number(i[16]))) === false ? "0" : String(Number(i[16])).trim(),
})
}
})
......@@ -484,6 +508,7 @@ export default class ProfitLossROO extends Component {
currency_id: this.state.defaultCurrencyUpload?.id
}
api.create().checkImportRollingOutlookPL(payload).then(response => {
console.log(response);
// console.log(JSON.stringify(this.state.payload));
console.log("checkUpload Response", response)
if (response.data) {
......@@ -542,27 +567,52 @@ export default class ProfitLossROO extends Component {
uploadProfitLossRO(type) {
let data = []
if (this.state.defaultCurrencyUpload?.id == 2) {
this.state.dataTable.map(i => {
data.push({
"item_report_id": i[1],
"item_report": i[5],
"notes": String(i[6]),
"last_year_total": String(Number(i[7]).toFixed(1)),
"january": String(Number(i[8]).toFixed(1)),
"february": String(Number(i[9]).toFixed(1)),
"march": String(Number(i[10]).toFixed(1)),
"april": String(Number(i[11]).toFixed(1)),
"may": String(Number(i[12]).toFixed(1)),
"june": String(Number(i[13]).toFixed(1)),
"july": String(Number(i[14]).toFixed(1)),
"august": String(Number(i[15]).toFixed(1)),
"september": String(Number(i[16]).toFixed(1)),
"october": String(Number(i[17]).toFixed(1)),
"november": String(Number(i[18]).toFixed(1)),
"december": String(Number(i[19]).toFixed(1)),
"current_year_total": String(Number(i[20]).toFixed(1)),
"last_year_total": String(Number(i[7])),
"january": String(Number(i[8])),
"february": String(Number(i[9])),
"march": String(Number(i[10])),
"april": String(Number(i[11])),
"may": String(Number(i[12])),
"june": String(Number(i[13])),
"july": String(Number(i[14])),
"august": String(Number(i[15])),
"september": String(Number(i[16])),
"october": String(Number(i[17])),
"november": String(Number(i[18])),
"december": String(Number(i[19])),
"current_year_total": String(Number(i[20])),
})
})
} else {
this.state.dataTable.map(i => {
data.push({
"item_report_id": i[1],
"item_report": i[5],
"notes": String(i[6]),
"last_year_total": String(fixNumber(Number(i[7]), 1)),
"january": String(fixNumber(Number(i[8]), 1)),
"february": String(fixNumber(Number(i[9]), 1)),
"march": String(fixNumber(Number(i[10]), 1)),
"april": String(fixNumber(Number(i[11]), 1)),
"may": String(fixNumber(Number(i[12]), 1)),
"june": String(fixNumber(Number(i[13]), 1)),
"july": String(fixNumber(Number(i[14]), 1)),
"august": String(fixNumber(Number(i[15]), 1)),
"september": String(fixNumber(Number(i[16]), 1)),
"october": String(fixNumber(Number(i[17]), 1)),
"november": String(fixNumber(Number(i[18]), 1)),
"december": String(fixNumber(Number(i[19]), 1)),
"current_year_total": String(fixNumber(Number(i[20]), 1)),
})
})
}
console.log("uploadProfitLossRO Data", data)
let body = {
"monthly_report_id": this.props.monthlyReportId,
......@@ -724,6 +774,9 @@ export default class ProfitLossROO extends Component {
let arrayJumlah = []
let tambahan = false
let opet = ""
// if (String(tableMeta.rowData[1]) == 19865 && tableMeta.columnIndex == 11) {
// console.log(arrayFormula)
// }
arrayFormula.map((item, indexs) => {
if (item == 'X') {
tambahan = true
......@@ -763,6 +816,9 @@ export default class ProfitLossROO extends Component {
let array = arrayJumlah
let total = 0
let opt = ""
// if (String(tableMeta.rowData[1]) == 19865 && tableMeta.columnIndex == 11) {
// console.log(array)
// }
array.map((item, index) => {
if (item == "+") {
opt = "tambah"
......@@ -778,7 +834,7 @@ export default class ProfitLossROO extends Component {
} else if (opt == "kurang") {
total = Number(total) - Number(item)
} else if (opt == "kali") {
total = fixNumber(Number(total), 1) * fixNumber(Number(item), 1)// angka yg diupload menjadi bilangan bulat
total = this.props.defaultCurrency.id == 1 ? (fixNumber(Number(total), 1) * fixNumber(Number(item), 1)) : (Number(total) * Number(item)) // angka yg diupload menjadi bilangan bulat
} else if (opt == "bagi") {
total = R.equals((Number(total) / Number(item)), NaN) ? '0' : (R.equals((Number(total) / Number(item)), Infinity) ? '0' : (Number(total) / Number(item) == "-Infinity") ? "0.0" : Number(total) / Number(item))
} else {
......@@ -786,6 +842,9 @@ export default class ProfitLossROO extends Component {
}
}
})
// if (String(tableMeta.rowData[1]) == 19865 && tableMeta.columnIndex == 11) {
// console.log(total)
// }
total = R.equals(total, NaN) ? "0.0" : (R.equals(total, Infinity) ? "0.0" : (total == "-Infinity" ? "0.0" : total))
// if (tableMeta.rowData[1] === 20092) {
// console.log(total);
......@@ -793,7 +852,7 @@ export default class ProfitLossROO extends Component {
// }
// if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] === "" || dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] === undefined || dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] === null) {
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total).toFixed(1)
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = fixNumber(Number(total), 1)//hasil dari penjumlahan/kali/pembagian menjadi bilangan bulat
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = this.props.defaultCurrency.id == 1 ? fixNumber(Number(total), 1) : Number(total) //hasil dari penjumlahan/kali/pembagian menjadi bilangan bulat
// }
......@@ -982,7 +1041,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/>
:
// tableMeta.rowData[0] === 2 ?
......@@ -993,8 +1052,8 @@ export default class ProfitLossROO extends Component {
// type="text"
// placeholder=""
// disabled={true}
// // value={Number(val).toFixed(1)}
// value={Number(handleValue(val, tableMeta)).toFixed(1)}
// // value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
// value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValue(val, tableMeta)), 1) : Number(handleValue(val, tableMeta))}
// />
// </span>
// :
......@@ -1011,7 +1070,7 @@ export default class ProfitLossROO extends Component {
// placeholder=""
// // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
// disabled={true}
// value={Number(val).toFixed(1)}
// value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
// onBlur={(event) => {
// handleChange(event.target.value, tableMeta)
// }}
......@@ -1032,7 +1091,7 @@ export default class ProfitLossROO extends Component {
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
// value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormula(val, tableMeta, 1)), 1) : Number(handleFormula(val, tableMeta, 1))}
// />
// }
// />
......@@ -1049,7 +1108,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ? "0.0" : Number(val)}
/>
}
/>
......@@ -1080,7 +1139,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/>
:
// tableMeta.rowData[0] === 2 ?
......@@ -1091,7 +1150,7 @@ export default class ProfitLossROO extends Component {
// type="text"
// placeholder=""
// disabled={true}
// // value={Number(val).toFixed(1)}
// // value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
// value={val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)}
// />
// </span>
......@@ -1109,7 +1168,7 @@ export default class ProfitLossROO extends Component {
// placeholder=""
// // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
// disabled={true}
// value={val === "0" ? "" : Number(val).toFixed(1)}
// value={val === "0" ? "" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val)}
// onBlur={(event) => {
// handleChange(event.target.value, tableMeta)
// }}
......@@ -1147,7 +1206,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={val === "0" ? "" : Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : val === "0" ? "" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val)}
/>
}
/>
......@@ -1178,7 +1237,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/>
:
// tableMeta.rowData[0] === 2 ?
......@@ -1189,7 +1248,7 @@ export default class ProfitLossROO extends Component {
// type="text"
// placeholder=""
// disabled={true}
// // value={Number(val).toFixed(1)}
// // value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
// value={val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)}
// />
// </span>
......@@ -1207,7 +1266,7 @@ export default class ProfitLossROO extends Component {
// placeholder=""
// // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
// disabled={true}
// value={val === "0" ? "" : Number(val).toFixed(1)}
// value={val === "0" ? "" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val)}
// onBlur={(event) => {
// handleChange(event.target.value, tableMeta)
// }}
......@@ -1245,7 +1304,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={val === "0" ? "" : Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : val === "0" ? "" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val)}
/>
}
/>
......@@ -1276,7 +1335,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/>
:
// tableMeta.rowData[0] === 2 ?
......@@ -1287,7 +1346,7 @@ export default class ProfitLossROO extends Component {
// type="text"
// placeholder=""
// disabled={true}
// // value={Number(val).toFixed(1)}
// // value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
// value={val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)}
// />
// </span>
......@@ -1305,7 +1364,7 @@ export default class ProfitLossROO extends Component {
// placeholder=""
// // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
// disabled={true}
// value={val === "0" ? "" : Number(val).toFixed(1)}
// value={val === "0" ? "" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val)}
// onBlur={(event) => {
// handleChange(event.target.value, tableMeta)
// }}
......@@ -1343,7 +1402,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={val === "0" ? "" : Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : val === "0" ? "" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val)}
/>
}
/>
......@@ -1374,7 +1433,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/>
:
tableMeta.rowData[0] === 2 ?
......@@ -1386,7 +1445,7 @@ export default class ProfitLossROO extends Component {
placeholder=""
disabled={true}
// value={Number(val).toFixed(1)}
value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)) : Number(handleValue(val, tableMeta)).toFixed(1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(handleValue(val, tableMeta)), 1)) : fixNumber(Number(handleValue(val, tableMeta)), 1)) : (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleValue(val, tableMeta))) : Number(handleValue(val, tableMeta)))}
/>
</span>
:
......@@ -1403,7 +1462,7 @@ export default class ProfitLossROO extends Component {
placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' ? false : true}
value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(val), 1)) : fixNumber(Number(val), 1)) : (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val) == 0 ? "0.0" : Number(val)) : Number(val) == 0 ? "0.0" : Number(val))}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1424,7 +1483,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)) : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(handleFormula(val, tableMeta, 1)), 1)) : fixNumber(Number(handleFormula(val, tableMeta, 1)), 1)) : (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1))) : Number(handleFormula(val, tableMeta, 1)))}
/>
}
/>
......@@ -1441,7 +1500,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(val), 1)) : fixNumber(Number(val), 1)) : (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val)) : Number(val))}
/>
}
/>
......@@ -1472,7 +1531,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/>
:
tableMeta.rowData[0] === 2 ?
......@@ -1483,8 +1542,8 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
// value={Number(val).toFixed(1)}
value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)) : Number(handleValue(val, tableMeta)).toFixed(1)}
// value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(handleValue(val, tableMeta)), 1)) : fixNumber(Number(handleValue(val, tableMeta)), 1)) : (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleValue(val, tableMeta))) : Number(handleValue(val, tableMeta)))}
/>
</span>
:
......@@ -1501,7 +1560,7 @@ export default class ProfitLossROO extends Component {
placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' ? false : true}
value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(val), 1)) : fixNumber(Number(val), 1)) : (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val) == 0 ? "0.0": Number(val)) : Number(val) == 0 ? "0.0": Number(val))}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1522,7 +1581,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)) : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(handleFormula(val, tableMeta, 1)), 1)) : fixNumber(Number(handleFormula(val, tableMeta, 1)), 1)) : (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1))) : Number(handleFormula(val, tableMeta, 1)))}
/>
}
/>
......@@ -1539,7 +1598,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(val), 1)) : fixNumber(Number(val), 1)) : (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val)) : Number(val))}
/>
}
/>
......@@ -1570,7 +1629,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/>
:
tableMeta.rowData[0] === 2 ?
......@@ -1581,8 +1640,8 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
// value={Number(val).toFixed(1)}
value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)) : Number(handleValue(val, tableMeta)).toFixed(1)}
// value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(handleValue(val, tableMeta)), 1)) : fixNumber(Number(handleValue(val, tableMeta)), 1)) : (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleValue(val, tableMeta))) : Number(handleValue(val, tableMeta)))}
/>
</span>
:
......@@ -1599,7 +1658,7 @@ export default class ProfitLossROO extends Component {
placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' ? false : true}
value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" :fixNumber(Number(val), 1)) : fixNumber(Number(val), 1)) : (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val) == 0 ? "0.0" : Number(val)) : Number(val) == 0 ? "0.0" : Number(val))}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1620,7 +1679,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)) : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(handleFormula(val, tableMeta, 1)), 1)) : fixNumber(Number(handleFormula(val, tableMeta, 1)), 1)) : (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1))) : Number(handleFormula(val, tableMeta, 1)))}
/>
}
/>
......@@ -1637,7 +1696,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(val), 1)) : fixNumber(Number(val), 1)) : (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val)) : Number(val))}
/>
}
/>
......@@ -1668,7 +1727,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/>
:
tableMeta.rowData[0] === 2 ?
......@@ -1679,8 +1738,8 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
// value={Number(val).toFixed(1)}
value={this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)) : Number(handleValue(val, tableMeta)).toFixed(1)}
// value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(handleValue(val, tableMeta)), 1)) : fixNumber(Number(handleValue(val, tableMeta)), 1)) : (this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleValue(val, tableMeta))) : Number(handleValue(val, tableMeta)))}
/>
</span>
:
......@@ -1697,7 +1756,7 @@ export default class ProfitLossROO extends Component {
placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2' ? false : true}
value={this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(val), 1)) : fixNumber(Number(val), 1)) : (this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val) == 0 ? "0.0" : Number(val)) : Number(val) == 0 ? "0.0" : Number(val))}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1718,7 +1777,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)) : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(handleFormula(val, tableMeta, 1)), 1)) : fixNumber(Number(handleFormula(val, tableMeta, 1)), 1)) : (this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1))) : Number(handleFormula(val, tableMeta, 1)))}
/>
}
/>
......@@ -1735,7 +1794,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(val), 1)) : fixNumber(Number(val), 1)) : (this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val) == 0 ? "0.0" : Number(val)) : Number(val) == 0 ? "0.0" : Number(val))}
/>
}
/>
......@@ -1767,7 +1826,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/>
:
tableMeta.rowData[0] === 2 ?
......@@ -1778,8 +1837,8 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
// value={Number(val).toFixed(1)}
value={this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)) : Number(handleValue(val, tableMeta)).toFixed(1)}
// value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(handleValue(val, tableMeta)), 1)) : fixNumber(Number(handleValue(val, tableMeta)), 1)) : (this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleValue(val, tableMeta))) : Number(handleValue(val, tableMeta)))}
/>
</span>
:
......@@ -1796,7 +1855,7 @@ export default class ProfitLossROO extends Component {
placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2' ? false : true}
value={this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(val), 1)) : fixNumber(Number(val), 1)) : (this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val) == 0 ? "0.0" : Number(val)) : Number(val) == 0 ? "0.0" : Number(val))}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1817,7 +1876,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)) : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(handleFormula(val, tableMeta, 1)), 1)) : fixNumber(Number(handleFormula(val, tableMeta, 1)), 1)) : (this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1))) : Number(handleFormula(val, tableMeta, 1)))}
/>
}
/>
......@@ -1834,7 +1893,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(val), 1)) : fixNumber(Number(val), 1)) : (this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val) == 0 ? "0.0" : Number(val)) : Number(val) == 0 ? "0.0" : Number(val))}
/>
}
/>
......@@ -1866,7 +1925,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/>
:
tableMeta.rowData[0] === 2 ?
......@@ -1877,8 +1936,8 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
// value={Number(val).toFixed(1)}
value={this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleValue(val, tableMeta)).toFixed(1)) : Number(handleValue(val, tableMeta)).toFixed(1)}
// value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(handleValue(val, tableMeta)), 1)) : fixNumber(Number(handleValue(val, tableMeta)), 1)) : (this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleValue(val, tableMeta))) : Number(handleValue(val, tableMeta)))}
/>
</span>
:
......@@ -1895,7 +1954,7 @@ export default class ProfitLossROO extends Component {
placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2' ? false : true}
value={this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(val), 1)) : fixNumber(Number(val), 1)) : (this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val) == 0 ? "0.0" : Number(val)) : Number(val) == 0 ? "0.0" : Number(val))}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1916,7 +1975,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1)).toFixed(1)) : Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(handleFormula(val, tableMeta, 1)), 1)) : fixNumber(Number(handleFormula(val, tableMeta, 1)), 1)) : (this.props.quarter == 'q3' ? (val === "0" ? "" : Number(handleFormula(val, tableMeta, 1))) : Number(handleFormula(val, tableMeta, 1)))}
/>
}
/>
......@@ -1933,7 +1992,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q3' ? (val === "0" ? "" : fixNumber(Number(val), 1)) : fixNumber(Number(val), 1)) : (this.props.quarter == 'q3' ? (val === "0" ? "" : Number(val) == 0 ? "0.0" : Number(val)) : Number(val) == 0 ? "0.0" : Number(val))}
/>
}
/>
......@@ -1966,7 +2025,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/>
:
tableMeta.rowData[0] === 2 ?
......@@ -1977,8 +2036,8 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
// value={Number(val).toFixed(1)}
value={Number(handleValue(val, tableMeta)).toFixed(1)}
// value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValue(val, tableMeta)), 1) : Number(handleValue(val, tableMeta))}
/>
</span>
:
......@@ -1995,7 +2054,7 @@ export default class ProfitLossROO extends Component {
placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={false}
value={Number(val).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ? "0.0" : Number(val)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -2016,7 +2075,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormula(val, tableMeta, 1)), 1) : Number(handleFormula(val, tableMeta, 1))}
/>
}
/>
......@@ -2033,7 +2092,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ? "0.0" : Number(val)}
/>
}
/>
......@@ -2066,7 +2125,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/>
:
tableMeta.rowData[0] === 2 ?
......@@ -2077,8 +2136,8 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
// value={Number(val).toFixed(1)}
value={Number(handleValue(val, tableMeta)).toFixed(1)}
// value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValue(val, tableMeta)), 1) : Number(handleValue(val, tableMeta))}
/>
</span>
:
......@@ -2095,7 +2154,7 @@ export default class ProfitLossROO extends Component {
placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={false}
value={Number(val).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ? "0.0" : Number(val)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -2116,7 +2175,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormula(val, tableMeta, 1)), 1) : Number(handleFormula(val, tableMeta, 1))}
/>
}
/>
......@@ -2133,7 +2192,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ? "0.0" : Number(val)}
/>
}
/>
......@@ -2164,7 +2223,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/>
:
tableMeta.rowData[0] === 2 ?
......@@ -2175,8 +2234,8 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
// value={Number(val).toFixed(1)}
value={Number(handleValue(val, tableMeta)).toFixed(1)}
// value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValue(val, tableMeta)), 1) : Number(handleValue(val, tableMeta))}
/>
</span>
:
......@@ -2193,7 +2252,7 @@ export default class ProfitLossROO extends Component {
placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={false}
value={Number(val).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ? "0.0" : Number(val)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -2214,7 +2273,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleFormula(val, tableMeta, 1)).toFixed(1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormula(val, tableMeta, 1)), 1) : Number(handleFormula(val, tableMeta, 1))}
/>
}
/>
......@@ -2231,7 +2290,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ? "0.0" : Number(val)}
/>
}
/>
......@@ -2262,7 +2321,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(val).toFixed(1)}
value={Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/>
:
<div style={{ flex: 1 }}>
......@@ -2276,7 +2335,7 @@ export default class ProfitLossROO extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleTotal(val, tableMeta)).toFixed(1)}
value={Number(val) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleTotal(val, tableMeta)), 1) : Number(handleTotal(val, tableMeta))}
/>
}
/>
......
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