Commit 20f2bb00 authored by d.arizona's avatar d.arizona

apdet

parent 3ad69405
......@@ -380,7 +380,7 @@ export default class ListOfCreditFacilities extends Component {
)
}
console.log(dataTable)
this.setState({ dataTable, loading: false, visibleLOCFMR: true, totalOutStand: 0, diff: 0 }, () => {
this.setState({ dataTable, loading: false, visibleLOCFMR: true }, () => {
this.handleCalculate()
})
}
......@@ -940,13 +940,17 @@ export default class ListOfCreditFacilities extends Component {
}
api.create().getPerBSiMontlyReportLOCF(payload).then((response) => {
console.log(response)
if (this.state.get_for == 'view') {
this.setState({perBS: "0.0"})
} else {
// if (this.state.get_for == 'view') {
// this.setState({perBS: "0.0"})
// } else {
if (response.data.status == "success") {
this.setState({perBS: response.data.data.per_bs == null || response.data.data.per_bs == ''? Number(0).toFixed(1) : Number(response.data.data.per_bs).toFixed(1)})
}
this.setState({
perBS: response.data.data.per_bs == null || response.data.data.per_bs == ''? Number(0).toFixed(1) : Number(response.data.data.per_bs).toFixed(1),
totalOutStand: response.data.data.total_loan,
diff: response.data.data.diff
})
}
// }
})
}
......@@ -1365,12 +1369,22 @@ export default class ListOfCreditFacilities extends Component {
// console.log(dataTampungBank)
console.log(totalLoan);
console.log(this.state.perBS)
console.log(this.state.diff)
// console.log(bankNameEmpty)
// dataTable: newData, totalOutStand: newData[newData.length-1][22]
if (bankNameEmpty) {
this.setState({ loading: false, dataTable: this.state.dataTable, totalOutStand: 0, diff: Number(0 - this.state.perBS).toFixed(1), saveDraft: false, saveComp: true})
if (this.state.get_for == 'view') {
this.setState({ loading: false, dataTable: this.state.dataTable, diff: this.state.diff == null? "0.0" : Number(0 - this.state.perBS).toFixed(1), perBS: this.state.totalOutStand == null? "0.0" : this.state.totalOutStand, saveDraft: false, saveComp: true})
} else {
this.setState({ loading: false, dataTable: this.state.dataTable, diff: Number(0 - this.state.perBS).toFixed(1), saveDraft: false, saveComp: true})
}
} else {
this.setState({ loading: false, dataTable: newData, totalOutStand: Number(totalLoan).toFixed(1), diff: Number(totalLoan - this.state.perBS).toFixed(1), saveDraft: false, saveComp: Number(totalLoan - this.state.perBS) == 0? false : true })
if (this.state.get_for == 'view') {
this.setState({ loading: false, dataTable: newData, diff: this.state.diff == null? "0.0" : Number(totalLoan - this.state.perBS).toFixed(1), perBS: this.state.totalOutStand == null? "0.0" : this.state.totalOutStand })
} else {
this.setState({ loading: false, dataTable: newData, diff: Number(totalLoan - this.state.perBS).toFixed(1), saveDraft: false, saveComp: Number(totalLoan - this.state.perBS) == 0? false : true })
}
}
}, 100);
})
......
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