Commit 5b4dc246 authored by Riri Novita's avatar Riri Novita

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

Fixing Issue RO

See merge request !2125
parents aa7174e7 322d60a5
...@@ -396,6 +396,7 @@ export default class BalanceSheetRO extends Component { ...@@ -396,6 +396,7 @@ export default class BalanceSheetRO extends Component {
"currency_id": this.props.defaultCurrency.id, "currency_id": this.props.defaultCurrency.id,
"balance_sheet": data "balance_sheet": data
} }
console.log(payload);
api.create('UPLOAD').createRollingOutlookBS(payload).then(response => { api.create('UPLOAD').createRollingOutlookBS(payload).then(response => {
console.log(payload); console.log(payload);
console.log(response); console.log(response);
...@@ -459,9 +460,16 @@ export default class BalanceSheetRO extends Component { ...@@ -459,9 +460,16 @@ export default class BalanceSheetRO extends Component {
this.setState({ loading: true }) this.setState({ loading: true })
let n = 0 let n = 0
for (n = (this.props.quarter == 'q1' ? 10 : (this.props.quarter == 'q2' ? 13 : 16)); n <= 18; n++) { for (n = (this.props.quarter == 'q1' ? 10 : (this.props.quarter == 'q2' ? 13 : 16)); n <= 18; n++) {
if ((this.props.defaultCurrency.id == 1 ? fixNumber(Number(i[n]), 2) : Number(i[n]) < Number(this.state.minValue) || this.props.defaultCurrency.id == 1 ? fixNumber(Number(i[n]), 1) : Number(i[n]) > Number(this.state.maxValue))) { if (this.props.defaultCurrency.id == 1) {
if ((fixNumber(Number(i[n]), 2) < Number(this.state.minValue) || fixNumber(Number(i[n]), 1) > Number(this.state.maxValue))) {
err = true err = true
} }
} else {
if ((Number(i[n]) < Number(this.state.minValue) || Number(i[n]) > Number(this.state.maxValue))) {
err = true
}
}
} }
} }
}) })
...@@ -1479,7 +1487,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1479,7 +1487,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -1496,7 +1504,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1496,7 +1504,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -1648,7 +1656,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1648,7 +1656,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -1665,7 +1673,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1665,7 +1673,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -1817,7 +1825,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1817,7 +1825,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -1834,7 +1842,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1834,7 +1842,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -1986,7 +1994,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1986,7 +1994,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -2003,7 +2011,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2003,7 +2011,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -2155,7 +2163,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2155,7 +2163,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -2172,7 +2180,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2172,7 +2180,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -2323,7 +2331,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2323,7 +2331,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -2340,7 +2348,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2340,7 +2348,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -2491,7 +2499,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2491,7 +2499,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -2508,7 +2516,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2508,7 +2516,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -2659,7 +2667,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2659,7 +2667,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -2676,7 +2684,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2676,7 +2684,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -2722,7 +2730,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2722,7 +2730,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ? "0.0" : fixNumber(Number(val),1)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ? "0.0" : fixNumber(Number(val), 1)}
/> />
: :
tableMeta.rowData[0] === 2 ? tableMeta.rowData[0] === 2 ?
...@@ -2827,7 +2835,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2827,7 +2835,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -2844,7 +2852,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2844,7 +2852,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleValidation(val, tableMeta)),12)} value={fixNumber(Number(handleValidation(val, tableMeta)), 12)}
/> />
</LightTooltip> </LightTooltip>
: :
......
...@@ -760,7 +760,6 @@ export default class TaxPlanning extends Component { ...@@ -760,7 +760,6 @@ export default class TaxPlanning extends Component {
// let data = [] // let data = []
let errorContrl = this.state.buttonError let errorContrl = this.state.buttonError
let editAble = this.state.editAble let editAble = this.state.editAble
// console.log(this.state.dataTable)
this.state.dataTable.map((i, index) => { this.state.dataTable.map((i, index) => {
if (String(i[8]) == "Control (should be nil)") { if (String(i[8]) == "Control (should be nil)") {
this.setState({ loading: true }) this.setState({ loading: true })
...@@ -7190,11 +7189,15 @@ export default class TaxPlanning extends Component { ...@@ -7190,11 +7189,15 @@ export default class TaxPlanning extends Component {
marginRight: 20 marginRight: 20
}} }}
onClick={() => { onClick={() => {
this.setState({ loading: true, dataTable: dataTable2 }, () => { this.setState({ datatable: dataTable2 }, () => {
setTimeout(() => {
this.setState({ loading: true }, () => {
setTimeout(() => { setTimeout(() => {
this.handleValidate() this.handleValidate()
}, 100); }, 100);
}) })
}, 100);
})
}} }}
> >
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}> <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
...@@ -7308,11 +7311,15 @@ export default class TaxPlanning extends Component { ...@@ -7308,11 +7311,15 @@ export default class TaxPlanning extends Component {
}} }}
onClick={() => { onClick={() => {
// this.forceUpdate() // this.forceUpdate()
this.setState({ loading: true, buttonDraft: false }, () => { this.setState({ datatable: dataTable2 }, () => {
setTimeout(() => {
this.setState({ loading: true }, () => {
setTimeout(() => { setTimeout(() => {
this.handleValidate() this.handleValidate()
}, 100); }, 100);
}) })
}, 100);
})
}} }}
> >
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}> <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
......
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