Commit e5afd33a authored by Riri Novita's avatar Riri Novita

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

Remark 2

See merge request !2204
parents 1f30d5f4 6d7103fa
...@@ -175,6 +175,7 @@ const create = (type = "") => { ...@@ -175,6 +175,7 @@ const create = (type = "") => {
const createAllItemReport = (body) => api.post('item_report/create_all_item_report', body) const createAllItemReport = (body) => api.post('item_report/create_all_item_report', body)
const deleteAllItemReport = (body) => api.post('/item_report/delete_all_item_report', body) const deleteAllItemReport = (body) => api.post('/item_report/delete_all_item_report', body)
const deleteAllItemReportLOCF = (body) => api.post('/item_report/delete_all_item_report_locf', body) const deleteAllItemReportLOCF = (body) => api.post('/item_report/delete_all_item_report_locf', body)
const getAllSettingBusinessBank = (body) => api.post('setting/get_all_setting_by_group_name', body)
//PARAMETER //PARAMETER
const getAllParameter = () => api.get('/setting/get_all_setting') const getAllParameter = () => api.get('/setting/get_all_setting')
...@@ -693,6 +694,7 @@ const create = (type = "") => { ...@@ -693,6 +694,7 @@ const create = (type = "") => {
createOpetaingInd, createOpetaingInd,
uploadMasterBudget, uploadMasterBudget,
getAllSettingByType, getAllSettingByType,
getAllSettingBusinessBank,
getOpetratingIndID, getOpetratingIndID,
createAllItemReport, createAllItemReport,
deleteAllItemReport, deleteAllItemReport,
......
...@@ -2522,7 +2522,7 @@ export default class BudgetTahunan extends Component { ...@@ -2522,7 +2522,7 @@ export default class BudgetTahunan extends Component {
"month": "", "month": "",
"quartal": "", "quartal": "",
"type_report_name": "Master Budget", "type_report_name": "Master Budget",
"currency_id" : defaultCurrency.id "currency_id": defaultCurrency.id
} }
// console.log(payload); // console.log(payload);
api.create().createDownloadFile(payload).then((response) => { api.create().createDownloadFile(payload).then((response) => {
...@@ -2570,34 +2570,43 @@ export default class BudgetTahunan extends Component { ...@@ -2570,34 +2570,43 @@ export default class BudgetTahunan extends Component {
let datas = data.findIndex((val) => val[4] == items) let datas = data.findIndex((val) => val[4] == items)
let report = data[datas] let report = data[datas]
if (items === 6) { if (items === 6) {
let resReal = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/master_budget/export_master_budget?submission_id=${submissionID}&company_id=${company.company_id}&year=${periode.periode}&revision=${report[2]}&report_id=${report[4]}&download_file_report_id=${downloadedFileReportId}&currency_id=${defaultCurrency.id}` try {
let resNull = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/master_budget/export_master_budget?submission_id=&&company_id=${company.company_id}&year=${periode.periode}&revision=${report[2]}&report_id=${report[4]}&download_file_report_id=${downloadedFileReportId}&currency_id=${defaultCurrency.id}` let resReal = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/master_budget/export_master_budget?submission_id=${submissionID}&company_id=${company.company_id}&year=${periode.periode}&revision=${report[2]}&report_id=${report[4]}&download_file_report_id=${downloadedFileReportId}&currency_id=${defaultCurrency.id}`
let resNull = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/master_budget/export_master_budget?submission_id=&&company_id=${company.company_id}&year=${periode.periode}&revision=${report[2]}&report_id=${report[4]}&download_file_report_id=${downloadedFileReportId}&currency_id=${defaultCurrency.id}`
let res = await fetch( let res = await fetch(
submissionID == null ? resNull : resReal submissionID == null ? resNull : resReal
) )
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
a.href = url; a.href = url;
} }
if (res.status === 200) { if (res.status === 200) {
result = [...result, res]; result = [...result, res];
}
} catch (error) {
alert(error)
} }
} else { } else {
let resReal = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/master_budget/export_master_budget?submission_id=${submissionID}&report_id=${report[4]}&company_id=${company.company_id}&year=${periode.periode}&revision=${report[2]}&download_file_report_id=${downloadedFileReportId}&currency_id=${defaultCurrency.id}` try {
let resNull = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/master_budget/export_master_budget?submission_id=&report_id=${report[4]}&company_id=${company.company_id}&year=${periode.periode}&revision=${report[2]}&download_file_report_id=${downloadedFileReportId}&currency_id=${defaultCurrency.id}` let resReal = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/master_budget/export_master_budget?submission_id=${submissionID}&report_id=${report[4]}&company_id=${company.company_id}&year=${periode.periode}&revision=${report[2]}&download_file_report_id=${downloadedFileReportId}&currency_id=${defaultCurrency.id}`
let resNull = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/master_budget/export_master_budget?submission_id=&report_id=${report[4]}&company_id=${company.company_id}&year=${periode.periode}&revision=${report[2]}&download_file_report_id=${downloadedFileReportId}&currency_id=${defaultCurrency.id}`
let res = await fetch( let res = await fetch(
submissionID == null ? resNull : resReal submissionID == null ? resNull : resReal
) )
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
a.href = url; a.href = url;
} }
if (res.status === 200) { if (res.status === 200) {
result = [...result, res]; result = [...result, res];
}
} catch (error) {
alert(error)
} }
} }
} }
......
...@@ -103,6 +103,7 @@ export default class LOCF extends Component { ...@@ -103,6 +103,7 @@ export default class LOCF extends Component {
dataTable: [], dataTable: [],
bankNameList: [], bankNameList: [],
typeOfCreditList: [], typeOfCreditList: [],
businessBankList: [],
loading: false, loading: false,
dataTableRatio: [], dataTableRatio: [],
currentDate: format(new Date(), 'yyyy-MM-dd'), currentDate: format(new Date(), 'yyyy-MM-dd'),
...@@ -130,6 +131,7 @@ export default class LOCF extends Component { ...@@ -130,6 +131,7 @@ export default class LOCF extends Component {
// this.getPerBS() // this.getPerBS()
this.getBankData() this.getBankData()
this.getTypeOfCredit() this.getTypeOfCredit()
this.getTypeBusinessBank()
this.getSubmission() this.getSubmission()
this.getLatestUpdate() this.getLatestUpdate()
this.handleViewOnly() this.handleViewOnly()
...@@ -139,6 +141,7 @@ export default class LOCF extends Component { ...@@ -139,6 +141,7 @@ export default class LOCF extends Component {
// this.getPerBS() // this.getPerBS()
this.getBankData() this.getBankData()
this.getTypeOfCredit() this.getTypeOfCredit()
this.getTypeBusinessBank()
this.getSubmission() this.getSubmission()
this.getLatestUpdate() this.getLatestUpdate()
this.handleViewOnly() this.handleViewOnly()
...@@ -158,6 +161,7 @@ export default class LOCF extends Component { ...@@ -158,6 +161,7 @@ export default class LOCF extends Component {
this.getPerBS() this.getPerBS()
this.getBankData() this.getBankData()
this.getTypeOfCredit() this.getTypeOfCredit()
this.getTypeBusinessBank()
this.getSubmission() this.getSubmission()
this.getLatestUpdate() this.getLatestUpdate()
}) })
...@@ -229,6 +233,7 @@ export default class LOCF extends Component { ...@@ -229,6 +233,7 @@ export default class LOCF extends Component {
item.locf.bank_name === null ? null : item.locf.bank_name === "" ? null : { value: item.locf.bank_name }, item.locf.bank_name === null ? null : item.locf.bank_name === "" ? null : { value: item.locf.bank_name },
item.locf.type_of_credit === null ? null : item.locf.type_of_credit === "" ? null : { value: item.locf.type_of_credit }, item.locf.type_of_credit === null ? null : item.locf.type_of_credit === "" ? null : { value: item.locf.type_of_credit },
item.locf.remarks === null || item.locf.remarks === "" ? "" : item.locf.remarks, item.locf.remarks === null || item.locf.remarks === "" ? "" : item.locf.remarks,
item.locf.remarks2 === null ? null : item.locf.remarks2 === "" ? null : { value: item.locf.remarks2 },
item.locf.loan_maturity_date == null || item.locf.loan_maturity_date == "" ? null : (item.locf.loan_maturity_date !== "null" ? String(tgl[2]).length > 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(item.locf.loan_maturity_date) : null), item.locf.loan_maturity_date == null || item.locf.loan_maturity_date == "" ? null : (item.locf.loan_maturity_date !== "null" ? String(tgl[2]).length > 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(item.locf.loan_maturity_date) : null),
item.locf.interest === null || item.locf.interest === "" ? "0.00" : item.locf.interest, item.locf.interest === null || item.locf.interest === "" ? "0.00" : item.locf.interest,
item.locf.currency === null || item.locf.currency === "" ? "" : item.locf.currency, item.locf.currency === null || item.locf.currency === "" ? "" : item.locf.currency,
...@@ -293,6 +298,7 @@ export default class LOCF extends Component { ...@@ -293,6 +298,7 @@ export default class LOCF extends Component {
item.locf.bank_name === null ? null : item.locf.bank_name === "" ? null : { value: item.locf.bank_name }, item.locf.bank_name === null ? null : item.locf.bank_name === "" ? null : { value: item.locf.bank_name },
item.locf.type_of_credit === null ? null : item.locf.type_of_credit === "" ? null : { value: item.locf.type_of_credit }, item.locf.type_of_credit === null ? null : item.locf.type_of_credit === "" ? null : { value: item.locf.type_of_credit },
item.locf.remarks === null || item.locf.remarks === "" ? "" : item.locf.remarks, item.locf.remarks === null || item.locf.remarks === "" ? "" : item.locf.remarks,
item.locf.remarks2 === null ? null : item.locf.remarks2 === "" ? null : { value: item.locf.remarks2 },
item.locf.loan_maturity_date == null || item.locf.loan_maturity_date == "" ? null : (item.locf.loan_maturity_date !== "null" ? String(tgl[2]).length > 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(item.locf.loan_maturity_date) : null), item.locf.loan_maturity_date == null || item.locf.loan_maturity_date == "" ? null : (item.locf.loan_maturity_date !== "null" ? String(tgl[2]).length > 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(item.locf.loan_maturity_date) : null),
item.locf.interest === null || item.locf.interest === "" ? "0.00" : item.locf.interest, item.locf.interest === null || item.locf.interest === "" ? "0.00" : item.locf.interest,
item.locf.currency === null || item.locf.currency === "" ? "" : item.locf.currency, item.locf.currency === null || item.locf.currency === "" ? "" : item.locf.currency,
...@@ -345,7 +351,7 @@ export default class LOCF extends Component { ...@@ -345,7 +351,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], loanTotal: lastArray[47], perBS: lastArray[48], loading: false, visibleLOCFMR: true }, () => { this.setState({ dataTable, diff: lastArray[47], loanTotal: lastArray[48], perBS: lastArray[49], loading: false, visibleLOCFMR: true }, () => {
this.props.sendToParent(dataTable, lastArray, 'LOCF') this.props.sendToParent(dataTable, lastArray, 'LOCF')
}) })
} }
...@@ -406,39 +412,40 @@ export default class LOCF extends Component { ...@@ -406,39 +412,40 @@ export default class LOCF extends Component {
"bank_name": i[2], "bank_name": i[2],
"type_of_credit": i[3], "type_of_credit": i[3],
"remarks": i[4], "remarks": i[4],
"loan_maturity_date": i[5] !== undefined ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : null, "remarks2": i[5],
"interest": i[6], "loan_maturity_date": i[6] !== undefined ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : null,
"currency": i[7], "interest": i[7],
"loan_plafond_amount_ori": i[8] !== undefined ? Number(i[8]) : i[8], "currency": i[8],
"loan_plafond_amount_idr": i[9] !== undefined ? Number(i[9]) : i[9], "loan_plafond_amount_ori": i[9] !== undefined ? Number(i[9]) : i[8],
"out_loan_ki_amount_ori": i[10] !== undefined ? Number(i[10]) : i[10], "loan_plafond_amount_idr": i[10] !== undefined ? Number(i[10]) : i[10],
"out_loan_ki_amount_idr": i[11] !== undefined ? Number(i[11]) : i[11], "out_loan_ki_amount_ori": i[11] !== undefined ? Number(i[11]) : i[11],
"out_loan_kmk_amount_ori": i[12] !== undefined ? Number(i[12]) : i[12], "out_loan_ki_amount_idr": i[12] !== undefined ? Number(i[12]) : i[12],
"out_loan_kmk_amount_idr": i[13] !== undefined ? Number(i[13]) : i[13], "out_loan_kmk_amount_ori": i[13] !== undefined ? Number(i[13]) : i[13],
"out_loan_other_type": i[14], "out_loan_kmk_amount_idr": i[14] !== undefined ? Number(i[14]) : i[14],
"out_loan_other_amount_ori": i[15] !== undefined ? Number(i[15]) : i[15], "out_loan_other_type": i[15],
"out_loan_other_amount_idr": i[16] !== undefined ? Number(i[16]) : i[16], "out_loan_other_amount_ori": i[16] !== undefined ? Number(i[16]) : i[16],
"out_loan_other_amount_idr": i[17] !== undefined ? Number(i[17]) : i[17],
// "total_out_loan_ori": i[18], // "total_out_loan_ori": i[18],
// "total_out_loan_idr": i[19], // "total_out_loan_idr": i[19],
// "remaining_plafond_ori": i[20], // "remaining_plafond_ori": i[20],
// "remaining_plafond_idr": i[21], // "remaining_plafond_idr": i[21],
"current_ratio_financial": i[17], "current_ratio_financial": i[18],
"der_financial": i[18], "der_financial": i[19],
"debt_to_ebitda_financial": i[19], "debt_to_ebitda_financial": i[20],
"ebitda_to_interest_financial": i[20], "ebitda_to_interest_financial": i[21],
"other_ratio1_ratio_name": i[21], "other_ratio1_ratio_name": i[22],
"other_ratio1_financial": i[22], "other_ratio1_financial": i[23],
"other_ratio1_current": i[23], "other_ratio1_current": i[24],
"other_ratio2_ratio_name": i[24], "other_ratio2_ratio_name": i[25],
"other_ratio2_financial": i[25], "other_ratio2_financial": i[26],
"other_ratio2_current": i[26], "other_ratio2_current": i[27],
"other_ratio3_ratio_name": i[27], "other_ratio3_ratio_name": i[28],
"other_ratio3_financial": i[28], "other_ratio3_financial": i[29],
"other_ratio3_current": i[29], "other_ratio3_current": i[30],
"other_ratio4_ratio_name": i[30], "other_ratio4_ratio_name": i[31],
"other_ratio4_financial": i[31], "other_ratio4_financial": i[32],
"other_ratio4_current": i[32], "other_ratio4_current": i[33],
"notes": i[33], "notes": i[34],
}) })
} }
}) })
...@@ -510,6 +517,7 @@ export default class LOCF extends Component { ...@@ -510,6 +517,7 @@ export default class LOCF extends Component {
item.bank_name === null ? null : item.bank_name === "" ? null : { value: item.bank_name }, item.bank_name === null ? null : item.bank_name === "" ? null : { value: item.bank_name },
item.type_of_credit === null ? null : item.type_of_credit === "" ? null : { value: item.type_of_credit }, item.type_of_credit === null ? null : item.type_of_credit === "" ? null : { value: item.type_of_credit },
item.remarks === null ? "" : item.remarks === "" ? "" : item.remarks, item.remarks === null ? "" : item.remarks === "" ? "" : item.remarks,
item.remarks2 === null ? null : item.remarks2 === "" ? null : { value: item.remarks2 },
item.loan_maturity_date === null || item.loan_maturity_date === "" ? null : item.loan_maturity_date, item.loan_maturity_date === null || item.loan_maturity_date === "" ? null : item.loan_maturity_date,
item.interest === null || item.interest === "" ? "0.00" : item.interest, item.interest === null || item.interest === "" ? "0.00" : item.interest,
item.currency === null || item.currency === "" ? "" : item.currency, item.currency === null || item.currency === "" ? "" : item.currency,
...@@ -556,7 +564,7 @@ export default class LOCF extends Component { ...@@ -556,7 +564,7 @@ export default class LOCF extends Component {
let lastArray = dataTable[dataTable.length - 1] let lastArray = dataTable[dataTable.length - 1]
console.log(lastArray); console.log(lastArray);
this.setState({ dataTable, diff: lastArray[46], loanTotal: lastArray[47], perBS: lastArray[48], dataLoaded: true, loading: false, buttonError: false, dataDelete: [] }, () => { this.setState({ dataTable, diff: lastArray[47], loanTotal: lastArray[48], perBS: lastArray[49], 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)
}) })
...@@ -621,6 +629,50 @@ export default class LOCF extends Component { ...@@ -621,6 +629,50 @@ export default class LOCF extends Component {
}) })
} }
getTypeBusinessBank() {
let body = {
group_name: 'BUSINESS_BANKING'
}
api.create().getAllSettingBusinessBank(body).then(response => {
console.log(response)
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
let data = response.data.data
// // // console.log(data)
let inputBusinessBank = []
data.map((item) => {
inputBusinessBank.push({
value: item.value
})
})
let defaultProps = {
options: inputBusinessBank,
getOptionLabel: (option) => titleCase(option.value),
};
// // // console.log(defaultProps)
this.setState({ businessBankList: defaultProps })
console.log(this.state.businessBankList);
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
})
}
getTypeOfCredit() { getTypeOfCredit() {
let body = { let body = {
group: 'BANK', group: 'BANK',
...@@ -873,7 +925,7 @@ export default class LOCF extends Component { ...@@ -873,7 +925,7 @@ export default class LOCF extends Component {
this.setState({ loading: false }) this.setState({ loading: false })
}) })
} else { } else {
if (column != 8 && column != 11 && column != 18 && column != 25 && column != 27 && column != 29 && column != 31 && column != 33 && column != 36 && column != 39 && column != 42 && column != 45) { if (column != 8 && column != 12 && column != 19 && column != 26 && column != 28 && column != 30 && column != 32 && column != 34 && column != 37 && column != 40 && column != 43 && column != 46) {
val = String(value).split(",").join("") val = String(value).split(",").join("")
val = this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 2) : Number(val) val = this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 2) : Number(val)
} else { } else {
...@@ -885,24 +937,24 @@ export default class LOCF extends Component { ...@@ -885,24 +937,24 @@ export default class LOCF extends Component {
this.setState({ loading: true }) this.setState({ loading: true })
if (value.value == 'Investment Loan') { if (value.value == 'Investment Loan') {
this.setState({ loading: false }) this.setState({ loading: false })
dataTable2[tableMeta.rowIndex][16] = 0
dataTable2[tableMeta.rowIndex][17] = 0 dataTable2[tableMeta.rowIndex][17] = 0
dataTable2[tableMeta.rowIndex][18] = "" dataTable2[tableMeta.rowIndex][18] = 0
dataTable2[tableMeta.rowIndex][19] = 0 dataTable2[tableMeta.rowIndex][19] = ""
dataTable2[tableMeta.rowIndex][20] = 0 dataTable2[tableMeta.rowIndex][20] = 0
dataTable2[tableMeta.rowIndex][21] = 0
} else if (value.value == 'Revolving Loan (KMK)') { } else if (value.value == 'Revolving Loan (KMK)') {
this.setState({ loading: false }) this.setState({ loading: false })
dataTable2[tableMeta.rowIndex][14] = 0
dataTable2[tableMeta.rowIndex][15] = 0 dataTable2[tableMeta.rowIndex][15] = 0
dataTable2[tableMeta.rowIndex][18] = "" dataTable2[tableMeta.rowIndex][16] = 0
dataTable2[tableMeta.rowIndex][17] = ""
dataTable2[tableMeta.rowIndex][18] = 0
dataTable2[tableMeta.rowIndex][19] = 0 dataTable2[tableMeta.rowIndex][19] = 0
dataTable2[tableMeta.rowIndex][20] = 0
} else if (value.value == 'others') { } else if (value.value == 'others') {
this.setState({ loading: false }) this.setState({ loading: false })
dataTable2[tableMeta.rowIndex][14] = 0
dataTable2[tableMeta.rowIndex][15] = 0 dataTable2[tableMeta.rowIndex][15] = 0
dataTable2[tableMeta.rowIndex][16] = 0 dataTable2[tableMeta.rowIndex][16] = 0
dataTable2[tableMeta.rowIndex][17] = 0 dataTable2[tableMeta.rowIndex][17] = 0
dataTable2[tableMeta.rowIndex][18] = 0
} }
this.setState({ loading: false }) this.setState({ loading: false })
dataTable2[tableMeta.rowIndex][column] = value dataTable2[tableMeta.rowIndex][column] = value
...@@ -910,13 +962,13 @@ export default class LOCF extends Component { ...@@ -910,13 +962,13 @@ export default class LOCF extends Component {
dataTable2[tableMeta.rowIndex][column] = val dataTable2[tableMeta.rowIndex][column] = val
} }
} }
console.log(dataTable2[tableMeta.rowIndex][column]); console.log(dataTable2);
console.log(value) console.log(value)
console.log(String(value).split(",").join("")) console.log(String(value).split(",").join(""))
} }
const handleValueDropDown = (value, type, tableMeta) => { const handleValueDropDown = (value, type, tableMeta) => {
let data = type == 'bankName' ? this.state.bankNameList.options : this.state.typeOfCreditList.options let data = type == 'bankName' ? this.state.bankNameList.options : type == 'typeOfCreditList' ? this.state.typeOfCreditList.options : this.state.businessBankList.options
let index = 0 let index = 0
if (type == 'bankName' && dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] != null && dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] != "") { if (type == 'bankName' && dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] != null && dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] != "") {
indexNyasar = true indexNyasar = true
...@@ -967,18 +1019,18 @@ export default class LOCF extends Component { ...@@ -967,18 +1019,18 @@ export default class LOCF extends Component {
valuez += Number(item[column]) valuez += Number(item[column])
} }
}) })
if (column == 22) { if (column == 23) {
totalLoan = valuez totalLoan = valuez
} }
} else { } else {
if (column == 21) { if (column == 22) {
valuez = Number(tableMeta.rowData[14]) + Number(tableMeta.rowData[16]) + Number(tableMeta.rowData[19]) valuez = Number(tableMeta.rowData[14]) + Number(tableMeta.rowData[17]) + Number(tableMeta.rowData[18])
} else if (column == 22) {
valuez = Number(tableMeta.rowData[15]) + Number(tableMeta.rowData[17]) + Number(tableMeta.rowData[20])
} else if (column == 23) { } else if (column == 23) {
valuez = Number(tableMeta.rowData[12]) - Number(tableMeta.rowData[21]) valuez = Number(tableMeta.rowData[16]) + Number(tableMeta.rowData[18]) + Number(tableMeta.rowData[21])
} else if (column == 24) { } else if (column == 24) {
valuez = Number(tableMeta.rowData[13]) - Number(tableMeta.rowData[22]) valuez = Number(tableMeta.rowData[13]) - Number(tableMeta.rowData[22])
} else if (column == 25) {
valuez = Number(tableMeta.rowData[14]) - Number(tableMeta.rowData[23])
} }
} }
...@@ -993,9 +1045,9 @@ export default class LOCF extends Component { ...@@ -993,9 +1045,9 @@ export default class LOCF extends Component {
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
indexxx = index indexxx = index
if (item[6] == "Grand Total") { if (item[6] == "Grand Total") {
item[46] = 999999 item[47] = 999999
} else { } else {
item[46] = indexxx item[47] = indexxx
} }
newData.push(item) newData.push(item)
if (index == rowIndex) { if (index == rowIndex) {
...@@ -1011,6 +1063,7 @@ export default class LOCF extends Component { ...@@ -1011,6 +1063,7 @@ export default class LOCF extends Component {
null, null,
"", "",
null, null,
null,
"0.00", "0.00",
"", "",
"", "",
...@@ -1052,7 +1105,7 @@ export default class LOCF extends Component { ...@@ -1052,7 +1105,7 @@ export default class LOCF extends Component {
} }
}) })
dataTable2 = newData.sort((a, b) => a[46] - b[46]) dataTable2 = newData.sort((a, b) => a[47] - b[47])
let lastArray = dataTable2[dataTable2.length - 1] let lastArray = dataTable2[dataTable2.length - 1]
this.setState({ dataTable: dataTable2 }, () => { this.setState({ dataTable: dataTable2 }, () => {
setTimeout(() => { setTimeout(() => {
...@@ -1101,8 +1154,8 @@ export default class LOCF extends Component { ...@@ -1101,8 +1154,8 @@ export default class LOCF extends Component {
} else { } else {
dataTable2.splice(index, 3) dataTable2.splice(index, 3)
dataTable2.push( dataTable2.push(
[3, "", "", "", "", this.props.company.company_name, null, null, "", null, "0.00", "", "", "0", "", "0", "", "0", "", "", "0", "0", "0", "0", "0", "", "0", "", "0", "", "0", "", "0", "", "", "", "", "", "", "", "", "", "", "", "", "", 0], [3, "", "", "", "", this.props.company.company_name, null, null, "", null, null, "0.00", "", "", "0", "", "0", "", "0", "", "", "0", "0", "0", "0", "0", "", "0", "", "0", "", "0", "", "0", "", "", "", "", "", "", "", "", "", "", "", "", "", 0],
[9, "", "", "", "", "", { value: "Grand Total" }, null, "", "", "", "0", "", "0", "", "0", "", "0", "", "", "0", "0", "0", "0", "0", "", "0", "", "0", "", "0", "", "0", "", "", "", "", "", "", "", "", "", "", "", "", "notes", 999999], [9, "", "", "", "", "", { value: "Grand Total" }, null, "", null, "", "", "0", "", "0", "", "0", "", "0", "", "", "0", "0", "0", "0", "0", "", "0", "", "0", "", "0", "", "0", "", "", "", "", "", "", "", "", "", "", "", "", "notes", 999999],
) )
} }
} else { } else {
...@@ -1349,6 +1402,41 @@ export default class LOCF extends Component { ...@@ -1349,6 +1402,41 @@ export default class LOCF extends Component {
) )
} }
} }
}, {
name: "Business Banking",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96, borderRight: '1px #fff solid' }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style2 }),
customBodyRender: (val, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9 || tableMeta.rowData[0] === 4 ?
null :
<Autocomplete
{...this.state.businessBankList}
id="businessBanking"
onChange={(event, newInputValue) => handleChange(newInputValue, tableMeta, tableMeta.columnIndex)}
debug
value={handleValueDropDown(val, 'businessBanking', tableMeta)}
disableClearable
disabled={this.props.get_for == 'view'}
// disabled={!handleAction(tableMeta.rowData[2], tableMeta.rowData[0])}
style={{ padding: 0, margin: 0 }}
renderInput={(params) =>
<div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}>
<textarea style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: tableMeta.rowData[9] == null && this.props.get_for == 'edit' ? '#ffac99' : 'white' }} type="text" {...params.inputProps} />
</div>
}
/>
}
</div>
)
}
}
}, { }, {
name: "Loan Maturity Date", name: "Loan Maturity Date",
options: { options: {
...@@ -1383,7 +1471,7 @@ export default class LOCF extends Component { ...@@ -1383,7 +1471,7 @@ export default class LOCF extends Component {
height: 22, height: 22,
fontFamily: 'Nunito Sans, sans-serif', fontFamily: 'Nunito Sans, sans-serif',
color: this.props.get_for == 'view' ? "black" : '#5198ea', color: this.props.get_for == 'view' ? "black" : '#5198ea',
backgroundColor: (tableMeta.rowData[9] == null || tableMeta.rowData[9] == '') && this.props.get_for == 'edit' ? '#ffac99' : 'white' backgroundColor: (tableMeta.rowData[10] == null || tableMeta.rowData[10] == '') && this.props.get_for == 'edit' ? '#ffac99' : 'white'
} }
}} }}
InputLabelProps={{ InputLabelProps={{
...@@ -1421,7 +1509,7 @@ export default class LOCF extends Component { ...@@ -1421,7 +1509,7 @@ export default class LOCF extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: this.props.get_for == 'view' ? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, height: 34, backgroundColor: (tableMeta.rowData[10] == '0.00' || tableMeta.rowData[10] == '') && this.props.get_for == 'edit' ? '#ffac99' : 'transparent' }} style={{ color: this.props.get_for == 'view' ? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, height: 34, backgroundColor: (tableMeta.rowData[11] == '0.00' || tableMeta.rowData[11] == '') && this.props.get_for == 'edit' ? '#ffac99' : 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={this.props.get_for == 'view' ? fixNumber(Number(value), 2) : this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 2) : Number(value) == 0 ? "0.0" : Number(value)} value={this.props.get_for == 'view' ? fixNumber(Number(value), 2) : this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 2) : Number(value) == 0 ? "0.0" : Number(value)}
...@@ -1456,7 +1544,7 @@ export default class LOCF extends Component { ...@@ -1456,7 +1544,7 @@ export default class LOCF extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] == 8 || tableMeta.rowData[0] == 9 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] == 8 || tableMeta.rowData[0] == 9 ?
null : null :
<div style={{ padding: 0, margin: 0 }}> <div style={{ padding: 0, margin: 0 }}>
<textarea disabled={this.props.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: tableMeta.rowData[11] == '' && this.props.get_for == 'edit' ? '#ffac99' : 'white' }} type="text" defaultValue={tableMeta.rowData[11]} <textarea disabled={this.props.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: tableMeta.rowData[12] == '' && this.props.get_for == 'edit' ? '#ffac99' : 'white' }} type="text" defaultValue={tableMeta.rowData[12]}
onBlur={(event) => handleChange(event.target.value, tableMeta, tableMeta.columnIndex)} /> onBlur={(event) => handleChange(event.target.value, tableMeta, tableMeta.columnIndex)} />
</div> </div>
// <ThemeProvider theme={this.props.get_for == 'view'? theme3 : theme2}> // <ThemeProvider theme={this.props.get_for == 'view'? theme3 : theme2}>
...@@ -1528,7 +1616,7 @@ export default class LOCF extends Component { ...@@ -1528,7 +1616,7 @@ export default class LOCF extends Component {
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]))} value={this.props.defaultCurrency.id == 1 ? (fixNumber(Number(tableMeta.rowData[13]), 1) == 0.0 ? "0.0" : fixNumber(Number(tableMeta.rowData[13]), 1)) : (Number(tableMeta.rowData[13]) == 0.0 ? "0.0" : Number(tableMeta.rowData[13]))}
/> />
} }
/> />
...@@ -1546,9 +1634,9 @@ export default class LOCF extends Component { ...@@ -1546,9 +1634,9 @@ export default class LOCF extends Component {
placeholder="" placeholder=""
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
disabled={this.props.get_for == 'view'} disabled={this.props.get_for == 'view'}
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]))} value={this.props.defaultCurrency.id == 1 ? (fixNumber(Number(tableMeta.rowData[13]), 1) == 0.0 ? "0.0" : fixNumber(Number(tableMeta.rowData[13]), 1)) : (Number(tableMeta.rowData[13]) == 0.0 ? "0.0" : Number(tableMeta.rowData[13]))}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 12) handleChange(event.target.value, tableMeta, 13)
}} }}
/> />
...@@ -1576,7 +1664,7 @@ export default class LOCF extends Component { ...@@ -1576,7 +1664,7 @@ export default class LOCF extends Component {
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])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[14]), 1) : Number(tableMeta.rowData[14]) == 0 ? "0.0" : Number(tableMeta.rowData[14])}
/> />
} }
/> />
...@@ -1594,9 +1682,9 @@ export default class LOCF extends Component { ...@@ -1594,9 +1682,9 @@ export default class LOCF extends Component {
placeholder="" placeholder=""
disabled={this.props.get_for == 'view'} disabled={this.props.get_for == 'view'}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[13]), 1) : Number(tableMeta.rowData[13]) == 0 ? "0.0" : Number(tableMeta.rowData[13])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[14]), 1) : Number(tableMeta.rowData[14]) == 0 ? "0.0" : Number(tableMeta.rowData[14])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 13) handleChange(event.target.value, tableMeta, 14)
}} }}
/> />
...@@ -1659,7 +1747,7 @@ export default class LOCF extends Component { ...@@ -1659,7 +1747,7 @@ export default class LOCF extends Component {
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])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[15]), 1) : Number(tableMeta.rowData[15]) == 0 ? "0.0" : Number(tableMeta.rowData[15])}
/> />
} }
/> />
...@@ -1677,9 +1765,9 @@ export default class LOCF extends Component { ...@@ -1677,9 +1765,9 @@ export default class LOCF extends Component {
placeholder="" placeholder=""
disabled={this.props.get_for == 'view' ? true : tableMeta.rowData[7] == null ? true : tableMeta.rowData[7].value == 'Investment Loan' ? false : true} disabled={this.props.get_for == 'view' ? true : tableMeta.rowData[7] == null ? true : tableMeta.rowData[7].value == 'Investment Loan' ? false : 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(tableMeta.rowData[14]), 1) : Number(tableMeta.rowData[14]) == 0 ? "0.0" : Number(tableMeta.rowData[14])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[15]), 1) : Number(tableMeta.rowData[15]) == 0 ? "0.0" : Number(tableMeta.rowData[15])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 14) handleChange(event.target.value, tableMeta, 15)
}} }}
/> />
} }
...@@ -1706,7 +1794,7 @@ export default class LOCF extends Component { ...@@ -1706,7 +1794,7 @@ export default class LOCF extends Component {
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])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[16]), 1) : Number(tableMeta.rowData[16]) == 0 ? "0.0" : Number(tableMeta.rowData[16])}
/> />
} }
/> />
...@@ -1724,9 +1812,9 @@ export default class LOCF extends Component { ...@@ -1724,9 +1812,9 @@ export default class LOCF extends Component {
placeholder="" placeholder=""
disabled={this.props.get_for == 'view' ? true : tableMeta.rowData[7] == null ? true : tableMeta.rowData[7].value == 'Investment Loan' ? false : true} disabled={this.props.get_for == 'view' ? true : tableMeta.rowData[7] == null ? true : tableMeta.rowData[7].value == 'Investment Loan' ? false : 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(tableMeta.rowData[15]), 1) : Number(tableMeta.rowData[15]) == 0 ? "0.0" : Number(tableMeta.rowData[15])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[16]), 1) : Number(tableMeta.rowData[16]) == 0 ? "0.0" : Number(tableMeta.rowData[16])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 15) handleChange(event.target.value, tableMeta, 16)
}} }}
/> />
} }
...@@ -1788,7 +1876,7 @@ export default class LOCF extends Component { ...@@ -1788,7 +1876,7 @@ export default class LOCF extends Component {
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])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[17]), 1) : Number(tableMeta.rowData[17]) == 0 ? "0.0" : Number(tableMeta.rowData[17])}
/> />
} }
/> />
...@@ -1806,9 +1894,9 @@ export default class LOCF extends Component { ...@@ -1806,9 +1894,9 @@ export default class LOCF extends Component {
placeholder="" placeholder=""
disabled={this.props.get_for == 'view' ? true : tableMeta.rowData[7] == null ? true : tableMeta.rowData[7].value == 'Revolving Loan (KMK)' ? false : true} disabled={this.props.get_for == 'view' ? true : tableMeta.rowData[7] == null ? true : tableMeta.rowData[7].value == 'Revolving Loan (KMK)' ? false : 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(tableMeta.rowData[16]), 1) : Number(tableMeta.rowData[16]) == 0 ? "0.0" : Number(tableMeta.rowData[16])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[17]), 1) : Number(tableMeta.rowData[17]) == 0 ? "0.0" : Number(tableMeta.rowData[17])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 16) handleChange(event.target.value, tableMeta, 17)
}} }}
/> />
} }
...@@ -1835,7 +1923,7 @@ export default class LOCF extends Component { ...@@ -1835,7 +1923,7 @@ export default class LOCF extends Component {
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])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[18]), 1) : Number(tableMeta.rowData[18]) == 0 ? "0.0" : Number(tableMeta.rowData[18])}
/> />
} }
/> />
...@@ -1853,9 +1941,9 @@ export default class LOCF extends Component { ...@@ -1853,9 +1941,9 @@ export default class LOCF extends Component {
placeholder="" placeholder=""
disabled={this.props.get_for == 'view' ? true : tableMeta.rowData[7] == null ? true : tableMeta.rowData[7].value == 'Revolving Loan (KMK)' ? false : true} disabled={this.props.get_for == 'view' ? true : tableMeta.rowData[7] == null ? true : tableMeta.rowData[7].value == 'Revolving Loan (KMK)' ? false : 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(tableMeta.rowData[17]), 1) : Number(tableMeta.rowData[17]) == 0 ? "0.0" : Number(tableMeta.rowData[17])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[18]), 1) : Number(tableMeta.rowData[18]) == 0 ? "0.0" : Number(tableMeta.rowData[18])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 17) handleChange(event.target.value, tableMeta, 18)
}} }}
/> />
} }
...@@ -1926,8 +2014,8 @@ export default class LOCF extends Component { ...@@ -1926,8 +2014,8 @@ export default class LOCF extends Component {
// </div> // </div>
: :
<div style={{ padding: 0, margin: 0 }}> <div style={{ padding: 0, margin: 0 }}>
<textarea disabled={this.props.get_for == 'view' ? true : tableMeta.rowData[7] == null ? true : tableMeta.rowData[7].value == 'Others' ? false : true} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? 'black' : tableMeta.rowData[7] == null ? 'black' : tableMeta.rowData[7].value == 'Others' ? '#5198ea' : 'black', backgroundColor: this.props.get_for == 'view' ? 'white' : tableMeta.rowData[7] == null ? 'white' : (tableMeta.rowData[18] == '' && tableMeta.rowData[7].value == 'Others' ? '#ffac99' : 'white') }} type="text" defaultValue={tableMeta.rowData[18]} <textarea disabled={this.props.get_for == 'view' ? true : tableMeta.rowData[7] == null ? true : tableMeta.rowData[7].value == 'Others' ? false : true} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? 'black' : tableMeta.rowData[7] == null ? 'black' : tableMeta.rowData[7].value == 'Others' ? '#5198ea' : 'black', backgroundColor: this.props.get_for == 'view' ? 'white' : tableMeta.rowData[7] == null ? 'white' : (tableMeta.rowData[19] == '' && tableMeta.rowData[7].value == 'Others' ? '#ffac99' : 'white') }} type="text" defaultValue={tableMeta.rowData[19]}
onBlur={(event) => handleChange(event.target.value, tableMeta, 18)} /> onBlur={(event) => handleChange(event.target.value, tableMeta, 19)} />
</div> </div>
} }
</div> </div>
...@@ -1950,7 +2038,7 @@ export default class LOCF extends Component { ...@@ -1950,7 +2038,7 @@ export default class LOCF extends Component {
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])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[20]), 1) : Number(tableMeta.rowData[20]) == 0 ? "0.0" : Number(tableMeta.rowData[20])}
/> />
} }
/> />
...@@ -1968,9 +2056,9 @@ export default class LOCF extends Component { ...@@ -1968,9 +2056,9 @@ export default class LOCF extends Component {
placeholder="" placeholder=""
disabled={this.props.get_for == 'view' ? true : tableMeta.rowData[7] == null ? true : tableMeta.rowData[7].value == 'Others' ? false : true} disabled={this.props.get_for == 'view' ? true : tableMeta.rowData[7] == null ? true : tableMeta.rowData[7].value == 'Others' ? false : 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(tableMeta.rowData[19]), 1) : Number(tableMeta.rowData[19]) == 0 ? "0.0" : Number(tableMeta.rowData[19])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[20]), 1) : Number(tableMeta.rowData[20]) == 0 ? "0.0" : Number(tableMeta.rowData[20])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 19) handleChange(event.target.value, tableMeta, 20)
}} }}
/> />
} }
...@@ -1997,7 +2085,7 @@ export default class LOCF extends Component { ...@@ -1997,7 +2085,7 @@ export default class LOCF extends Component {
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])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[21]), 1) : Number(tableMeta.rowData[21]) == 0 ? "0.0" : Number(tableMeta.rowData[21])}
/> />
} }
/> />
...@@ -2015,9 +2103,9 @@ export default class LOCF extends Component { ...@@ -2015,9 +2103,9 @@ export default class LOCF extends Component {
placeholder="" placeholder=""
disabled={this.props.get_for == 'view' ? true : tableMeta.rowData[7] == null ? true : tableMeta.rowData[7].value == 'Others' ? false : true} disabled={this.props.get_for == 'view' ? true : tableMeta.rowData[7] == null ? true : tableMeta.rowData[7].value == 'Others' ? false : 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(tableMeta.rowData[20]), 1) : Number(tableMeta.rowData[20]) == 0 ? "0.0" : Number(tableMeta.rowData[20])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[21]), 1) : Number(tableMeta.rowData[21]) == 0 ? "0.0" : Number(tableMeta.rowData[21])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 20) handleChange(event.target.value, tableMeta, 21)
}} }}
/> />
} }
...@@ -2076,7 +2164,7 @@ export default class LOCF extends Component { ...@@ -2076,7 +2164,7 @@ export default class LOCF extends Component {
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])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[22]), 1) : Number(tableMeta.rowData[22]) == 0 ? "0.0" : Number(tableMeta.rowData[22])}
/> />
} }
/> />
...@@ -2095,7 +2183,7 @@ export default class LOCF extends Component { ...@@ -2095,7 +2183,7 @@ export default class LOCF extends Component {
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])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[22]), 1) : Number(tableMeta.rowData[22]) == 0 ? "0.0" : Number(tableMeta.rowData[22])}
/> />
} }
/> />
...@@ -2121,7 +2209,7 @@ export default class LOCF extends Component { ...@@ -2121,7 +2209,7 @@ export default class LOCF extends Component {
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])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[23]), 1) : Number(tableMeta.rowData[23]) == 0 ? "0.0" : Number(tableMeta.rowData[23])}
/> />
} }
/> />
...@@ -2140,7 +2228,7 @@ export default class LOCF extends Component { ...@@ -2140,7 +2228,7 @@ export default class LOCF extends Component {
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])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[23]), 1) : Number(tableMeta.rowData[23]) == 0 ? "0.0" : Number(tableMeta.rowData[23])}
/> />
} }
/> />
...@@ -2198,7 +2286,7 @@ export default class LOCF extends Component { ...@@ -2198,7 +2286,7 @@ export default class LOCF extends Component {
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])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[24]), 1) : Number(tableMeta.rowData[24]) == 0 ? "0.0" : Number(tableMeta.rowData[24])}
/> />
} }
/> />
...@@ -2217,7 +2305,7 @@ export default class LOCF extends Component { ...@@ -2217,7 +2305,7 @@ export default class LOCF extends Component {
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])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[24]), 1) : Number(tableMeta.rowData[24]) == 0 ? "0.0" : Number(tableMeta.rowData[24])}
/> />
} }
/> />
...@@ -2243,7 +2331,7 @@ export default class LOCF extends Component { ...@@ -2243,7 +2331,7 @@ export default class LOCF extends Component {
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])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[25]), 1) : Number(tableMeta.rowData[25]) == 0 ? "0.0" : Number(tableMeta.rowData[25])}
/> />
} }
/> />
...@@ -2262,7 +2350,7 @@ export default class LOCF extends Component { ...@@ -2262,7 +2350,7 @@ export default class LOCF extends Component {
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])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[25]), 1) : Number(tableMeta.rowData[25]) == 0 ? "0.0" : Number(tableMeta.rowData[25])}
/> />
} }
/> />
...@@ -2324,9 +2412,9 @@ export default class LOCF extends Component { ...@@ -2324,9 +2412,9 @@ export default class LOCF extends Component {
fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
// decimalScale={2} // decimalScale={2}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[25]), 2) : Number(tableMeta.rowData[25]) == 0 ? "0.0" : Number(tableMeta.rowData[25])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[26]), 2) : Number(tableMeta.rowData[26]) == 0 ? "0.0" : Number(tableMeta.rowData[26])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 25) handleChange(event.target.value, tableMeta, 26)
}} }}
/> />
} }
...@@ -2351,7 +2439,7 @@ export default class LOCF extends Component { ...@@ -2351,7 +2439,7 @@ 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(handleTableRatio(tableMeta.rowData[26], tableMeta, 26, "Current Ratio")), 1)) : (Number(handleTableRatio(tableMeta.rowData[26], tableMeta, 26, "Current Ratio")) == 0 ? "0.0" : Number(handleTableRatio(tableMeta.rowData[26], tableMeta, 26, "Current Ratio")))} value={this.props.defaultCurrency.id == 1 ? (fixNumber(Number(handleTableRatio(tableMeta.rowData[27], tableMeta, 27, "Current Ratio")), 1)) : (Number(handleTableRatio(tableMeta.rowData[27], tableMeta, 27, "Current Ratio")) == 0 ? "0.0" : Number(handleTableRatio(tableMeta.rowData[27], tableMeta, 27, "Current Ratio")))}
/> />
} }
/> />
...@@ -2409,9 +2497,9 @@ export default class LOCF extends Component { ...@@ -2409,9 +2497,9 @@ export default class LOCF extends Component {
fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
// decimalScale={2} // decimalScale={2}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[27]), 2) : Number(tableMeta.rowData[27]) == 0 ? "0.0" : Number(tableMeta.rowData[27])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[28]), 2) : Number(tableMeta.rowData[28]) == 0 ? "0.0" : Number(tableMeta.rowData[28])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 27) handleChange(event.target.value, tableMeta, 28)
}} }}
/> />
} }
...@@ -2436,7 +2524,7 @@ export default class LOCF extends Component { ...@@ -2436,7 +2524,7 @@ 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(handleTableRatio(tableMeta.rowData[28], tableMeta, 28, "Debt to Equity Ratio")), 2)) : (Number(handleTableRatio(tableMeta.rowData[28], tableMeta, 28, "Debt to Equity Ratio")) == 0 ? "0.0" : Number(handleTableRatio(tableMeta.rowData[28], tableMeta, 28, "Debt to Equity Ratio")))} value={this.props.defaultCurrency.id == 1 ? (fixNumber(Number(handleTableRatio(tableMeta.rowData[29], tableMeta, 29, "Debt to Equity Ratio")), 2)) : (Number(handleTableRatio(tableMeta.rowData[29], tableMeta, 29, "Debt to Equity Ratio")) == 0 ? "0.0" : Number(handleTableRatio(tableMeta.rowData[29], tableMeta, 29, "Debt to Equity Ratio")))}
/> />
} }
/> />
...@@ -2494,9 +2582,9 @@ export default class LOCF extends Component { ...@@ -2494,9 +2582,9 @@ export default class LOCF extends Component {
fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
// decimalScale={2} // decimalScale={2}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[29]), 2) : Number(tableMeta.rowData[29]) == 0 ? "0.0" : Number(tableMeta.rowData[29])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[30]), 2) : Number(tableMeta.rowData[30]) == 0 ? "0.0" : Number(tableMeta.rowData[30])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 29) handleChange(event.target.value, tableMeta, 30)
}} }}
/> />
} }
...@@ -2521,7 +2609,7 @@ export default class LOCF extends Component { ...@@ -2521,7 +2609,7 @@ 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(handleTableRatio(tableMeta.rowData[30], tableMeta, 30, "Debt to EBITDA - YTD")), 2)) : (Number(handleTableRatio(tableMeta.rowData[30], tableMeta, 30, "Debt to EBITDA - YTD")) == 0 ? "0.0" : Number(handleTableRatio(tableMeta.rowData[30], tableMeta, 30, "Debt to EBITDA - YTD")))} value={this.props.defaultCurrency.id == 1 ? (fixNumber(Number(handleTableRatio(tableMeta.rowData[31], tableMeta, 31, "Debt to EBITDA - YTD")), 2)) : (Number(handleTableRatio(tableMeta.rowData[31], tableMeta, 31, "Debt to EBITDA - YTD")) == 0 ? "0.0" : Number(handleTableRatio(tableMeta.rowData[31], tableMeta, 31, "Debt to EBITDA - YTD")))}
/> />
} }
/> />
...@@ -2579,9 +2667,9 @@ export default class LOCF extends Component { ...@@ -2579,9 +2667,9 @@ export default class LOCF extends Component {
fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
// decimalScale={2} // decimalScale={2}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[31]), 2) : Number(tableMeta.rowData[31]) == 0 ? "0.0" : Number(tableMeta.rowData[31])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[32]), 2) : Number(tableMeta.rowData[32]) == 0 ? "0.0" : Number(tableMeta.rowData[32])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 31) handleChange(event.target.value, tableMeta, 32)
}} }}
/> />
} }
...@@ -2606,7 +2694,7 @@ export default class LOCF extends Component { ...@@ -2606,7 +2694,7 @@ export default class LOCF extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={this.props.defaultCurrency.id == 1 ? (fixNumber(Number(handleTableRatio(tableMeta.rowData[32], tableMeta, 32, "EBITDA to Interest - YTD")), 2)) : (Number(handleTableRatio(tableMeta.rowData[32], tableMeta, 32, "EBITDA to Interest - YTD")) == 0 ? "0.0" : Number(handleTableRatio(tableMeta.rowData[32], tableMeta, 32, "EBITDA to Interest - YTD")))} value={this.props.defaultCurrency.id == 1 ? (fixNumber(Number(handleTableRatio(tableMeta.rowData[33], tableMeta, 33, "EBITDA to Interest - YTD")), 2)) : (Number(handleTableRatio(tableMeta.rowData[33], tableMeta, 33, "EBITDA to Interest - YTD")) == 0 ? "0.0" : Number(handleTableRatio(tableMeta.rowData[33], tableMeta, 33, "EBITDA to Interest - YTD")))}
/> />
} }
/> />
...@@ -2655,8 +2743,8 @@ export default class LOCF extends Component { ...@@ -2655,8 +2743,8 @@ export default class LOCF extends Component {
null : null :
// <div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
<div style={{ padding: 0, margin: 0 }}> <div style={{ padding: 0, margin: 0 }}>
<textarea disabled={this.props.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: 'transparent' }} type="text" defaultValue={tableMeta.rowData[33]} <textarea disabled={this.props.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: 'transparent' }} type="text" defaultValue={tableMeta.rowData[34]}
onBlur={(event) => handleChange(event.target.value, tableMeta, 33)} /> onBlur={(event) => handleChange(event.target.value, tableMeta, 34)} />
</div> </div>
// <ThemeProvider theme={this.props.get_for == 'view'? theme3 : theme}> // <ThemeProvider theme={this.props.get_for == 'view'? theme3 : theme}>
// <Input // <Input
...@@ -2696,9 +2784,9 @@ export default class LOCF extends Component { ...@@ -2696,9 +2784,9 @@ export default class LOCF extends Component {
disabled={this.props.get_for == 'view'} disabled={this.props.get_for == 'view'}
fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[34]), 2) : Number(tableMeta.rowData[34]) == 0 ? "0.0" : Number(tableMeta.rowData[34])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[35]), 2) : Number(tableMeta.rowData[35]) == 0 ? "0.0" : Number(tableMeta.rowData[35])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 34) handleChange(event.target.value, tableMeta, 35)
}} }}
/> />
} }
...@@ -2724,9 +2812,9 @@ export default class LOCF extends Component { ...@@ -2724,9 +2812,9 @@ export default class LOCF extends Component {
disabled={this.props.get_for == 'view'} disabled={this.props.get_for == 'view'}
fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[35]), 2) : Number(tableMeta.rowData[35]) == 0 ? "0.0" : Number(tableMeta.rowData[35])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[36]), 2) : Number(tableMeta.rowData[36]) == 0 ? "0.0" : Number(tableMeta.rowData[36])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 35) handleChange(event.target.value, tableMeta, 36)
}} }}
/> />
} }
...@@ -2775,8 +2863,8 @@ export default class LOCF extends Component { ...@@ -2775,8 +2863,8 @@ export default class LOCF extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9 ?
null : null :
<div style={{ padding: 0, margin: 0 }}> <div style={{ padding: 0, margin: 0 }}>
<textarea disabled={this.props.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: 'transparent' }} type="text" defaultValue={tableMeta.rowData[36]} <textarea disabled={this.props.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: 'transparent' }} type="text" defaultValue={tableMeta.rowData[37]}
onBlur={(event) => handleChange(event.target.value, tableMeta, 36)} /> onBlur={(event) => handleChange(event.target.value, tableMeta, 37)} />
</div> </div>
// <div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
// <ThemeProvider theme={this.props.get_for == 'view'? theme3 : theme}> // <ThemeProvider theme={this.props.get_for == 'view'? theme3 : theme}>
...@@ -2818,9 +2906,9 @@ export default class LOCF extends Component { ...@@ -2818,9 +2906,9 @@ export default class LOCF extends Component {
fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
// decimalScale={2} // decimalScale={2}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[37]), 2) : Number(tableMeta.rowData[37]) == 0 ? "0.0" : Number(tableMeta.rowData[37])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[38]), 2) : Number(tableMeta.rowData[38]) == 0 ? "0.0" : Number(tableMeta.rowData[38])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 37) handleChange(event.target.value, tableMeta, 38)
}} }}
/> />
} }
...@@ -2847,9 +2935,9 @@ export default class LOCF extends Component { ...@@ -2847,9 +2935,9 @@ export default class LOCF extends Component {
fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
// decimalScale={2} // decimalScale={2}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[38]), 2) : Number(tableMeta.rowData[38]) == 0 ? "0.0" : Number(tableMeta.rowData[38])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[39]), 2) : Number(tableMeta.rowData[39]) == 0 ? "0.0" : Number(tableMeta.rowData[39])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 38) handleChange(event.target.value, tableMeta, 39)
}} }}
/> />
} }
...@@ -2898,8 +2986,8 @@ export default class LOCF extends Component { ...@@ -2898,8 +2986,8 @@ export default class LOCF extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9 ?
null : null :
<div style={{ padding: 0, margin: 0 }}> <div style={{ padding: 0, margin: 0 }}>
<textarea disabled={this.props.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: 'transparent' }} type="text" defaultValue={tableMeta.rowData[39]} <textarea disabled={this.props.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: 'transparent' }} type="text" defaultValue={tableMeta.rowData[40]}
onBlur={(event) => handleChange(event.target.value, tableMeta, 39)} /> onBlur={(event) => handleChange(event.target.value, tableMeta, 40)} />
</div> </div>
// <div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
// <ThemeProvider theme={this.props.get_for == 'view'? theme3 : theme}> // <ThemeProvider theme={this.props.get_for == 'view'? theme3 : theme}>
...@@ -2941,9 +3029,9 @@ export default class LOCF extends Component { ...@@ -2941,9 +3029,9 @@ export default class LOCF extends Component {
fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
// decimalScale={2} // decimalScale={2}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[40]), 2) : Number(tableMeta.rowData[40]) == 0 ? "0.0" : Number(tableMeta.rowData[40])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[41]), 2) : Number(tableMeta.rowData[41]) == 0 ? "0.0" : Number(tableMeta.rowData[41])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 40) handleChange(event.target.value, tableMeta, 41)
}} }}
/> />
} }
...@@ -2970,9 +3058,9 @@ export default class LOCF extends Component { ...@@ -2970,9 +3058,9 @@ export default class LOCF extends Component {
fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
// decimalScale={2} // decimalScale={2}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[41]), 2) : Number(tableMeta.rowData[41]) == 0 ? "0.0" : Number(tableMeta.rowData[41])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[42]), 2) : Number(tableMeta.rowData[42]) == 0 ? "0.0" : Number(tableMeta.rowData[42])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 41) handleChange(event.target.value, tableMeta, 42)
}} }}
/> />
} }
...@@ -3021,8 +3109,8 @@ export default class LOCF extends Component { ...@@ -3021,8 +3109,8 @@ export default class LOCF extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9 ?
null : null :
<div style={{ padding: 0, margin: 0 }}> <div style={{ padding: 0, margin: 0 }}>
<textarea disabled={this.props.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: 'transparent' }} type="text" defaultValue={tableMeta.rowData[42]} <textarea disabled={this.props.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: 'transparent' }} type="text" defaultValue={tableMeta.rowData[43]}
onBlur={(event) => handleChange(event.target.value, tableMeta, 42)} /> onBlur={(event) => handleChange(event.target.value, tableMeta, 43)} />
</div> </div>
// <div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
// <ThemeProvider theme={this.props.get_for == 'view'? theme3 : theme}> // <ThemeProvider theme={this.props.get_for == 'view'? theme3 : theme}>
...@@ -3064,9 +3152,9 @@ export default class LOCF extends Component { ...@@ -3064,9 +3152,9 @@ export default class LOCF extends Component {
fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
// decimalScale={2} // decimalScale={2}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[43]), 2) : Number(tableMeta.rowData[43]) == 0 ? "0.0" : Number(tableMeta.rowData[43])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[44]), 2) : Number(tableMeta.rowData[44]) == 0 ? "0.0" : Number(tableMeta.rowData[44])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 43) handleChange(event.target.value, tableMeta, 44)
}} }}
/> />
} }
...@@ -3093,9 +3181,9 @@ export default class LOCF extends Component { ...@@ -3093,9 +3181,9 @@ export default class LOCF extends Component {
fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
// decimalScale={2} // decimalScale={2}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[44]), 2) : Number(tableMeta.rowData[44]) == 0 ? "0.0" : Number(tableMeta.rowData[44])} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[45]), 2) : Number(tableMeta.rowData[45]) == 0 ? "0.0" : Number(tableMeta.rowData[45])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 44) handleChange(event.target.value, tableMeta, 45)
}} }}
/> />
} }
...@@ -3124,8 +3212,8 @@ export default class LOCF extends Component { ...@@ -3124,8 +3212,8 @@ export default class LOCF extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9 ?
null : null :
<div style={{ padding: 0, margin: 0 }}> <div style={{ padding: 0, margin: 0 }}>
<textarea disabled={this.props.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: 'transparent' }} type="text" defaultValue={tableMeta.rowData[45]} <textarea disabled={this.props.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: 'transparent' }} type="text" defaultValue={tableMeta.rowData[46]}
onBlur={(event) => handleChange(event.target.value, tableMeta, 45)} /> onBlur={(event) => handleChange(event.target.value, tableMeta, 46)} />
</div> </div>
// <FormControlLabel // <FormControlLabel
// style={{ margin: 0 }} // style={{ margin: 0 }}
......
...@@ -166,7 +166,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -166,7 +166,7 @@ export default class ListOfCreditFacilities extends Component {
this.setState({ dataTableLOV: data, diffLOV: array[16], totalLoanLOV: array[17], 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], totalLoanLOCF: array[47] , perBSLOCF: array[48], tambah: type, visibleParent: visibleView == undefined ? true : visibleView }) this.setState({ dataTableLOCF: data, diffLOCF: array[47], totalLoanLOCF: array[48] , perBSLOCF: array[49], tambah: type, visibleParent: visibleView == undefined ? true : visibleView })
break break
default: default:
break; break;
...@@ -461,14 +461,14 @@ export default class ListOfCreditFacilities extends Component { ...@@ -461,14 +461,14 @@ export default class ListOfCreditFacilities extends Component {
console.log(dataTable2); console.log(dataTable2);
dataTable2.map(i => { dataTable2.map(i => {
if (i[0] == 3) { if (i[0] == 3) {
if (i[6] == null || i[7] == null || i[8] == "" || i[9] == "" || i[10] == "" || i[11] == "") { if (i[6] == null || i[7] == null || i[8] == "" || i[10] == "" || i[11] == "" || i[12] == "") {
error = true error = true
} }
if (i[7].value == 'Others' && i[18] == '') { if (i[7].value == 'Others' && i[19] == '') {
error = true error = true
} }
let tgl = String(i[9]).split('-') let tgl = String(i[10]).split('-')
let checkUndifined = tgl.findIndex((val) => val == undefined) let checkUndifined = tgl.findIndex((val) => val == undefined)
if (this.props.defaultCurrency.id == 2) { if (this.props.defaultCurrency.id == 2) {
data.push({ data.push({
...@@ -477,46 +477,47 @@ export default class ListOfCreditFacilities extends Component { ...@@ -477,46 +477,47 @@ export default class ListOfCreditFacilities extends Component {
"bank_name": i[6] == null ? [6] : i[6].value, "bank_name": i[6] == null ? [6] : i[6].value,
"type_of_credit": i[7] == null ? i[7] : i[7].value, "type_of_credit": i[7] == null ? i[7] : i[7].value,
"remarks": i[8], "remarks": i[8],
"remarks2": i[9] == null ? i[9] : i[9].value,
// "loan_maturity_date": i[9], // "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[10] == undefined || i[10] == "null" || i[10] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[10])),
// "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], "interest": i[11] == "" ? "0.00" : i[11],
"currency": i[11], "currency": i[12],
"loan_plafond_amount_ori": Number(i[12]) == "" ? "0.0" : Number(i[12]), "loan_plafond_amount_ori": Number(i[13]) == "" ? "0.0" : Number(i[13]),
"loan_plafond_amount_idr": Number(i[13]) == "" ? "0.0" : Number(i[13]), "loan_plafond_amount_idr": Number(i[14]) == "" ? "0.0" : Number(i[14]),
"out_loan_ki_amount_ori": Number(i[14]) == "" ? "0.0" : Number(i[14]), "out_loan_ki_amount_ori": Number(i[15]) == "" ? "0.0" : Number(i[15]),
"out_loan_ki_amount_idr": Number(i[15]) == "" ? "0.0" : Number(i[15]), "out_loan_ki_amount_idr": Number(i[16]) == "" ? "0.0" : Number(i[16]),
"out_loan_kmk_amount_ori": Number(i[16]) == "" ? "0.0" : Number(i[16]), "out_loan_kmk_amount_ori": Number(i[17]) == "" ? "0.0" : Number(i[17]),
"out_loan_kmk_amount_idr": Number(i[17]) == "" ? "0.0" : Number(i[17]), "out_loan_kmk_amount_idr": Number(i[18]) == "" ? "0.0" : Number(i[18]),
// "mtd_vs_previous_month": i[18], // "mtd_vs_previous_month": i[18],
"out_loan_other_type": i[18], "out_loan_other_type": i[19],
"out_loan_other_amount_ori": Number(i[19]) == "" ? "0.0" : Number(i[19]), "out_loan_other_amount_ori": Number(i[20]) == "" ? "0.0" : Number(i[20]),
"out_loan_other_amount_idr": Number(i[20]) == "" ? "0.0" : Number(i[20]), "out_loan_other_amount_idr": Number(i[21]) == "" ? "0.0" : Number(i[21]),
"total_out_loan_ori": Number(i[21]) == "" ? "0.0" : Number(i[21]), "total_out_loan_ori": Number(i[22]) == "" ? "0.0" : Number(i[22]),
"total_out_loan_idr": Number(i[22]) == "" ? "0.0" : Number(i[22]), "total_out_loan_idr": Number(i[23]) == "" ? "0.0" : Number(i[23]),
"remaining_plafond_ori": Number(i[23]) == "" ? "0.0" : Number(i[23]), "remaining_plafond_ori": Number(i[24]) == "" ? "0.0" : Number(i[24]),
"remaining_plafond_idr": Number(i[24]) == "" ? "0.0" : Number(i[24]), "remaining_plafond_idr": Number(i[25]) == "" ? "0.0" : Number(i[25]),
"current_ratio_financial": Number(i[25]) == "" ? "0.00" : Number(i[25]), "current_ratio_financial": Number(i[26]) == "" ? "0.00" : Number(i[26]),
"current_ratio_current": Number(i[26]) == "" ? "0.00" : Number(i[26]), "current_ratio_current": Number(i[27]) == "" ? "0.00" : Number(i[27]),
"der_financial": Number(i[27]) == "" ? "0.00" : Number(i[27]), "der_financial": Number(i[28]) == "" ? "0.00" : Number(i[28]),
"der_current": Number(i[28]) == "" ? "0.00" : Number(i[28]), "der_current": Number(i[29]) == "" ? "0.00" : Number(i[29]),
"debt_to_ebitda_financial": Number(i[29]) == "" ? "0.00" : Number(i[29]), "debt_to_ebitda_financial": Number(i[30]) == "" ? "0.00" : Number(i[30]),
"debt_to_ebitda_current": Number(i[30]) == "" ? "0.00" : Number(i[30]), "debt_to_ebitda_current": Number(i[31]) == "" ? "0.00" : Number(i[31]),
"ebitda_to_interest_financial": Number(i[31]) == "" ? "0.00" : Number(i[31]), "ebitda_to_interest_financial": Number(i[32]) == "" ? "0.00" : Number(i[32]),
"ebitda_to_interest_current": Number(i[32]) == "" ? "0.00" : Number(i[32]), "ebitda_to_interest_current": Number(i[33]) == "" ? "0.00" : Number(i[33]),
"other_ratio1_ratio_name": i[33], "other_ratio1_ratio_name": i[34],
"other_ratio1_financial": Number(i[34]) == "" ? "0.00" : Number(i[34]), "other_ratio1_financial": Number(i[35]) == "" ? "0.00" : Number(i[35]),
"other_ratio1_current": Number(i[35]) == "" ? "0.00" : Number(i[35]), "other_ratio1_current": Number(i[36]) == "" ? "0.00" : Number(i[36]),
"other_ratio2_ratio_name": i[36], "other_ratio2_ratio_name": i[37],
"other_ratio2_financial": Number(i[37]) == "" ? "0.00" : Number(i[37]), "other_ratio2_financial": Number(i[38]) == "" ? "0.00" : Number(i[38]),
"other_ratio2_current": Number(i[38]) == "" ? "0.00" : Number(i[38]), "other_ratio2_current": Number(i[39]) == "" ? "0.00" : Number(i[39]),
"other_ratio3_ratio_name": i[39], "other_ratio3_ratio_name": i[40],
"other_ratio3_financial": Number(i[40]) == "" ? "0.00" : Number(i[40]), "other_ratio3_financial": Number(i[41]) == "" ? "0.00" : Number(i[41]),
"other_ratio3_current": Number(i[41]) == "" ? "0.00" : Number(i[41]), "other_ratio3_current": Number(i[42]) == "" ? "0.00" : Number(i[42]),
"other_ratio4_ratio_name": i[42], "other_ratio4_ratio_name": i[43],
"other_ratio4_financial": Number(i[43]) == "" ? "0.00" : Number(i[43]), "other_ratio4_financial": Number(i[44]) == "" ? "0.00" : Number(i[44]),
"other_ratio4_current": Number(i[44]) == "" ? "0.00" : Number(i[44]), "other_ratio4_current": Number(i[45]) == "" ? "0.00" : Number(i[45]),
"notes": i[45], "notes": i[46],
}) })
} else { } else {
data.push({ data.push({
...@@ -525,46 +526,47 @@ export default class ListOfCreditFacilities extends Component { ...@@ -525,46 +526,47 @@ export default class ListOfCreditFacilities extends Component {
"bank_name": i[6] == null ? [6] : i[6].value, "bank_name": i[6] == null ? [6] : i[6].value,
"type_of_credit": i[7] == null ? i[7] : i[7].value, "type_of_credit": i[7] == null ? i[7] : i[7].value,
"remarks": i[8], "remarks": i[8],
"remarks2": i[9] == null ? i[9] : i[9].value,
// "loan_maturity_date": i[9], // "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[10] == undefined || i[10] == "null" || i[10] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[10])),
// "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], "interest": i[11] == "" ? "0.00" : i[11],
"currency": i[11], "currency": i[12],
"loan_plafond_amount_ori": fixNumber(Number(i[12]), 1) == "" ? "0.0" : fixNumber(Number(i[12]), 1), "loan_plafond_amount_ori": Number(i[13]) == "" ? "0.0" : Number(i[13]),
"loan_plafond_amount_idr": fixNumber(Number(i[13]), 1) == "" ? "0.0" : fixNumber(Number(i[13]), 1), "loan_plafond_amount_idr": Number(i[14]) == "" ? "0.0" : Number(i[14]),
"out_loan_ki_amount_ori": fixNumber(Number(i[14]), 1) == "" ? "0.0" : fixNumber(Number(i[14]), 1), "out_loan_ki_amount_ori": Number(i[15]) == "" ? "0.0" : Number(i[15]),
"out_loan_ki_amount_idr": fixNumber(Number(i[15]), 1) == "" ? "0.0" : fixNumber(Number(i[15]), 1), "out_loan_ki_amount_idr": Number(i[16]) == "" ? "0.0" : Number(i[16]),
"out_loan_kmk_amount_ori": fixNumber(Number(i[16]), 1) == "" ? "0.0" : fixNumber(Number(i[16]), 1), "out_loan_kmk_amount_ori": Number(i[17]) == "" ? "0.0" : Number(i[17]),
"out_loan_kmk_amount_idr": fixNumber(Number(i[17]), 1) == "" ? "0.0" : fixNumber(Number(i[17]), 1), "out_loan_kmk_amount_idr": Number(i[18]) == "" ? "0.0" : Number(i[18]),
// "mtd_vs_previous_month": i[18], // "mtd_vs_previous_month": i[18],
"out_loan_other_type": i[18], "out_loan_other_type": i[19],
"out_loan_other_amount_ori": fixNumber(Number(i[19]), 1) == "" ? "0.0" : fixNumber(Number(i[19]), 1), "out_loan_other_amount_ori": Number(i[20]) == "" ? "0.0" : Number(i[20]),
"out_loan_other_amount_idr": fixNumber(Number(i[20]), 1) == "" ? "0.0" : fixNumber(Number(i[20]), 1), "out_loan_other_amount_idr": Number(i[21]) == "" ? "0.0" : Number(i[21]),
"total_out_loan_ori": fixNumber(Number(i[21]), 1) == "" ? "0.0" : fixNumber(Number(i[21]), 1), "total_out_loan_ori": Number(i[22]) == "" ? "0.0" : Number(i[22]),
"total_out_loan_idr": fixNumber(Number(i[22]), 1) == "" ? "0.0" : fixNumber(Number(i[22]), 1), "total_out_loan_idr": Number(i[23]) == "" ? "0.0" : Number(i[23]),
"remaining_plafond_ori": fixNumber(Number(i[23]), 1) == "" ? "0.0" : fixNumber(Number(i[23]), 1), "remaining_plafond_ori": Number(i[24]) == "" ? "0.0" : Number(i[24]),
"remaining_plafond_idr": fixNumber(Number(i[24]), 1) == "" ? "0.0" : fixNumber(Number(i[24]), 1), "remaining_plafond_idr": Number(i[25]) == "" ? "0.0" : Number(i[25]),
"current_ratio_financial": fixNumber(Number(i[25]), 2) == "" ? "0.00" : fixNumber(Number(i[25]), 2), "current_ratio_financial": Number(i[26]) == "" ? "0.00" : Number(i[26]),
"current_ratio_current": fixNumber(Number(i[26]), 2) == "" ? "0.00" : fixNumber(Number(i[26]), 2), "current_ratio_current": Number(i[27]) == "" ? "0.00" : Number(i[27]),
"der_financial": fixNumber(Number(i[27]), 2) == "" ? "0.00" : fixNumber(Number(i[27]), 2), "der_financial": Number(i[28]) == "" ? "0.00" : Number(i[28]),
"der_current": fixNumber(Number(i[28]), 2) == "" ? "0.00" : fixNumber(Number(i[28]), 2), "der_current": Number(i[29]) == "" ? "0.00" : Number(i[29]),
"debt_to_ebitda_financial": fixNumber(Number(i[29]), 2) == "" ? "0.00" : fixNumber(Number(i[29]), 2), "debt_to_ebitda_financial": Number(i[30]) == "" ? "0.00" : Number(i[30]),
"debt_to_ebitda_current": fixNumber(Number(i[30]), 2) == "" ? "0.00" : fixNumber(Number(i[30]), 2), "debt_to_ebitda_current": Number(i[31]) == "" ? "0.00" : Number(i[31]),
"ebitda_to_interest_financial": fixNumber(Number(i[31]), 2) == "" ? "0.00" : fixNumber(Number(i[31]), 2), "ebitda_to_interest_financial": Number(i[32]) == "" ? "0.00" : Number(i[32]),
"ebitda_to_interest_current": fixNumber(Number(i[32]), 2) == "" ? "0.00" : fixNumber(Number(i[32]), 2), "ebitda_to_interest_current": Number(i[33]) == "" ? "0.00" : Number(i[33]),
"other_ratio1_ratio_name": i[33], "other_ratio1_ratio_name": i[34],
"other_ratio1_financial": fixNumber(Number(i[34]), 2) == "" ? "0.00" : fixNumber(Number(i[34]), 2), "other_ratio1_financial": Number(i[35]) == "" ? "0.00" : Number(i[35]),
"other_ratio1_current": fixNumber(Number(i[35]), 2) == "" ? "0.00" : fixNumber(Number(i[35]), 2), "other_ratio1_current": Number(i[36]) == "" ? "0.00" : Number(i[36]),
"other_ratio2_ratio_name": i[36], "other_ratio2_ratio_name": i[37],
"other_ratio2_financial": fixNumber(Number(i[37]), 2) == "" ? "0.00" : fixNumber(Number(i[37]), 2), "other_ratio2_financial": Number(i[38]) == "" ? "0.00" : Number(i[38]),
"other_ratio2_current": fixNumber(Number(i[38]), 2) == "" ? "0.00" : fixNumber(Number(i[38]), 2), "other_ratio2_current": Number(i[39]) == "" ? "0.00" : Number(i[39]),
"other_ratio3_ratio_name": i[39], "other_ratio3_ratio_name": i[40],
"other_ratio3_financial": fixNumber(Number(i[40]), 2) == "" ? "0.00" : fixNumber(Number(i[40]), 2), "other_ratio3_financial": Number(i[41]) == "" ? "0.00" : Number(i[41]),
"other_ratio3_current": fixNumber(Number(i[41]), 2) == "" ? "0.00" : fixNumber(Number(i[41]), 2), "other_ratio3_current": Number(i[42]) == "" ? "0.00" : Number(i[42]),
"other_ratio4_ratio_name": i[42], "other_ratio4_ratio_name": i[43],
"other_ratio4_financial": fixNumber(Number(i[43]), 2) == "" ? "0.00" : fixNumber(Number(i[43]), 2), "other_ratio4_financial": Number(i[44]) == "" ? "0.00" : Number(i[44]),
"other_ratio4_current": fixNumber(Number(i[44]), 2) == "" ? "0.00" : fixNumber(Number(i[44]), 2), "other_ratio4_current": Number(i[45]) == "" ? "0.00" : Number(i[45]),
"notes": i[45], "notes": i[46],
}) })
} }
...@@ -727,19 +729,20 @@ export default class ListOfCreditFacilities extends Component { ...@@ -727,19 +729,20 @@ export default class ListOfCreditFacilities extends Component {
let data = [] let data = []
let error = false let error = false
let bankNameEmpty = false let bankNameEmpty = false
console.log(dataTable2);
dataTable2.map(i => { dataTable2.map(i => {
if (i[6] == null) { if (i[6] == null) {
bankNameEmpty = true bankNameEmpty = true
} }
if (i[0] == 3) { if (i[0] == 3) {
if (i[6] == null || i[7] == null || i[8] == "" || i[9] == "" || i[10] == "" || i[11] == "") { if (i[6] == null || i[7] == null || i[8] == "" || i[10] == "" || i[11] == "" || i[12] == "") {
error = true error = true
} }
if (i[7].value == 'Others' && i[18] == '') { if (i[7].value == 'Others' && i[18] == '') {
error = true error = true
} }
let tgl = String(i[9]).split('-') let tgl = String(i[10]).split('-')
let checkUndifined = tgl.findIndex((val) => val == undefined) let checkUndifined = tgl.findIndex((val) => val == undefined)
if (this.props.defaultCurrency.id == 2) { if (this.props.defaultCurrency.id == 2) {
data.push({ data.push({
...@@ -748,43 +751,47 @@ export default class ListOfCreditFacilities extends Component { ...@@ -748,43 +751,47 @@ export default class ListOfCreditFacilities extends Component {
"bank_name": i[6] == null ? [6] : i[6].value, "bank_name": i[6] == null ? [6] : i[6].value,
"type_of_credit": i[7] == null ? i[7] : i[7].value, "type_of_credit": i[7] == null ? i[7] : i[7].value,
"remarks": i[8], "remarks": i[8],
"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])), "remarks2": i[9] == null ? i[9] : i[9].value,
"interest": i[10] == "" ? "0.00" : i[10], // "loan_maturity_date": i[9],
"currency": i[11], "loan_maturity_date": i[10] == undefined || i[10] == "null" || i[10] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[10])),
"loan_plafond_amount_ori": Number(i[12]) == "" ? "0.0" : Number(i[12]), // "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_plafond_amount_idr": Number(i[13]) == "" ? "0.0" : Number(i[13]), "interest": i[11] == "" ? "0.00" : i[11],
"out_loan_ki_amount_ori": Number(i[14]) == "" ? "0.0" : Number(i[14]), "currency": i[12],
"out_loan_ki_amount_idr": Number(i[15]) == "" ? "0.0" : Number(i[15]), "loan_plafond_amount_ori": Number(i[13]) == "" ? "0.0" : Number(i[13]),
"out_loan_kmk_amount_ori": Number(i[16]) == "" ? "0.0" : Number(i[16]), "loan_plafond_amount_idr": Number(i[14]) == "" ? "0.0" : Number(i[14]),
"out_loan_kmk_amount_idr": Number(i[17]) == "" ? "0.0" : Number(i[17]), "out_loan_ki_amount_ori": Number(i[15]) == "" ? "0.0" : Number(i[15]),
"out_loan_other_type": i[18], "out_loan_ki_amount_idr": Number(i[16]) == "" ? "0.0" : Number(i[16]),
"out_loan_other_amount_ori": Number(i[19]) == "" ? "0.0" : Number(i[19]), "out_loan_kmk_amount_ori": Number(i[17]) == "" ? "0.0" : Number(i[17]),
"out_loan_other_amount_idr": Number(i[20]) == "" ? "0.0" : Number(i[20]), "out_loan_kmk_amount_idr": Number(i[18]) == "" ? "0.0" : Number(i[18]),
"total_out_loan_ori": Number(i[21]) == "" ? "0.0" : Number(i[21]), // "mtd_vs_previous_month": i[18],
"total_out_loan_idr": Number(i[22]) == "" ? "0.0" : Number(i[22]), "out_loan_other_type": i[19],
"remaining_plafond_ori": Number(i[23]) == "" ? "0.0" : Number(i[23]), "out_loan_other_amount_ori": Number(i[20]) == "" ? "0.0" : Number(i[20]),
"remaining_plafond_idr": Number(i[24]) == "" ? "0.0" : Number(i[24]), "out_loan_other_amount_idr": Number(i[21]) == "" ? "0.0" : Number(i[21]),
"current_ratio_financial": Number(i[25]) == "" ? "0.00" : Number(i[25]), "total_out_loan_ori": Number(i[22]) == "" ? "0.0" : Number(i[22]),
"current_ratio_current": Number(i[26]) == "" ? "0.00" : Number(i[26]), "total_out_loan_idr": Number(i[23]) == "" ? "0.0" : Number(i[23]),
"der_financial": Number(i[27]) == "" ? "0.00" : Number(i[27]), "remaining_plafond_ori": Number(i[24]) == "" ? "0.0" : Number(i[24]),
"der_current": Number(i[28]) == "" ? "0.00" : Number(i[28]), "remaining_plafond_idr": Number(i[25]) == "" ? "0.0" : Number(i[25]),
"debt_to_ebitda_financial": Number(i[29]) == "" ? "0.00" : Number(i[29]), "current_ratio_financial": Number(i[26]) == "" ? "0.00" : Number(i[26]),
"debt_to_ebitda_current": Number(i[30]) == "" ? "0.00" : Number(i[30]), "current_ratio_current": Number(i[27]) == "" ? "0.00" : Number(i[27]),
"ebitda_to_interest_financial": Number(i[31]) == "" ? "0.00" : Number(i[31]), "der_financial": Number(i[28]) == "" ? "0.00" : Number(i[28]),
"ebitda_to_interest_current": Number(i[32]) == "" ? "0.00" : Number(i[32]), "der_current": Number(i[29]) == "" ? "0.00" : Number(i[29]),
"other_ratio1_ratio_name": i[33], "debt_to_ebitda_financial": Number(i[30]) == "" ? "0.00" : Number(i[30]),
"other_ratio1_financial": Number(i[34]) == "" ? "0.00" : Number(i[34]), "debt_to_ebitda_current": Number(i[31]) == "" ? "0.00" : Number(i[31]),
"other_ratio1_current": Number(i[35]) == "" ? "0.00" : Number(i[35]), "ebitda_to_interest_financial": Number(i[32]) == "" ? "0.00" : Number(i[32]),
"other_ratio2_ratio_name": i[36], "ebitda_to_interest_current": Number(i[33]) == "" ? "0.00" : Number(i[33]),
"other_ratio2_financial": Number(i[37]) == "" ? "0.00" : Number(i[37]), "other_ratio1_ratio_name": i[34],
"other_ratio2_current": Number(i[38]) == "" ? "0.00" : Number(i[38]), "other_ratio1_financial": Number(i[35]) == "" ? "0.00" : Number(i[35]),
"other_ratio3_ratio_name": i[39], "other_ratio1_current": Number(i[36]) == "" ? "0.00" : Number(i[36]),
"other_ratio3_financial": Number(i[40]) == "" ? "0.00" : Number(i[40]), "other_ratio2_ratio_name": i[37],
"other_ratio3_current": Number(i[41]) == "" ? "0.00" : Number(i[41]), "other_ratio2_financial": Number(i[38]) == "" ? "0.00" : Number(i[38]),
"other_ratio4_ratio_name": i[42], "other_ratio2_current": Number(i[39]) == "" ? "0.00" : Number(i[39]),
"other_ratio4_financial": Number(i[43]) == "" ? "0.00" : Number(i[43]), "other_ratio3_ratio_name": i[40],
"other_ratio4_current": Number(i[44]) == "" ? "0.00" : Number(i[44]), "other_ratio3_financial": Number(i[41]) == "" ? "0.00" : Number(i[41]),
"notes": i[45], "other_ratio3_current": Number(i[42]) == "" ? "0.00" : Number(i[42]),
"other_ratio4_ratio_name": i[43],
"other_ratio4_financial": Number(i[44]) == "" ? "0.00" : Number(i[44]),
"other_ratio4_current": Number(i[45]) == "" ? "0.00" : Number(i[45]),
"notes": i[46],
}) })
} else { } else {
data.push({ data.push({
...@@ -793,43 +800,47 @@ export default class ListOfCreditFacilities extends Component { ...@@ -793,43 +800,47 @@ export default class ListOfCreditFacilities extends Component {
"bank_name": i[6] == null ? [6] : i[6].value, "bank_name": i[6] == null ? [6] : i[6].value,
"type_of_credit": i[7] == null ? i[7] : i[7].value, "type_of_credit": i[7] == null ? i[7] : i[7].value,
"remarks": i[8], "remarks": i[8],
"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])), "remarks2": i[9] == null ? i[9] : i[9].value,
"interest": i[10] == "" ? "0.00" : i[10], // "loan_maturity_date": i[9],
"currency": i[11], "loan_maturity_date": i[10] == undefined || i[10] == "null" || i[10] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[10])),
"loan_plafond_amount_ori": fixNumber(Number(i[12]), 1) == "" ? "0.0" : fixNumber(Number(i[12]), 1), // "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_plafond_amount_idr": fixNumber(Number(i[13]), 1) == "" ? "0.0" : fixNumber(Number(i[13]), 1), "interest": i[11] == "" ? "0.00" : i[11],
"out_loan_ki_amount_ori": fixNumber(Number(i[14]), 1) == "" ? "0.0" : fixNumber(Number(i[14]), 1), "currency": i[12],
"out_loan_ki_amount_idr": fixNumber(Number(i[15]), 1) == "" ? "0.0" : fixNumber(Number(i[15]), 1), "loan_plafond_amount_ori": Number(i[13]) == "" ? "0.0" : Number(i[13]),
"out_loan_kmk_amount_ori": fixNumber(Number(i[16]), 1) == "" ? "0.0" : fixNumber(Number(i[16]), 1), "loan_plafond_amount_idr": Number(i[14]) == "" ? "0.0" : Number(i[14]),
"out_loan_kmk_amount_idr": fixNumber(Number(i[17]), 1) == "" ? "0.0" : fixNumber(Number(i[17]), 1), "out_loan_ki_amount_ori": Number(i[15]) == "" ? "0.0" : Number(i[15]),
"out_loan_other_type": i[18], "out_loan_ki_amount_idr": Number(i[16]) == "" ? "0.0" : Number(i[16]),
"out_loan_other_amount_ori": fixNumber(Number(i[19]), 1) == "" ? "0.0" : fixNumber(Number(i[19]), 1), "out_loan_kmk_amount_ori": Number(i[17]) == "" ? "0.0" : Number(i[17]),
"out_loan_other_amount_idr": fixNumber(Number(i[20]), 1) == "" ? "0.0" : fixNumber(Number(i[20]), 1), "out_loan_kmk_amount_idr": Number(i[18]) == "" ? "0.0" : Number(i[18]),
"total_out_loan_ori": fixNumber(Number(i[21]), 1) == "" ? "0.0" : fixNumber(Number(i[21]), 1), // "mtd_vs_previous_month": i[18],
"total_out_loan_idr": fixNumber(Number(i[22]), 1) == "" ? "0.0" : fixNumber(Number(i[22]), 1), "out_loan_other_type": i[19],
"remaining_plafond_ori": fixNumber(Number(i[23]), 1) == "" ? "0.0" : fixNumber(Number(i[23]), 1), "out_loan_other_amount_ori": Number(i[20]) == "" ? "0.0" : Number(i[20]),
"remaining_plafond_idr": fixNumber(Number(i[24]), 1) == "" ? "0.0" : fixNumber(Number(i[24]), 1), "out_loan_other_amount_idr": Number(i[21]) == "" ? "0.0" : Number(i[21]),
"current_ratio_financial": fixNumber(Number(i[25]), 2) == "" ? "0.00" : fixNumber(Number(i[25]), 2), "total_out_loan_ori": Number(i[22]) == "" ? "0.0" : Number(i[22]),
"current_ratio_current": fixNumber(Number(i[26]), 2) == "" ? "0.00" : fixNumber(Number(i[26]), 2), "total_out_loan_idr": Number(i[23]) == "" ? "0.0" : Number(i[23]),
"der_financial": fixNumber(Number(i[27]), 2) == "" ? "0.00" : fixNumber(Number(i[27]), 2), "remaining_plafond_ori": Number(i[24]) == "" ? "0.0" : Number(i[24]),
"der_current": fixNumber(Number(i[28]), 2) == "" ? "0.00" : fixNumber(Number(i[28]), 2), "remaining_plafond_idr": Number(i[25]) == "" ? "0.0" : Number(i[25]),
"debt_to_ebitda_financial": fixNumber(Number(i[29]), 2) == "" ? "0.00" : fixNumber(Number(i[29]), 2), "current_ratio_financial": Number(i[26]) == "" ? "0.00" : Number(i[26]),
"debt_to_ebitda_current": fixNumber(Number(i[30]), 2) == "" ? "0.00" : fixNumber(Number(i[30]), 2), "current_ratio_current": Number(i[27]) == "" ? "0.00" : Number(i[27]),
"ebitda_to_interest_financial": fixNumber(Number(i[31]), 2) == "" ? "0.00" : fixNumber(Number(i[31]), 2), "der_financial": Number(i[28]) == "" ? "0.00" : Number(i[28]),
"ebitda_to_interest_current": fixNumber(Number(i[32]), 2) == "" ? "0.00" : fixNumber(Number(i[32]), 2), "der_current": Number(i[29]) == "" ? "0.00" : Number(i[29]),
"other_ratio1_ratio_name": i[33], "debt_to_ebitda_financial": Number(i[30]) == "" ? "0.00" : Number(i[30]),
"other_ratio1_financial": fixNumber(Number(i[34]), 2) == "" ? "0.00" : fixNumber(Number(i[34]), 2), "debt_to_ebitda_current": Number(i[31]) == "" ? "0.00" : Number(i[31]),
"other_ratio1_current": fixNumber(Number(i[35]), 2) == "" ? "0.00" : fixNumber(Number(i[35]), 2), "ebitda_to_interest_financial": Number(i[32]) == "" ? "0.00" : Number(i[32]),
"other_ratio2_ratio_name": i[36], "ebitda_to_interest_current": Number(i[33]) == "" ? "0.00" : Number(i[33]),
"other_ratio2_financial": fixNumber(Number(i[37]), 2) == "" ? "0.00" : fixNumber(Number(i[37]), 2), "other_ratio1_ratio_name": i[34],
"other_ratio2_current": fixNumber(Number(i[38]), 2) == "" ? "0.00" : fixNumber(Number(i[38]), 2), "other_ratio1_financial": Number(i[35]) == "" ? "0.00" : Number(i[35]),
"other_ratio3_ratio_name": i[39], "other_ratio1_current": Number(i[36]) == "" ? "0.00" : Number(i[36]),
"other_ratio3_financial": fixNumber(Number(i[40]), 2) == "" ? "0.00" : fixNumber(Number(i[40]), 2), "other_ratio2_ratio_name": i[37],
"other_ratio3_current": fixNumber(Number(i[41]), 2) == "" ? "0.00" : fixNumber(Number(i[41]), 2), "other_ratio2_financial": Number(i[38]) == "" ? "0.00" : Number(i[38]),
"other_ratio4_ratio_name": i[42], "other_ratio2_current": Number(i[39]) == "" ? "0.00" : Number(i[39]),
"other_ratio4_financial": fixNumber(Number(i[43]), 2) == "" ? "0.00" : fixNumber(Number(i[43]), 2), "other_ratio3_ratio_name": i[40],
"other_ratio4_current": fixNumber(Number(i[44]), 2) == "" ? "0.00" : fixNumber(Number(i[44]), 2), "other_ratio3_financial": Number(i[41]) == "" ? "0.00" : Number(i[41]),
"notes": i[45], "other_ratio3_current": Number(i[42]) == "" ? "0.00" : Number(i[42]),
"other_ratio4_ratio_name": i[43],
"other_ratio4_financial": Number(i[44]) == "" ? "0.00" : Number(i[44]),
"other_ratio4_current": Number(i[45]) == "" ? "0.00" : Number(i[45]),
"notes": i[46],
}) })
} }
...@@ -1178,14 +1189,14 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1178,14 +1189,14 @@ export default class ListOfCreditFacilities extends Component {
console.log(dataTable2); console.log(dataTable2);
dataTable2.map(i => { dataTable2.map(i => {
if (i[0] == 3) { if (i[0] == 3) {
if (i[6] == null || i[7] == null || i[8] == "" || i[9] == "" || i[10] == "" || i[11] == "") { if (i[6] == null || i[7] == null || i[8] == "" || i[10] == "" || i[11] == "" || i[12] == "") {
error = true error = true
} }
if (i[7].value == 'Others' && i[18] == '') { if (i[7].value == 'Others' && i[18] == '') {
error = true error = true
} }
let tgl = String(i[9]).split('-') let tgl = String(i[10]).split('-')
let checkUndifined = tgl.findIndex((val) => val == undefined) let checkUndifined = tgl.findIndex((val) => val == undefined)
if (this.props.defaultCurrency.id == 2) { if (this.props.defaultCurrency.id == 2) {
data.push({ data.push({
......
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