Commit 7e58bf90 authored by Riri Novita's avatar Riri Novita

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

LOV Done

See merge request !2192
parents fcc16ad8 45b2ef78
...@@ -553,8 +553,7 @@ const create = (type = "") => { ...@@ -553,8 +553,7 @@ const create = (type = "") => {
const getTypeOfInvestment = () => api.get('setting_type/get_all_setting_type_by_investment') const getTypeOfInvestment = () => api.get('setting_type/get_all_setting_type_by_investment')
const validateSaveLOV = (body) => api.post('transaction/lov/monthly_report/validate_save', body) const validateSaveLOV = (body) => api.post('transaction/lov/monthly_report/validate_save', body)
const validateSaveLOCF = (body) => api.post('transaction/locf/monthly_report/validate_save', body) const validateSaveLOCF = (body) => api.post('transaction/locf/monthly_report/validate_save', body)
const uploadMonthlyReportLOV = (body) => api.post('transaction/lov/monthly_report/import_monthly_report', body) const createMonthlyReportLOV = (body) => api.post('transaction/lov/monthly_report/save_monthly_report', body)
const createMonthlyReportLOV = (body) => api.post('transaction/lov/monthly_report/create_monthly_report', body)
// Superadmin Approve // Superadmin Approve
...@@ -961,7 +960,6 @@ const create = (type = "") => { ...@@ -961,7 +960,6 @@ const create = (type = "") => {
getTypeOfInvestment, getTypeOfInvestment,
validateSaveLOCF, validateSaveLOCF,
validateSaveLOV, validateSaveLOV,
uploadMonthlyReportLOV,
createMonthlyReportLOV createMonthlyReportLOV
} }
......
...@@ -146,7 +146,7 @@ export default class LOCF extends Component { ...@@ -146,7 +146,7 @@ export default class LOCF extends Component {
if (this.props.dataTablelocf !== prevProps.dataTablelocf) { if (this.props.dataTablelocf !== prevProps.dataTablelocf) {
let array = this.props.dataTablelocf let array = this.props.dataTablelocf
let datas = array[array.length - 1] let datas = array[array.length - 1]
this.setState({ dataTable: this.props.dataTablelocf, diff: datas[46], perBS: datas[48] }) this.setState({ dataTable: this.props.dataTablelocf, diff: datas[46], loanTotal: datas[47], perBS: datas[48] })
} }
if (this.props.loadingChild !== prevProps.loadingChild) { if (this.props.loadingChild !== prevProps.loadingChild) {
this.setState({ loading: this.props.loadingChild }) this.setState({ loading: this.props.loadingChild })
...@@ -269,7 +269,7 @@ export default class LOCF extends Component { ...@@ -269,7 +269,7 @@ export default class LOCF extends Component {
item.locf.notes, item.locf.notes,
item.diff, item.diff,
item.total_loan, item.total_loan,
item.per_bs item.per_bs,
// index // index
]) ])
} }
...@@ -345,7 +345,7 @@ export default class LOCF extends Component { ...@@ -345,7 +345,7 @@ export default class LOCF extends Component {
}) })
console.log(dataTable) console.log(dataTable)
let lastArray = dataTable[res.length - 1] let lastArray = dataTable[res.length - 1]
this.setState({ dataTable, diff: lastArray[46], perBS: lastArray[48], loading: false, visibleLOCFMR: true }, () => { this.setState({ dataTable, diff: lastArray[46], loanTotal: lastArray[47], perBS: lastArray[48], loading: false, visibleLOCFMR: true }, () => {
this.props.sendToParent(dataTable, lastArray, 'LOCF') this.props.sendToParent(dataTable, lastArray, 'LOCF')
}) })
} }
...@@ -452,7 +452,7 @@ export default class LOCF extends Component { ...@@ -452,7 +452,7 @@ export default class LOCF extends Component {
"locf": payload, "locf": payload,
"per_bs": this.state.perBS, "per_bs": this.state.perBS,
"diff": this.state.diff, "diff": this.state.diff,
"total_loan": this.state.perBS "total_loan": this.state.loanTotal
} }
console.log(body) console.log(body)
this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[0][0] }) this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[0][0] })
...@@ -548,13 +548,15 @@ export default class LOCF extends Component { ...@@ -548,13 +548,15 @@ export default class LOCF extends Component {
item.other_ratio4_current === null ? "0.0" : item.other_ratio4_current === "" ? "0.0" : item.other_ratio4_current, item.other_ratio4_current === null ? "0.0" : item.other_ratio4_current === "" ? "0.0" : item.other_ratio4_current,
item.notes, item.notes,
item.diff, item.diff,
item.total_loan,
item.per_bs item.per_bs
]) ])
}) })
console.log(dataTable); console.log(dataTable);
let lastArray = dataTable[dataTable.length - 1] let lastArray = dataTable[dataTable.length - 1]
this.setState({ dataTable, diff: lastArray[46], perBS: lastArray[47], dataLoaded: true, loading: false, buttonError: false, dataDelete: [] }, () => { console.log(lastArray);
this.setState({ dataTable, diff: lastArray[46], loanTotal: lastArray[47], perBS: lastArray[48], dataLoaded: true, loading: false, buttonError: false, dataDelete: [] }, () => {
console.log(this.state.visibleLOCFMR); console.log(this.state.visibleLOCFMR);
this.props.sendToParent(dataTable, lastArray , 'LOCF', 'upload', this.state.visibleLOCFMR) this.props.sendToParent(dataTable, lastArray , 'LOCF', 'upload', this.state.visibleLOCFMR)
}) })
...@@ -572,172 +574,6 @@ export default class LOCF extends Component { ...@@ -572,172 +574,6 @@ export default class LOCF extends Component {
}) })
} }
// uploadLOCF(type) {
// let data = []
// let error = false
// this.deleteReport()
// this.state.dataTable.map(i => {
// if (i[0] == 3) {
// if (i[6] == null || i[7] == null || i[8] == "" || i[9] == "" || i[10] == "" || i[11] == "") {
// error = true
// }
// if (i[7].value == 'Others' && i[18] == '') {
// error = true
// }
// let tgl = String(i[9]).split('-')
// let checkUndifined = tgl.findIndex((val) => val == undefined)
// if (this.props.defaultCurrency.id == 2) {
// data.push({
// "item_report_id": i[1],
// "borrower_comp_name": i[5],
// "bank_name": i[6] == null ? [6] : i[6].value,
// "type_of_credit": i[7] == null ? i[7] : i[7].value,
// "remarks": i[8],
// // "loan_maturity_date": i[9],
// "loan_maturity_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])),
// // "loan_maturity_date": i[9] !== undefined || i[9] !== "null" || i[9] !== null? (String(tgl[2]).length <= 2? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])) : "",
// "interest": i[10] == "" ? "0.00" : i[10],
// "currency": i[11],
// "loan_plafond_amount_ori": Number(i[12]) == "" ? "0.0" : Number(i[12]),
// "loan_plafond_amount_idr": Number(i[13]) == "" ? "0.0" : Number(i[13]),
// "out_loan_ki_amount_ori": Number(i[14]) == "" ? "0.0" : Number(i[14]),
// "out_loan_ki_amount_idr": Number(i[15]) == "" ? "0.0" : Number(i[15]),
// "out_loan_kmk_amount_ori": Number(i[16]) == "" ? "0.0" : Number(i[16]),
// "out_loan_kmk_amount_idr": Number(i[17]) == "" ? "0.0" : Number(i[17]),
// // "mtd_vs_previous_month": i[18],
// "out_loan_other_type": i[18],
// "out_loan_other_amount_ori": Number(i[19]) == "" ? "0.0" : Number(i[19]),
// "out_loan_other_amount_idr": Number(i[20]) == "" ? "0.0" : Number(i[20]),
// "total_out_loan_ori": Number(i[21]) == "" ? "0.0" : Number(i[21]),
// "total_out_loan_idr": Number(i[22]) == "" ? "0.0" : Number(i[22]),
// "remaining_plafond_ori": Number(i[23]) == "" ? "0.0" : Number(i[23]),
// "remaining_plafond_idr": Number(i[24]) == "" ? "0.0" : Number(i[24]),
// "current_ratio_financial": Number(i[25]) == "" ? "0.00" : Number(i[25]),
// "current_ratio_current": Number(i[26]) == "" ? "0.00" : Number(i[26]),
// "der_financial": Number(i[27]) == "" ? "0.00" : Number(i[27]),
// "der_current": Number(i[28]) == "" ? "0.00" : Number(i[28]),
// "debt_to_ebitda_financial": Number(i[29]) == "" ? "0.00" : Number(i[29]),
// "debt_to_ebitda_current": Number(i[30]) == "" ? "0.00" : Number(i[30]),
// "ebitda_to_interest_financial": Number(i[31]) == "" ? "0.00" : Number(i[31]),
// "ebitda_to_interest_current": Number(i[32]) == "" ? "0.00" : Number(i[32]),
// "other_ratio1_ratio_name": i[33],
// "other_ratio1_financial": Number(i[34]) == "" ? "0.00" : Number(i[34]),
// "other_ratio1_current": Number(i[35]) == "" ? "0.00" : Number(i[35]),
// "other_ratio2_ratio_name": i[36],
// "other_ratio2_financial": Number(i[37]) == "" ? "0.00" : Number(i[37]),
// "other_ratio2_current": Number(i[38]) == "" ? "0.00" : Number(i[38]),
// "other_ratio3_ratio_name": i[39],
// "other_ratio3_financial": Number(i[40]) == "" ? "0.00" : Number(i[40]),
// "other_ratio3_current": Number(i[41]) == "" ? "0.00" : Number(i[41]),
// "other_ratio4_ratio_name": i[42],
// "other_ratio4_financial": Number(i[43]) == "" ? "0.00" : Number(i[43]),
// "other_ratio4_current": Number(i[44]) == "" ? "0.00" : Number(i[44]),
// "notes": i[45],
// })
// } else {
// data.push({
// "item_report_id": i[1],
// "borrower_comp_name": i[5],
// "bank_name": i[6] == null ? [6] : i[6].value,
// "type_of_credit": i[7] == null ? i[7] : i[7].value,
// "remarks": i[8],
// // "loan_maturity_date": i[9],
// "loan_maturity_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])),
// // "loan_maturity_date": i[9] !== undefined || i[9] !== "null" || i[9] !== null? (String(tgl[2]).length <= 2? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])) : "",
// "interest": i[10] == "" ? "0.00" : i[10],
// "currency": i[11],
// "loan_plafond_amount_ori": fixNumber(Number(i[12]), 1) == "" ? "0.0" : fixNumber(Number(i[12]), 1),
// "loan_plafond_amount_idr": fixNumber(Number(i[13]), 1) == "" ? "0.0" : fixNumber(Number(i[13]), 1),
// "out_loan_ki_amount_ori": fixNumber(Number(i[14]), 1) == "" ? "0.0" : fixNumber(Number(i[14]), 1),
// "out_loan_ki_amount_idr": fixNumber(Number(i[15]), 1) == "" ? "0.0" : fixNumber(Number(i[15]), 1),
// "out_loan_kmk_amount_ori": fixNumber(Number(i[16]), 1) == "" ? "0.0" : fixNumber(Number(i[16]), 1),
// "out_loan_kmk_amount_idr": fixNumber(Number(i[17]), 1) == "" ? "0.0" : fixNumber(Number(i[17]), 1),
// // "mtd_vs_previous_month": i[18],
// "out_loan_other_type": i[18],
// "out_loan_other_amount_ori": fixNumber(Number(i[19]), 1) == "" ? "0.0" : fixNumber(Number(i[19]), 1),
// "out_loan_other_amount_idr": fixNumber(Number(i[20]), 1) == "" ? "0.0" : fixNumber(Number(i[20]), 1),
// "total_out_loan_ori": fixNumber(Number(i[21]), 1) == "" ? "0.0" : fixNumber(Number(i[21]), 1),
// "total_out_loan_idr": fixNumber(Number(i[22]), 1) == "" ? "0.0" : fixNumber(Number(i[22]), 1),
// "remaining_plafond_ori": fixNumber(Number(i[23]), 1) == "" ? "0.0" : fixNumber(Number(i[23]), 1),
// "remaining_plafond_idr": fixNumber(Number(i[24]), 1) == "" ? "0.0" : fixNumber(Number(i[24]), 1),
// "current_ratio_financial": fixNumber(Number(i[25]), 2) == "" ? "0.00" : fixNumber(Number(i[25]), 2),
// "current_ratio_current": fixNumber(Number(i[26]), 2) == "" ? "0.00" : fixNumber(Number(i[26]), 2),
// "der_financial": fixNumber(Number(i[27]), 2) == "" ? "0.00" : fixNumber(Number(i[27]), 2),
// "der_current": fixNumber(Number(i[28]), 2) == "" ? "0.00" : fixNumber(Number(i[28]), 2),
// "debt_to_ebitda_financial": fixNumber(Number(i[29]), 2) == "" ? "0.00" : fixNumber(Number(i[29]), 2),
// "debt_to_ebitda_current": fixNumber(Number(i[30]), 2) == "" ? "0.00" : fixNumber(Number(i[30]), 2),
// "ebitda_to_interest_financial": fixNumber(Number(i[31]), 2) == "" ? "0.00" : fixNumber(Number(i[31]), 2),
// "ebitda_to_interest_current": fixNumber(Number(i[32]), 2) == "" ? "0.00" : fixNumber(Number(i[32]), 2),
// "other_ratio1_ratio_name": i[33],
// "other_ratio1_financial": fixNumber(Number(i[34]), 2) == "" ? "0.00" : fixNumber(Number(i[34]), 2),
// "other_ratio1_current": fixNumber(Number(i[35]), 2) == "" ? "0.00" : fixNumber(Number(i[35]), 2),
// "other_ratio2_ratio_name": i[36],
// "other_ratio2_financial": fixNumber(Number(i[37]), 2) == "" ? "0.00" : fixNumber(Number(i[37]), 2),
// "other_ratio2_current": fixNumber(Number(i[38]), 2) == "" ? "0.00" : fixNumber(Number(i[38]), 2),
// "other_ratio3_ratio_name": i[39],
// "other_ratio3_financial": fixNumber(Number(i[40]), 2) == "" ? "0.00" : fixNumber(Number(i[40]), 2),
// "other_ratio3_current": fixNumber(Number(i[41]), 2) == "" ? "0.00" : fixNumber(Number(i[41]), 2),
// "other_ratio4_ratio_name": i[42],
// "other_ratio4_financial": fixNumber(Number(i[43]), 2) == "" ? "0.00" : fixNumber(Number(i[43]), 2),
// "other_ratio4_current": fixNumber(Number(i[44]), 2) == "" ? "0.00" : fixNumber(Number(i[44]), 2),
// "notes": i[45],
// })
// }
// }
// })
// let body = {
// "monthly_report_id": this.props.monthlyReportId,
// "company_id": this.props.company.company_id,
// "periode": this.props.periode,
// "report_id": this.props.report_id,
// "status": type,
// "months": this.props.month.month_id,
// "currency_id": this.props.defaultCurrency.id,
// "locf": data,
// "per_bs": this.state.perBS,
// "diff": this.state.diff,
// "total_loan": this.state.perBS
// }
// console.log(JSON.stringify(body));
// if (error && type == 'submitted') {
// this.setState({ handleDoubleClick: 0, saveDraft: false, saveComp: true, loading: false, snekbar: true, snekbarMsg: 'Data Incomplete', handleDoubleClick: 0 })
// } else {
// api.create('UPLOAD').uploadMonthlyReportLOCF(body).then(response => {
// console.log(response);
// if (response.data) {
// if (response.ok) {
// if (response.data.status === "success") {
// this.props.saveToMonthlyReport('LOCF')
// // this.props.onClickClose()
// // this.props.getReport()
// } else {
// if (response.data?.message == "Please Set Up Rate Currency First") {
// this.setState({ visibleAlertSave: true })
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
// if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
// setTimeout(() => {
// localStorage.removeItem(Constant.TOKEN)
// window.location.reload();
// }, 1000);
// }
// })
// }
// // alert(response.data.status)
// }
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false, handleDoubleClick: 0 })
// }
// } else {
// this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false, handleDoubleClick: 0 })
// }
// this.setState({ handleDoubleClick: 0 })
// })
// }
// }
getBankData() { getBankData() {
let body = { let body = {
group: 'BANK', group: 'BANK',
...@@ -892,37 +728,6 @@ export default class LOCF extends Component { ...@@ -892,37 +728,6 @@ export default class LOCF extends Component {
}) })
} }
// getPerBS() {
// let payload = {
// "report_id": this.props.report_id,
// "revision": Number(this.props.revision),
// "periode": this.props.periode,
// "company_id": this.props.company.company_id,
// "monthly_report_id": this.props.monthlyReportId,
// "months": this.props.month.month_id,
// "currency_id": this.props.defaultCurrency.id,
// "get_for": this.props.get_for
// }
// api.create().getPerBSiMontlyReportLOCF(payload).then((response) => {
// console.log(response)
// // if (this.props.get_for == 'view') {
// // this.setState({perBS: "0.0"})
// // } else {
// if (response.data) {
// if (response.data.status == "success") {
// this.setState({
// perBS: this.props.defaultCurrency.id == 1 ? (response.data.data.per_bs == null || response.data.data.per_bs == '' ? fixNumber(Number(0), 1) : fixNumber(Number(response.data.data.per_bs), 1)) : (response.data.data.per_bs == null || response.data.data.per_bs == '' ? Number(0) : Number(response.data.data.per_bs)),
// perBS: response.data.data.total_loan,
// diff: response.data.data.diff
// })
// }
// } else {
// this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
// }
// // }
// })
// }
getDataRatio() { getDataRatio() {
let payload = { let payload = {
"report": 'ratio', "report": 'ratio',
...@@ -1722,7 +1527,8 @@ export default class LOCF extends Component { ...@@ -1722,7 +1527,8 @@ export default class LOCF 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={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[12], tableMeta, 12)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[12], tableMeta, 12)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[12], tableMeta, 12))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[12], tableMeta, 12)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[12], tableMeta, 12)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[12], tableMeta, 12))}
value={this.props.defaultCurrency.id == 1 ? (fixNumber(Number(tableMeta.rowData[12]), 1) == 0.0 ? "0.0" : fixNumber(Number(tableMeta.rowData[12]), 1)) : (Number(tableMeta.rowData[12]) == 0.0 ? "0.0" : Number(tableMeta.rowData[12]))}
/> />
} }
/> />
...@@ -1769,7 +1575,8 @@ export default class LOCF extends Component { ...@@ -1769,7 +1575,8 @@ export default class LOCF 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={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[13], tableMeta, 13)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[13], tableMeta, 13)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[13], tableMeta, 13))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[13], tableMeta, 13)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[13], tableMeta, 13)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[13], tableMeta, 13))}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[13]), 1) : Number(tableMeta.rowData[13]) == 0 ? "0.0" : Number(tableMeta.rowData[13])}
/> />
} }
/> />
...@@ -1851,7 +1658,8 @@ export default class LOCF extends Component { ...@@ -1851,7 +1658,8 @@ export default class LOCF 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={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[14], tableMeta, 14)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[14], tableMeta, 14)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[14], tableMeta, 14))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[14], tableMeta, 14)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[14], tableMeta, 14)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[14], tableMeta, 14))}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[14]), 1) : Number(tableMeta.rowData[14]) == 0 ? "0.0" : Number(tableMeta.rowData[14])}
/> />
} }
/> />
...@@ -1897,7 +1705,8 @@ export default class LOCF extends Component { ...@@ -1897,7 +1705,8 @@ export default class LOCF 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={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[15], tableMeta, 15)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[15], tableMeta, 15)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[15], tableMeta, 15))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[15], tableMeta, 15)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[15], tableMeta, 15)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[15], tableMeta, 15))}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[15]), 1) : Number(tableMeta.rowData[15]) == 0 ? "0.0" : Number(tableMeta.rowData[15])}
/> />
} }
/> />
...@@ -1978,7 +1787,8 @@ export default class LOCF extends Component { ...@@ -1978,7 +1787,8 @@ export default class LOCF 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={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[16], tableMeta, 16)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[16], tableMeta, 16)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[16], tableMeta, 16))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[16], tableMeta, 16)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[16], tableMeta, 16)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[16], tableMeta, 16))}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[16]), 1) : Number(tableMeta.rowData[16]) == 0 ? "0.0" : Number(tableMeta.rowData[16])}
/> />
} }
/> />
...@@ -2024,7 +1834,8 @@ export default class LOCF extends Component { ...@@ -2024,7 +1834,8 @@ export default class LOCF 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={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[17], tableMeta, 17)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[17], tableMeta, 17)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[17], tableMeta, 17))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[17], tableMeta, 17)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[17], tableMeta, 17)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[17], tableMeta, 17))}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[17]), 1) : Number(tableMeta.rowData[17]) == 0 ? "0.0" : Number(tableMeta.rowData[17])}
/> />
} }
/> />
...@@ -2138,7 +1949,8 @@ export default class LOCF extends Component { ...@@ -2138,7 +1949,8 @@ export default class LOCF 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={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[19], tableMeta, 19)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[19], tableMeta, 19)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[19], tableMeta, 19))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[19], tableMeta, 19)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[19], tableMeta, 19)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[19], tableMeta, 19))}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[19]), 1) : Number(tableMeta.rowData[19]) == 0 ? "0.0" : Number(tableMeta.rowData[19])}
/> />
} }
/> />
...@@ -2184,7 +1996,8 @@ export default class LOCF extends Component { ...@@ -2184,7 +1996,8 @@ export default class LOCF 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={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[20], tableMeta, 20)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[20], tableMeta, 20)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[20], tableMeta, 20))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[20], tableMeta, 20)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[20], tableMeta, 20)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[20], tableMeta, 20))}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[20]), 1) : Number(tableMeta.rowData[20]) == 0 ? "0.0" : Number(tableMeta.rowData[20])}
/> />
} }
/> />
...@@ -2262,7 +2075,8 @@ export default class LOCF extends Component { ...@@ -2262,7 +2075,8 @@ export default class LOCF 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={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[21], tableMeta, 21)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[21], tableMeta, 21)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[21], tableMeta, 21))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[21], tableMeta, 21)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[21], tableMeta, 21)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[21], tableMeta, 21))}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[21]), 1) : Number(tableMeta.rowData[21]) == 0 ? "0.0" : Number(tableMeta.rowData[21])}
/> />
} }
/> />
...@@ -2280,7 +2094,8 @@ export default class LOCF extends Component { ...@@ -2280,7 +2094,8 @@ export default class LOCF 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={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[21], tableMeta, 21)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[21], tableMeta, 21)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[21], tableMeta, 21))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[21], tableMeta, 21)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[21], tableMeta, 21)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[21], tableMeta, 21))}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[21]), 1) : Number(tableMeta.rowData[21]) == 0 ? "0.0" : Number(tableMeta.rowData[21])}
/> />
} }
/> />
...@@ -2305,7 +2120,8 @@ export default class LOCF extends Component { ...@@ -2305,7 +2120,8 @@ export default class LOCF 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={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[22], tableMeta, 22)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[22], tableMeta, 22)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[22], tableMeta, 22))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[22], tableMeta, 22)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[22], tableMeta, 22)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[22], tableMeta, 22))}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[22]), 1) : Number(tableMeta.rowData[22]) == 0 ? "0.0" : Number(tableMeta.rowData[22])}
/> />
} }
/> />
...@@ -2323,7 +2139,8 @@ export default class LOCF extends Component { ...@@ -2323,7 +2139,8 @@ export default class LOCF 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={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[22], tableMeta, 22)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[22], tableMeta, 22)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[22], tableMeta, 22))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[22], tableMeta, 22)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[22], tableMeta, 22)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[22], tableMeta, 22))}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[22]), 1) : Number(tableMeta.rowData[22]) == 0 ? "0.0" : Number(tableMeta.rowData[22])}
/> />
} }
/> />
...@@ -2380,7 +2197,8 @@ export default class LOCF extends Component { ...@@ -2380,7 +2197,8 @@ export default class LOCF 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={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[23], tableMeta, 23)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[23], tableMeta, 23)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[23], tableMeta, 23))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[23], tableMeta, 23)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[23], tableMeta, 23)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[23], tableMeta, 23))}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[23]), 1) : Number(tableMeta.rowData[23]) == 0 ? "0.0" : Number(tableMeta.rowData[23])}
/> />
} }
/> />
...@@ -2398,7 +2216,8 @@ export default class LOCF extends Component { ...@@ -2398,7 +2216,8 @@ export default class LOCF 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={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[23], tableMeta, 23)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[23], tableMeta, 23)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[23], tableMeta, 23))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[23], tableMeta, 23)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[23], tableMeta, 23)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[23], tableMeta, 23))}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[23]), 1) : Number(tableMeta.rowData[23]) == 0 ? "0.0" : Number(tableMeta.rowData[23])}
/> />
} }
/> />
...@@ -2423,7 +2242,8 @@ export default class LOCF extends Component { ...@@ -2423,7 +2242,8 @@ export default class LOCF 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={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[24], tableMeta, 24)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[24], tableMeta, 24)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[24], tableMeta, 24))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[24], tableMeta, 24)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[24], tableMeta, 24)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[24], tableMeta, 24))}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[24]), 1) : Number(tableMeta.rowData[24]) == 0 ? "0.0" : Number(tableMeta.rowData[24])}
/> />
} }
/> />
...@@ -2441,7 +2261,8 @@ export default class LOCF extends Component { ...@@ -2441,7 +2261,8 @@ export default class LOCF 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={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[24], tableMeta, 24)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[24], tableMeta, 24)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[24], tableMeta, 24))} // value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[24], tableMeta, 24)), 1) : Number(handleFormulaHardcode(tableMeta.rowData[24], tableMeta, 24)) == 0 ? "0.0" : Number(handleFormulaHardcode(tableMeta.rowData[24], tableMeta, 24))}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[24]), 1) : Number(tableMeta.rowData[24]) == 0 ? "0.0" : Number(tableMeta.rowData[24])}
/> />
} }
/> />
......
...@@ -148,7 +148,7 @@ export default class LOV extends Component { ...@@ -148,7 +148,7 @@ export default class LOV extends Component {
let array = this.props.dataTablelov let array = this.props.dataTablelov
let datas = array[array.length - 1] let datas = array[array.length - 1]
console.log(datas); console.log(datas);
this.setState({ dataTable: this.props.dataTablelov, diff: datas[16], perBS: datas[18] }) this.setState({ dataTable: this.props.dataTablelov, diff: datas[16], loanTotal: datas[17], perBS: datas[18] })
} }
if (this.props.loadingChild !== prevProps.loadingChild) { if (this.props.loadingChild !== prevProps.loadingChild) {
this.setState({ loading: this.props.loadingChild }) this.setState({ loading: this.props.loadingChild })
...@@ -286,7 +286,7 @@ export default class LOV extends Component { ...@@ -286,7 +286,7 @@ export default class LOV extends Component {
console.log(dataTable) console.log(dataTable)
let lastArray = dataTable[res.length - 1] let lastArray = dataTable[res.length - 1]
console.log(lastArray); console.log(lastArray);
this.setState({ dataTable, diff: lastArray[16], perBS: lastArray[18], loading: false, visibleLOVMR: true }, () => { this.setState({ dataTable, diff: lastArray[16], loanTotal: lastArray[17], perBS: lastArray[18], loading: false, visibleLOVMR: true }, () => {
this.props.sendToParent(dataTable, lastArray, 'LOV') this.props.sendToParent(dataTable, lastArray, 'LOV')
}) })
} }
...@@ -369,7 +369,7 @@ export default class LOV extends Component { ...@@ -369,7 +369,7 @@ export default class LOV extends Component {
"lov": payload, "lov": payload,
"per_bs": this.state.perBS, "per_bs": this.state.perBS,
"diff": this.state.diff, "diff": this.state.diff,
"total_loan": this.state.perBS "total_loan": this.state.loanTotal
} }
console.log(body) console.log(body)
this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[0][0] }) this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[0][0] })
...@@ -475,7 +475,7 @@ export default class LOV extends Component { ...@@ -475,7 +475,7 @@ export default class LOV extends Component {
}) })
console.log(dataTable) console.log(dataTable)
let lastArray = dataTable[dataTable.length - 1] let lastArray = dataTable[dataTable.length - 1]
this.setState({ dataTable, diff: lastArray[16], perBS: lastArray[18], dataLoaded: true, loading: false, buttonError: false, dataDelete: [] }, () => { this.setState({ dataTable, diff: lastArray[16], loanTotal: lastArray[17], perBS: lastArray[18], dataLoaded: true, loading: false, buttonError: false, dataDelete: [] }, () => {
this.props.sendToParent(dataTable, lastArray, 'LOV', 'upload', this.state.visibleLOVMR) this.props.sendToParent(dataTable, lastArray, 'LOV', 'upload', this.state.visibleLOVMR)
}) })
} else { } else {
...@@ -1770,7 +1770,7 @@ export default class LOV extends Component { ...@@ -1770,7 +1770,7 @@ export default class LOV extends Component {
<Typography style={{ fontSize: '12px', color: '#4b4b4b' }}>Diff</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b' }}>Diff</Typography>
</div> </div>
<div style={{ borderStyle: 'solid', borderWidth: '0px 1px 1px 1px', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end' }}> <div style={{ borderStyle: 'solid', borderWidth: '0px 1px 1px 1px', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end' }}>
<Typography style={{ fontSize: '14px', color: Number(this.state.diff) > 0 ? 'red' : '#4b4b4b' }}><NumberFormat value={this.state.diff} displayType={'text'} thousandSeparator={true} prefix={''} /></Typography> <Typography style={{ fontSize: '14px', color: Number(this.state.diff) > '0.0' || Number(this.state.diff) < '0.0' ? 'red' : '#4b4b4b' }}><NumberFormat value={this.state.diff} displayType={'text'} thousandSeparator={true} prefix={''} /></Typography>
</div> </div>
</div> </div>
</div> </div>
...@@ -1874,7 +1874,7 @@ export default class LOV extends Component { ...@@ -1874,7 +1874,7 @@ export default class LOV extends Component {
<Typography style={{ fontSize: '12px', color: '#4b4b4b' }}>Diff</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b' }}>Diff</Typography>
</div> </div>
<div style={{ borderStyle: 'solid', borderWidth: '0px 1px 1px 1px', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end' }}> <div style={{ borderStyle: 'solid', borderWidth: '0px 1px 1px 1px', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end' }}>
<Typography style={{ fontSize: '14px', color: Number(this.state.diff) > 0 ? 'red' : '#4b4b4b' }}><NumberFormat value={this.state.diff} displayType={'text'} thousandSeparator={true} prefix={''} /></Typography> <Typography style={{ fontSize: '14px', color: Number(this.state.diff) > '0.0' || Number(this.state.diff) < '0.0' ? 'red' : '#4b4b4b' }}><NumberFormat value={this.state.diff} displayType={'text'} thousandSeparator={true} prefix={''} /></Typography>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -116,8 +116,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -116,8 +116,10 @@ export default class ListOfCreditFacilities extends Component {
totalOutStand: 0, totalOutStand: 0,
diffLOCF: 0, diffLOCF: 0,
perBSLOCF: 0, perBSLOCF: 0,
totalLoanLOCF: 0,
diffLOV: 0, diffLOV: 0,
perBSLOV: 0, perBSLOV: 0,
totalLoanLOV: 0,
snekbar: false, snekbar: false,
snekbarMsg: '', snekbarMsg: '',
visibleParent: true, visibleParent: true,
...@@ -161,10 +163,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -161,10 +163,10 @@ export default class ListOfCreditFacilities extends Component {
switch (params) { switch (params) {
case "LOV": case "LOV":
console.log(data); console.log(data);
this.setState({ dataTableLOV: data, diffLOV: array[16], perBSLOV: array[18], tambahLOV: type, visibleParent: visibleView == undefined ? true : visibleView }) this.setState({ dataTableLOV: data, diffLOV: array[16], totalLoanLOV: array[17], perBSLOV: array[18], tambahLOV: type, visibleParent: visibleView == undefined ? true : visibleView })
break; break;
case "LOCF": case "LOCF":
this.setState({ dataTableLOCF: data, diffLOCF: array[46], perBSLOCF: array[48], tambah: type, visibleParent: visibleView == undefined ? true : visibleView }) this.setState({ dataTableLOCF: data, diffLOCF: array[46], totalLoanLOCF: array[47] , perBSLOCF: array[48], tambah: type, visibleParent: visibleView == undefined ? true : visibleView })
break break
default: default:
break; break;
...@@ -577,9 +579,9 @@ export default class ListOfCreditFacilities extends Component { ...@@ -577,9 +579,9 @@ export default class ListOfCreditFacilities extends Component {
"months": this.props.month.month_id, "months": this.props.month.month_id,
"currency_id": this.props.defaultCurrency.id, "currency_id": this.props.defaultCurrency.id,
"locf": data, "locf": data,
"per_bs": this.state.perBS, "per_bs": this.state.perBSLOCF,
"diff": this.state.diff, "diff": this.state.diffLOCF,
"total_loan": this.state.perBS "total_loan": this.state.totalLoanLOCF
} }
console.log(body); console.log(body);
if (error && type == 'submitted') { if (error && type == 'submitted') {
...@@ -678,9 +680,9 @@ export default class ListOfCreditFacilities extends Component { ...@@ -678,9 +680,9 @@ export default class ListOfCreditFacilities extends Component {
"months": this.props.month.month_id, "months": this.props.month.month_id,
"currency_id": this.props.defaultCurrency.id, "currency_id": this.props.defaultCurrency.id,
"lov": data, "lov": data,
"per_bs": this.state.perBS, "per_bs": this.state.perBSLOV,
"diff": this.state.diff, "diff": this.state.diffLOV,
"total_loan": this.state.perBS "total_loan": this.state.totalLoanLOV
} }
console.log(body); console.log(body);
if (error && type == 'submitted') { if (error && type == 'submitted') {
...@@ -844,7 +846,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -844,7 +846,7 @@ export default class ListOfCreditFacilities extends Component {
"locf": data, "locf": data,
"per_bs": this.state.perBSLOCF, "per_bs": this.state.perBSLOCF,
"diff": this.state.diffLOCF, "diff": this.state.diffLOCF,
"total_loan": this.state.perBSLOCF "total_loan": this.state.totalLoanLOCF
} }
console.log(body); console.log(body);
api.create().validateSaveLOCF(body).then((response) => { api.create().validateSaveLOCF(body).then((response) => {
...@@ -994,7 +996,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -994,7 +996,7 @@ export default class ListOfCreditFacilities extends Component {
this.setState({ saveDraft: false, saveComp: lastArrayLOCF[46] == 0 || lastArrayLOCF[46] == '0.0' || lastArrayLOCF[46] == "-0.0" ? false : true }) this.setState({ saveDraft: false, saveComp: lastArrayLOCF[46] == 0 || lastArrayLOCF[46] == '0.0' || lastArrayLOCF[46] == "-0.0" ? false : true })
} }
} }
this.setState({ dataTablelocf, diffLOCF: lastArrayLOCF[46], perBSLOCF: lastArrayLOCF[48], loading: false }, () => { this.setState({ dataTablelocf, diffLOCF: lastArrayLOCF[46], totalLoanLOCF: lastArrayLOCF[47], perBSLOCF: lastArrayLOCF[48], loading: false }, () => {
this.handleCalculateLOV() this.handleCalculateLOV()
}) })
} }
...@@ -1068,7 +1070,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1068,7 +1070,7 @@ export default class ListOfCreditFacilities extends Component {
"lov": data, "lov": data,
"per_bs": this.state.perBSLOV, "per_bs": this.state.perBSLOV,
"diff": this.state.diffLOV, "diff": this.state.diffLOV,
"total_loan": this.state.perBSLOV "total_loan": this.state.totalLoanLOV
} }
console.log(body); console.log(body);
api.create().validateSaveLOV(body).then((response) => { api.create().validateSaveLOV(body).then((response) => {
...@@ -1157,7 +1159,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1157,7 +1159,7 @@ export default class ListOfCreditFacilities extends Component {
this.setState({ saveDraft: false, saveCompLOV: lastArrayLOV[16] == 0 || lastArrayLOV[16] == '0.0' || lastArrayLOV[16] == "-0.0" ? false : true }) this.setState({ saveDraft: false, saveCompLOV: lastArrayLOV[16] == 0 || lastArrayLOV[16] == '0.0' || lastArrayLOV[16] == "-0.0" ? false : true })
} }
} }
this.setState({ dataTablelov, diffLOV: lastArrayLOV[16], perBSLOV: lastArrayLOV[18], loading: false, loadingChild: false }, () => { this.setState({ dataTablelov, diffLOV: lastArrayLOV[16], totalLoanLOV: lastArrayLOV[17], perBSLOV: lastArrayLOV[18], loading: false, loadingChild: false }, () => {
// this.handleCalculateLOV() // this.handleCalculateLOV()
}) })
} else { } else {
...@@ -1294,9 +1296,9 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1294,9 +1296,9 @@ export default class ListOfCreditFacilities extends Component {
"months": this.props.month.month_id, "months": this.props.month.month_id,
"currency_id": this.props.defaultCurrency.id, "currency_id": this.props.defaultCurrency.id,
"locf": data, "locf": data,
"per_bs": this.state.perBS, "per_bs": this.state.perBSLOCF,
"diff": this.state.diff, "diff": this.state.diffLOCF,
"total_loan": this.state.perBS "total_loan": this.state.totalLoanLOCF
} }
console.log(body); console.log(body);
if (error && type == 'submitted') { if (error && type == 'submitted') {
...@@ -1398,15 +1400,15 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1398,15 +1400,15 @@ export default class ListOfCreditFacilities extends Component {
"months": this.props.month.month_id, "months": this.props.month.month_id,
"currency_id": this.props.defaultCurrency.id, "currency_id": this.props.defaultCurrency.id,
"lov": data, "lov": data,
"per_bs": this.state.perBS, "per_bs": this.state.perBSLOV,
"diff": this.state.diff, "diff": this.state.diffLOV,
"total_loan": this.state.perBS "total_loan": this.state.totalLoanLOV
} }
console.log(body); console.log(body);
if (error && type == 'submitted') { if (error && type == 'submitted') {
this.setState({ handleDoubleClick: 0, saveDraft: false, saveComp: true, loading: false, snekbar: true, snekbarMsg: 'Data Incomplete', handleDoubleClick: 0 }) this.setState({ handleDoubleClick: 0, saveDraft: false, saveComp: true, loading: false, snekbar: true, snekbarMsg: 'Data Incomplete', handleDoubleClick: 0 })
} else { } else {
api.create('UPLOAD').uploadMonthlyReportLOV(body).then(response => { api.create('UPLOAD').createMonthlyReportLOV(body).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
...@@ -1444,9 +1446,6 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1444,9 +1446,6 @@ export default class ListOfCreditFacilities extends Component {
render() { render() {
let dataTable2 = this.state.dataTable let dataTable2 = this.state.dataTable
let loading = this.state.loading let loading = this.state.loading
let totalLoan = 0
const loadingComponent = ( const loadingComponent = (
<div style={{ position: 'fixed', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}> <div style={{ position: 'fixed', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
...@@ -1579,7 +1578,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1579,7 +1578,7 @@ export default class ListOfCreditFacilities extends Component {
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => this.setState({ totalOutStand: totalLoan, saveTambahan: false, loadingChild: true }, () => { onClick={() => this.setState({ saveTambahan: false, loadingChild: true }, () => {
setTimeout(() => { setTimeout(() => {
this.handleCalculateLOCF() this.handleCalculateLOCF()
}, 100); }, 100);
...@@ -1725,7 +1724,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1725,7 +1724,7 @@ export default class ListOfCreditFacilities extends Component {
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => this.setState({ totalOutStand: totalLoan, saveTambahan: false, loadingChild: true }, () => { onClick={() => this.setState({saveTambahan: false, loadingChild: true }, () => {
this.handleCalculateLOCF() this.handleCalculateLOCF()
})} })}
> >
......
...@@ -620,7 +620,7 @@ export default class BalanceSheetOLPA extends Component { ...@@ -620,7 +620,7 @@ export default class BalanceSheetOLPA extends Component {
let err = false let err = false
let dataTable = this.state.dataTable let dataTable = this.state.dataTable
let kansas = this.state.kansas let kansas = this.state.kansas
console.log(this.state.dataTable) // console.log(this.state.dataTable)
dataTable.map((i, index) => { dataTable.map((i, index) => {
if (String(i[5]) == "Control (should be nil)") { if (String(i[5]) == "Control (should be nil)") {
// console.log(this.state.minValue) // console.log(this.state.minValue)
......
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