import React, { Component } from 'react'; import { createMuiTheme, FormControlLabel, MuiThemeProvider, Paper, TableCell, Tooltip, Typography, withStyles, Input, ThemeProvider, TextareaAutosize } from '@material-ui/core' import MUIDataTable from 'mui-datatables'; import Images from '../../assets/Images'; import api from '../../api'; import NumberFormat from 'react-number-format'; import Constant from '../../library/Constant'; import { titleCase } from '../../library/Utils'; import { Autocomplete } from '@material-ui/lab'; import { PropagateLoader } from 'react-spinners'; import ReactTooltip from 'react-tooltip'; import { DatePicker } from '@material-ui/pickers'; import { format } from 'date-fns'; import { BorderStyle } from '@material-ui/icons'; import { includes } from 'ramda'; import Snackbar from '@material-ui/core/Snackbar'; import MuiAlert from '@material-ui/lab/Alert'; import { makeStyles } from '@material-ui/core/styles'; import UploadFile from "../../library/Upload"; import { ExcelRenderer } from 'react-excel-renderer'; import { fixNumber, roundMath } from "../../library/Utils"; import LOCF from './LOCFMR'; import LOV from './LOVMR'; function Alert(props) { return ; } const useStyles = makeStyles((theme) => ({ root: { width: '100%', '& > * + *': { marginTop: theme.spacing(2), }, }, })); const LightTooltip = withStyles((theme) => ({ tooltip: { backgroundColor: theme.palette.common.white, color: 'rgba(0, 0, 0, 0.87)', boxShadow: theme.shadows[1], fontSize: 11, }, }))(Tooltip); var ct = require("../../library/CustomTable"); const getMuiTheme = () => createMuiTheme(ct.customTable3()); const options = ct.customOptionsFixedColumn(); const style = { position: "sticky", left: 0, background: "white", zIndex: 101, }; const style2 = { position: "sticky", background: "white", zIndex: 100, top: 0 }; const theme = createMuiTheme({ overrides: { // Style sheet name ⚛️ MuiInputBase: { input: { color: '#5198ea', marginTop: -10, textAlign: 'center' } } }, }); const theme2 = createMuiTheme({ overrides: { // Style sheet name ⚛️ MuiInputBase: { input: { color: '#5198ea', textAlign: 'center' } } }, }); const theme3 = createMuiTheme({ overrides: { // Style sheet name ⚛️ MuiInputBase: { input: { color: '#black', textAlign: 'center' } } }, }); export default class ListOfCreditFacilities extends Component { constructor(props) { super(props) this.state = { dataTable: [], dataTableLOV: [], dataTableLOCF: [], lastArrayLOCF: null, lastArrayLOV: null, bankNameList: [], typeOfCreditList: [], loading: false, loadingChild: false, dataTableRatio: [], currentDate: format(new Date(), 'yyyy-MM-dd'), totalOutStand: 0, diffLOCF: 0, perBSLOCF: 0, totalLoanLOCF: 0, diffLOV: 0, perBSLOV: 0, totalLoanLOV: 0, snekbar: false, snekbarMsg: '', visibleParent: true, buttonError: false, saveDraft: true, saveComp: true, saveCompLOV: true, get_for: 'view', updateBy: [], notes: "", viewOnly: true, dataDelete: [], saveTambahan: true, defaultCurrencyUpload: this.props.defaultCurrency, visibleAlertSave: false, } } componentDidMount() { // this.getperBSLOCF() // this.getBankData() // this.getTypeOfCredit() this.getSubmission() this.getLatestUpdate() this.handleViewOnly() } handleGetFor(type) { this.setState({ get_for: type }, () => { // this.getperBSLOCF() // this.getBankData() // this.getTypeOfCredit() // this.getSubmission() // this.getLatestUpdate() }) } dataTableForChild(data, array, params, type, visibleView) { console.log(visibleView); console.log(type); switch (params) { case "LOV": console.log(data); this.setState({ dataTableLOV: data, diffLOV: array[16], totalLoanLOV: array[17], perBSLOV: array[18], tambahLOV: type, visibleParent: visibleView == undefined ? true : visibleView }) break; case "LOCF": this.setState({ dataTableLOCF: data, diffLOCF: array[46], totalLoanLOCF: array[47] , perBSLOCF: array[48], tambah: type, visibleParent: visibleView == undefined ? true : visibleView }) break default: break; } } handleViewOnly() { let checkApprover = false let checkLastStatus = false let checkStatus = false let checkPrevRev = false if (this.props.isApprover) { checkApprover = true } else { checkApprover = false } if (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') { checkLastStatus = true } else { checkLastStatus = false } if (this.props.prevRevision) { checkPrevRev = true } else { checkPrevRev = false } if (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') { checkStatus = true } else { checkStatus = false } this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev }) // this.setState({viewOnly: true}) } getLatestUpdate() { let payload = { "report_id": this.props.report_id, "revision": Number(this.props.revision), "periode": this.props.periode, "company_id": this.props.company.company_id, "monthly_report_id": this.props.monthlyReportId, "months": this.props.month.month_id } // console.log(payload) api.create().getLastestUpdateMR(payload).then(response => { if (response.data) { if (response.data.status === "success") { this.setState({ updateBy: response.data.data.detail === null ? [] : response.data.data.detail, notes: response.data.data.notes_update === null ? "" : response.data.data.notes_update }) } else { this.setState({ alert: true, messageAlert: response.data.message, typeAlert: 'warning', loading: false }, () => { if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) { setTimeout(() => { localStorage.removeItem(Constant.TOKEN) window.location.reload(); }, 1000); } }) } } else { // console.log('brrrrrrrr') this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false }) } }) } deleteReport() { let payload = { "item_report_id": this.state.dataDelete, "periode": this.props.periode, "months": this.props.month.month_id } if (this.state.dataDelete.length > 0) { api.create().deleteAllItemReportLOCF(payload).then((response) => { console.log(response) }) } } getSubmission() { this.setState({ loading: true }) let payload = { "company_id": this.props.company.company_id, "periode": this.props.periode, "is_approver": true } api.create().getSubmission(payload).then(response => { console.log(response) if (response.data) { if (response.data.status === "success") { this.setState({ submissionID: response.data.data.submission_id, lastRevision: response.data.data.last_revision, }, () => { // this.getDataRatio() }) } else { this.setState({ submissionID: null, loading: false }) } } }) } // backToMonthlyReportLOCF(type) { // // this.setState({ loading: true }) // console.log('kok kesiniii'); // let dataTable2 = this.state.dataTablelocf == undefined || this.state.tambah == 'tambah' || this.state.tambah == 'upload' ? this.state.dataTableLOCF : this.state.dataTablelocf // let data = [] // let error = false // this.deleteReport() // dataTable.map(i => { // console.log(i); // if (i[0] == 3) { // if (i[6] == null || i[7] == null || i[8] == "" || i[9] == "" || i[10] == "" || i[11] == "") { // error = true // } // if (i[7].value == 'Others' && i[18] == '') { // error = true // } // let tgl = String(i[9]).split('-') // let checkUndifined = tgl.findIndex((val) => val == undefined) // if (this.props.defaultCurrency.id == 2) { // data.push({ // "item_report_id": i[1], // "borrower_comp_name": i[5], // "bank_name": i[6] == null ? [6] : i[6].value, // "type_of_credit": i[7] == null ? i[7] : i[7].value, // "remarks": i[8], // "loan_maturity_date": i[9] == 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], // "interest": i[10] == "" ? "0.00" : i[10], // "currency": i[11], // "loan_plafond_amount_ori": Number(i[12]) == "" ? "0.0" : Number(i[12]), // "loan_plafond_amount_idr": Number(i[13]) == "" ? "0.0" : Number(i[13]), // "out_loan_ki_amount_ori": Number(i[14]) == "" ? "0.0" : Number(i[14]), // "out_loan_ki_amount_idr": Number(i[15]) == "" ? "0.0" : Number(i[15]), // "out_loan_kmk_amount_ori": Number(i[16]) == "" ? "0.0" : Number(i[16]), // "out_loan_kmk_amount_idr": Number(i[17]) == "" ? "0.0" : Number(i[17]), // // "mtd_vs_previous_month": i[18], // "out_loan_other_type": i[18], // "out_loan_other_amount_ori": Number(i[19]) == "" ? "0.0" : Number(i[19]), // "out_loan_other_amount_idr": Number(i[20]) == "" ? "0.0" : Number(i[20]), // "total_out_loan_ori": Number(i[21]) == "" ? "0.0" : Number(i[21]), // "total_out_loan_idr": Number(i[22]) == "" ? "0.0" : Number(i[22]), // "remaining_plafond_ori": Number(i[23]) == "" ? "0.0" : Number(i[23]), // "remaining_plafond_idr": Number(i[24]) == "" ? "0.0" : Number(i[24]), // "current_ratio_financial": Number(i[25]) == "" ? "0.00" : Number(i[25]), // "current_ratio_current": Number(i[26]) == "" ? "0.00" : Number(i[26]), // "der_financial": Number(i[27]) == "" ? "0.00" : Number(i[27]), // "der_current": Number(i[28]) == "" ? "0.00" : Number(i[28]), // "debt_to_ebitda_financial": Number(i[29]) == "" ? "0.00" : Number(i[29]), // "debt_to_ebitda_current": Number(i[30]) == "" ? "0.00" : Number(i[30]), // "ebitda_to_interest_financial": Number(i[31]) == "" ? "0.00" : Number(i[31]), // "ebitda_to_interest_current": Number(i[32]) == "" ? "0.00" : Number(i[32]), // "other_ratio1_ratio_name": i[33], // "other_ratio1_financial": Number(i[34]) == "" ? "0.00" : Number(i[34]), // "other_ratio1_current": Number(i[35]) == "" ? "0.00" : Number(i[35]), // "other_ratio2_ratio_name": i[36], // "other_ratio2_financial": Number(i[37]) == "" ? "0.00" : Number(i[37]), // "other_ratio2_current": Number(i[38]) == "" ? "0.00" : Number(i[38]), // "other_ratio3_ratio_name": i[39], // "other_ratio3_financial": Number(i[40]) == "" ? "0.00" : Number(i[40]), // "other_ratio3_current": Number(i[41]) == "" ? "0.00" : Number(i[41]), // "other_ratio4_ratio_name": i[42], // "other_ratio4_financial": Number(i[43]) == "" ? "0.00" : Number(i[43]), // "other_ratio4_current": Number(i[44]) == "" ? "0.00" : Number(i[44]), // "notes": i[45], // }) // } else { // data.push({ // "item_report_id": i[1], // "borrower_comp_name": i[5], // "bank_name": i[6] == null ? [6] : i[6].value, // "type_of_credit": i[7] == null ? i[7] : i[7].value, // "remarks": i[8], // "loan_maturity_date": i[9] == 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], // "interest": i[10] == "" ? "0.00" : i[10], // "currency": i[11], // "loan_plafond_amount_ori": fixNumber(Number(i[12]), 1) == "" ? "0.0" : fixNumber(Number(i[12]), 1), // "loan_plafond_amount_idr": fixNumber(Number(i[13]), 1) == "" ? "0.0" : fixNumber(Number(i[13]), 1), // "out_loan_ki_amount_ori": fixNumber(Number(i[14]), 1) == "" ? "0.0" : fixNumber(Number(i[14]), 1), // "out_loan_ki_amount_idr": fixNumber(Number(i[15]), 1) == "" ? "0.0" : fixNumber(Number(i[15]), 1), // "out_loan_kmk_amount_ori": fixNumber(Number(i[16]), 1) == "" ? "0.0" : fixNumber(Number(i[16]), 1), // "out_loan_kmk_amount_idr": fixNumber(Number(i[17]), 1) == "" ? "0.0" : fixNumber(Number(i[17]), 1), // // "mtd_vs_previous_month": i[18], // "out_loan_other_type": i[18], // "out_loan_other_amount_ori": fixNumber(Number(i[19]), 1) == "" ? "0.0" : fixNumber(Number(i[19]), 1), // "out_loan_other_amount_idr": fixNumber(Number(i[20]), 1) == "" ? "0.0" : fixNumber(Number(i[20]), 1), // "total_out_loan_ori": fixNumber(Number(i[21]), 1) == "" ? "0.0" : fixNumber(Number(i[21]), 1), // "total_out_loan_idr": fixNumber(Number(i[22]), 1) == "" ? "0.0" : fixNumber(Number(i[22]), 1), // "remaining_plafond_ori": fixNumber(Number(i[23]), 1) == "" ? "0.0" : fixNumber(Number(i[23]), 1), // "remaining_plafond_idr": fixNumber(Number(i[24]), 1) == "" ? "0.0" : fixNumber(Number(i[24]), 1), // "current_ratio_financial": fixNumber(Number(i[25]), 2) == "" ? "0.00" : fixNumber(Number(i[25]), 2), // "current_ratio_current": fixNumber(Number(i[26]), 2) == "" ? "0.00" : fixNumber(Number(i[26]), 2), // "der_financial": fixNumber(Number(i[27]), 2) == "" ? "0.00" : fixNumber(Number(i[27]), 2), // "der_current": fixNumber(Number(i[28]), 2) == "" ? "0.00" : fixNumber(Number(i[28]), 2), // "debt_to_ebitda_financial": fixNumber(Number(i[29]), 2) == "" ? "0.00" : fixNumber(Number(i[29]), 2), // "debt_to_ebitda_current": fixNumber(Number(i[30]), 2) == "" ? "0.00" : fixNumber(Number(i[30]), 2), // "ebitda_to_interest_financial": fixNumber(Number(i[31]), 2) == "" ? "0.00" : fixNumber(Number(i[31]), 2), // "ebitda_to_interest_current": fixNumber(Number(i[32]), 2) == "" ? "0.00" : fixNumber(Number(i[32]), 2), // "other_ratio1_ratio_name": i[33], // "other_ratio1_financial": fixNumber(Number(i[34]), 2) == "" ? "0.00" : fixNumber(Number(i[34]), 2), // "other_ratio1_current": fixNumber(Number(i[35]), 2) == "" ? "0.00" : fixNumber(Number(i[35]), 2), // "other_ratio2_ratio_name": i[36], // "other_ratio2_financial": fixNumber(Number(i[37]), 2) == "" ? "0.00" : fixNumber(Number(i[37]), 2), // "other_ratio2_current": fixNumber(Number(i[38]), 2) == "" ? "0.00" : fixNumber(Number(i[38]), 2), // "other_ratio3_ratio_name": i[39], // "other_ratio3_financial": fixNumber(Number(i[40]), 2) == "" ? "0.00" : fixNumber(Number(i[40]), 2), // "other_ratio3_current": fixNumber(Number(i[41]), 2) == "" ? "0.00" : fixNumber(Number(i[41]), 2), // "other_ratio4_ratio_name": i[42], // "other_ratio4_financial": fixNumber(Number(i[43]), 2) == "" ? "0.00" : fixNumber(Number(i[43]), 2), // "other_ratio4_current": fixNumber(Number(i[44]), 2) == "" ? "0.00" : fixNumber(Number(i[44]), 2), // "notes": i[45], // }) // } // } // }) // let payload = { // "monthly_report_id": this.props.monthlyReportId, // "company_id": this.props.company.company_id, // "periode": this.props.periode, // "report_id": this.props.report_id, // "status": type, // "months": this.props.month.month_id, // "currency_id": this.props.defaultCurrency.id, // "locf": data, // "per_bs": this.state.perBSLOCF, // "diff": this.state.diff, // "total_loan": this.state.perBSLOCF // } // console.log(payload) // // if (error && type == 'submitted') { // // this.setState({ handleDoubleClick: 0, saveDraft: false, saveComp: true, loading: false, snekbar: true, snekbarMsg: 'Data Incomplete', handleDoubleClick: 0 }) // // } else { // // api.create('UPLOAD').createMonthlyReportLOCF(payload).then(response => { // // console.log(response); // // if (response.data) { // // if (response.data.status === "success") { // // this.props.saveToMonthlyReport('LOCF') // // } else { // // if (response.data?.message == "Please Set Up Rate Currency First") { // // this.setState({ visibleAlertSave: true }) // // } else { // // this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { // // document.body.style.overflow = 'unset'; // // if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) { // // setTimeout(() => { // // localStorage.removeItem(Constant.TOKEN) // // window.location.reload(); // // }, 1000); // // } // // this.props.saveToMonthlyReport() // // }) // // } // // } // // // else { // // // this.setState({ loading: false }, () => { // // // this.props.saveToMonthlyReport() // // // }) // // // } // // } else { // // this.setState({ loading: false }, () => { // // // this.getSubmission() // // document.body.style.overflow = 'unset'; // // }) // // } // // this.setState({ handleDoubleClick: 0 }) // // }) // // } // } backToMonthlyReportLOCF(type) { console.log('masoook LOCF'); let dataTable2 = this.state.dataTablelocf == undefined || this.state.tambah == 'tambah' || this.state.tambah == 'upload' ? this.state.dataTableLOCF : this.state.dataTablelocf let data = [] let error = false // this.deleteReport() console.log(dataTable2); dataTable2.map(i => { if (i[0] == 3) { if (i[6] == null || i[7] == null || i[8] == "" || i[9] == "" || i[10] == "" || i[11] == "") { error = true } if (i[7].value == 'Others' && i[18] == '') { error = true } let tgl = String(i[9]).split('-') let checkUndifined = tgl.findIndex((val) => val == undefined) if (this.props.defaultCurrency.id == 2) { data.push({ "item_report_id": i[1], "borrower_comp_name": i[5], "bank_name": i[6] == null ? [6] : i[6].value, "type_of_credit": i[7] == null ? i[7] : i[7].value, "remarks": i[8], // "loan_maturity_date": i[9], "loan_maturity_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])), // "loan_maturity_date": i[9] !== undefined || i[9] !== "null" || i[9] !== null? (String(tgl[2]).length <= 2? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])) : "", "interest": i[10] == "" ? "0.00" : i[10], "currency": i[11], "loan_plafond_amount_ori": Number(i[12]) == "" ? "0.0" : Number(i[12]), "loan_plafond_amount_idr": Number(i[13]) == "" ? "0.0" : Number(i[13]), "out_loan_ki_amount_ori": Number(i[14]) == "" ? "0.0" : Number(i[14]), "out_loan_ki_amount_idr": Number(i[15]) == "" ? "0.0" : Number(i[15]), "out_loan_kmk_amount_ori": Number(i[16]) == "" ? "0.0" : Number(i[16]), "out_loan_kmk_amount_idr": Number(i[17]) == "" ? "0.0" : Number(i[17]), // "mtd_vs_previous_month": i[18], "out_loan_other_type": i[18], "out_loan_other_amount_ori": Number(i[19]) == "" ? "0.0" : Number(i[19]), "out_loan_other_amount_idr": Number(i[20]) == "" ? "0.0" : Number(i[20]), "total_out_loan_ori": Number(i[21]) == "" ? "0.0" : Number(i[21]), "total_out_loan_idr": Number(i[22]) == "" ? "0.0" : Number(i[22]), "remaining_plafond_ori": Number(i[23]) == "" ? "0.0" : Number(i[23]), "remaining_plafond_idr": Number(i[24]) == "" ? "0.0" : Number(i[24]), "current_ratio_financial": Number(i[25]) == "" ? "0.00" : Number(i[25]), "current_ratio_current": Number(i[26]) == "" ? "0.00" : Number(i[26]), "der_financial": Number(i[27]) == "" ? "0.00" : Number(i[27]), "der_current": Number(i[28]) == "" ? "0.00" : Number(i[28]), "debt_to_ebitda_financial": Number(i[29]) == "" ? "0.00" : Number(i[29]), "debt_to_ebitda_current": Number(i[30]) == "" ? "0.00" : Number(i[30]), "ebitda_to_interest_financial": Number(i[31]) == "" ? "0.00" : Number(i[31]), "ebitda_to_interest_current": Number(i[32]) == "" ? "0.00" : Number(i[32]), "other_ratio1_ratio_name": i[33], "other_ratio1_financial": Number(i[34]) == "" ? "0.00" : Number(i[34]), "other_ratio1_current": Number(i[35]) == "" ? "0.00" : Number(i[35]), "other_ratio2_ratio_name": i[36], "other_ratio2_financial": Number(i[37]) == "" ? "0.00" : Number(i[37]), "other_ratio2_current": Number(i[38]) == "" ? "0.00" : Number(i[38]), "other_ratio3_ratio_name": i[39], "other_ratio3_financial": Number(i[40]) == "" ? "0.00" : Number(i[40]), "other_ratio3_current": Number(i[41]) == "" ? "0.00" : Number(i[41]), "other_ratio4_ratio_name": i[42], "other_ratio4_financial": Number(i[43]) == "" ? "0.00" : Number(i[43]), "other_ratio4_current": Number(i[44]) == "" ? "0.00" : Number(i[44]), "notes": i[45], }) } else { data.push({ "item_report_id": i[1], "borrower_comp_name": i[5], "bank_name": i[6] == null ? [6] : i[6].value, "type_of_credit": i[7] == null ? i[7] : i[7].value, "remarks": i[8], // "loan_maturity_date": i[9], "loan_maturity_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])), // "loan_maturity_date": i[9] !== undefined || i[9] !== "null" || i[9] !== null? (String(tgl[2]).length <= 2? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])) : "", "interest": i[10] == "" ? "0.00" : i[10], "currency": i[11], "loan_plafond_amount_ori": fixNumber(Number(i[12]), 1) == "" ? "0.0" : fixNumber(Number(i[12]), 1), "loan_plafond_amount_idr": fixNumber(Number(i[13]), 1) == "" ? "0.0" : fixNumber(Number(i[13]), 1), "out_loan_ki_amount_ori": fixNumber(Number(i[14]), 1) == "" ? "0.0" : fixNumber(Number(i[14]), 1), "out_loan_ki_amount_idr": fixNumber(Number(i[15]), 1) == "" ? "0.0" : fixNumber(Number(i[15]), 1), "out_loan_kmk_amount_ori": fixNumber(Number(i[16]), 1) == "" ? "0.0" : fixNumber(Number(i[16]), 1), "out_loan_kmk_amount_idr": fixNumber(Number(i[17]), 1) == "" ? "0.0" : fixNumber(Number(i[17]), 1), // "mtd_vs_previous_month": i[18], "out_loan_other_type": i[18], "out_loan_other_amount_ori": fixNumber(Number(i[19]), 1) == "" ? "0.0" : fixNumber(Number(i[19]), 1), "out_loan_other_amount_idr": fixNumber(Number(i[20]), 1) == "" ? "0.0" : fixNumber(Number(i[20]), 1), "total_out_loan_ori": fixNumber(Number(i[21]), 1) == "" ? "0.0" : fixNumber(Number(i[21]), 1), "total_out_loan_idr": fixNumber(Number(i[22]), 1) == "" ? "0.0" : fixNumber(Number(i[22]), 1), "remaining_plafond_ori": fixNumber(Number(i[23]), 1) == "" ? "0.0" : fixNumber(Number(i[23]), 1), "remaining_plafond_idr": fixNumber(Number(i[24]), 1) == "" ? "0.0" : fixNumber(Number(i[24]), 1), "current_ratio_financial": fixNumber(Number(i[25]), 2) == "" ? "0.00" : fixNumber(Number(i[25]), 2), "current_ratio_current": fixNumber(Number(i[26]), 2) == "" ? "0.00" : fixNumber(Number(i[26]), 2), "der_financial": fixNumber(Number(i[27]), 2) == "" ? "0.00" : fixNumber(Number(i[27]), 2), "der_current": fixNumber(Number(i[28]), 2) == "" ? "0.00" : fixNumber(Number(i[28]), 2), "debt_to_ebitda_financial": fixNumber(Number(i[29]), 2) == "" ? "0.00" : fixNumber(Number(i[29]), 2), "debt_to_ebitda_current": fixNumber(Number(i[30]), 2) == "" ? "0.00" : fixNumber(Number(i[30]), 2), "ebitda_to_interest_financial": fixNumber(Number(i[31]), 2) == "" ? "0.00" : fixNumber(Number(i[31]), 2), "ebitda_to_interest_current": fixNumber(Number(i[32]), 2) == "" ? "0.00" : fixNumber(Number(i[32]), 2), "other_ratio1_ratio_name": i[33], "other_ratio1_financial": fixNumber(Number(i[34]), 2) == "" ? "0.00" : fixNumber(Number(i[34]), 2), "other_ratio1_current": fixNumber(Number(i[35]), 2) == "" ? "0.00" : fixNumber(Number(i[35]), 2), "other_ratio2_ratio_name": i[36], "other_ratio2_financial": fixNumber(Number(i[37]), 2) == "" ? "0.00" : fixNumber(Number(i[37]), 2), "other_ratio2_current": fixNumber(Number(i[38]), 2) == "" ? "0.00" : fixNumber(Number(i[38]), 2), "other_ratio3_ratio_name": i[39], "other_ratio3_financial": fixNumber(Number(i[40]), 2) == "" ? "0.00" : fixNumber(Number(i[40]), 2), "other_ratio3_current": fixNumber(Number(i[41]), 2) == "" ? "0.00" : fixNumber(Number(i[41]), 2), "other_ratio4_ratio_name": i[42], "other_ratio4_financial": fixNumber(Number(i[43]), 2) == "" ? "0.00" : fixNumber(Number(i[43]), 2), "other_ratio4_current": fixNumber(Number(i[44]), 2) == "" ? "0.00" : fixNumber(Number(i[44]), 2), "notes": i[45], }) } } }) let body = { "monthly_report_id": this.props.monthlyReportId, "company_id": this.props.company.company_id, "periode": this.props.periode, "report_id": this.props.report_id, "status": type, "months": this.props.month.month_id, "currency_id": this.props.defaultCurrency.id, "locf": data, "per_bs": this.state.perBSLOCF, "diff": this.state.diffLOCF, "total_loan": this.state.totalLoanLOCF } console.log(body); if (error && type == 'submitted') { this.setState({ handleDoubleClick: 0, saveDraft: false, saveComp: true, loading: false, snekbar: true, snekbarMsg: 'Data Incomplete', handleDoubleClick: 0 }) } else { api.create('UPLOAD').createMonthlyReportLOCF(body).then(response => { console.log(response); if (response.data) { if (response.ok) { if (response.data.status === "success") { this.backToMonthlyReportLOV(type) } else { if (response.data?.message == "Please Set Up Rate Currency First") { this.setState({ visibleAlertSave: true }) } else { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) { setTimeout(() => { localStorage.removeItem(Constant.TOKEN) window.location.reload(); }, 1000); } }) } // alert(response.data.status) } } else { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false, handleDoubleClick: 0 }) } } else { this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false, handleDoubleClick: 0 }) } this.setState({ handleDoubleClick: 0 }) }) } } backToMonthlyReportLOV(type) { console.log('masoook LOV'); let dataTable2 = this.state.dataTablelov == undefined || this.state.tambahLOV == 'tambah' || this.state.tambahLOV == 'upload' ? this.state.dataTableLOV : this.state.dataTablelov let data = [] let error = false // this.deleteReport() console.log(dataTable2); dataTable2.map(i => { if (i[0] == 3) { if (i[6] == null || i[7] == null || i[8] == "" || i[9] == "" || i[10] == "" || i[11] == "" || i[12] == "") { error = true } if (i[8] == '' && i[7]?.value == 'Time deposit' || i[7]?.value == 'N/A') { error = true } let tgl = String(i[9]).split('-') let checkUndifined = tgl.findIndex((val) => val == undefined) if (this.props.defaultCurrency.id == 2) { data.push({ "item_report_id": i[1], "company_name": i[5], "institution_name": i[6], "type_of_investment": i[7] == null ? i[7] : i[7].value, "remarks": i[8], "placement_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])), "tenor": i[10], "expected_return": i[11] == "" ? "0.00" : i[11], "currency": i[12] == null ? i[12] : i[12].value, "investment_amount_ori": Number(i[13]) == "" ? "0.0" : Number(i[13]), "investment_amount_cur": Number(i[14]) == "" ? "0.0" : Number(i[14]), "notes": i[15], }) } else { data.push({ "item_report_id": i[1], "company_name": i[5], "institution_name": i[6], "type_of_investment": i[7] == null ? i[7] : i[7].value, "remarks": i[8], "placement_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])), "tenor": i[10], "expected_return": i[11] == "" ? "0.00" : i[11], "currency": i[12] == null ? i[12] : i[12].value, "investment_amount_ori": Number(i[13]) == "" ? "0.0" : Number(i[13]), "investment_amount_cur": Number(i[14]) == "" ? "0.0" : Number(i[14]), "notes": i[15], }) } } }) let body = { "monthly_report_id": this.props.monthlyReportId, "company_id": this.props.company.company_id, "periode": this.props.periode, "report_id": this.props.report_id, "status": type, "months": this.props.month.month_id, "currency_id": this.props.defaultCurrency.id, "lov": data, "per_bs": this.state.perBSLOV, "diff": this.state.diffLOV, "total_loan": this.state.totalLoanLOV } console.log(body); if (error && type == 'submitted') { this.setState({ handleDoubleClick: 0, saveDraft: false, saveComp: true, loading: false, snekbar: true, snekbarMsg: 'Data Incomplete', handleDoubleClick: 0 }) } else { api.create('UPLOAD').createMonthlyReportLOV(body).then(response => { console.log(response); if (response.data) { if (response.ok) { if (response.data.status === "success") { this.props.saveToMonthlyReport('LOCF') this.setState({ loadingChild : false}) } else { if (response.data?.message == "Please Set Up Rate Currency First") { this.setState({ visibleAlertSave: true }) } else { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) { setTimeout(() => { localStorage.removeItem(Constant.TOKEN) window.location.reload(); }, 1000); } }) } // alert(response.data.status) } } else { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false, handleDoubleClick: 0 }) } } else { this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false, handleDoubleClick: 0 }) } this.setState({ handleDoubleClick: 0 }) }) } } handleCalculateLOCF = () => { this.setState({ loading: true }) let dataTable2 = this.state.dataTablelocf == undefined || this.state.tambah == 'tambah' || this.state.tambah == 'upload' ? this.state.dataTableLOCF : this.state.dataTablelocf let data = [] let error = false let bankNameEmpty = false dataTable2.map(i => { if (i[6] == null) { bankNameEmpty = true } if (i[0] == 3) { if (i[6] == null || i[7] == null || i[8] == "" || i[9] == "" || i[10] == "" || i[11] == "") { error = true } if (i[7].value == 'Others' && i[18] == '') { error = true } let tgl = String(i[9]).split('-') let checkUndifined = tgl.findIndex((val) => val == undefined) if (this.props.defaultCurrency.id == 2) { data.push({ "item_report_id": i[1], "borrower_comp_name": i[5], "bank_name": i[6] == null ? [6] : i[6].value, "type_of_credit": i[7] == null ? i[7] : i[7].value, "remarks": i[8], "loan_maturity_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])), "interest": i[10] == "" ? "0.00" : i[10], "currency": i[11], "loan_plafond_amount_ori": Number(i[12]) == "" ? "0.0" : Number(i[12]), "loan_plafond_amount_idr": Number(i[13]) == "" ? "0.0" : Number(i[13]), "out_loan_ki_amount_ori": Number(i[14]) == "" ? "0.0" : Number(i[14]), "out_loan_ki_amount_idr": Number(i[15]) == "" ? "0.0" : Number(i[15]), "out_loan_kmk_amount_ori": Number(i[16]) == "" ? "0.0" : Number(i[16]), "out_loan_kmk_amount_idr": Number(i[17]) == "" ? "0.0" : Number(i[17]), "out_loan_other_type": i[18], "out_loan_other_amount_ori": Number(i[19]) == "" ? "0.0" : Number(i[19]), "out_loan_other_amount_idr": Number(i[20]) == "" ? "0.0" : Number(i[20]), "total_out_loan_ori": Number(i[21]) == "" ? "0.0" : Number(i[21]), "total_out_loan_idr": Number(i[22]) == "" ? "0.0" : Number(i[22]), "remaining_plafond_ori": Number(i[23]) == "" ? "0.0" : Number(i[23]), "remaining_plafond_idr": Number(i[24]) == "" ? "0.0" : Number(i[24]), "current_ratio_financial": Number(i[25]) == "" ? "0.00" : Number(i[25]), "current_ratio_current": Number(i[26]) == "" ? "0.00" : Number(i[26]), "der_financial": Number(i[27]) == "" ? "0.00" : Number(i[27]), "der_current": Number(i[28]) == "" ? "0.00" : Number(i[28]), "debt_to_ebitda_financial": Number(i[29]) == "" ? "0.00" : Number(i[29]), "debt_to_ebitda_current": Number(i[30]) == "" ? "0.00" : Number(i[30]), "ebitda_to_interest_financial": Number(i[31]) == "" ? "0.00" : Number(i[31]), "ebitda_to_interest_current": Number(i[32]) == "" ? "0.00" : Number(i[32]), "other_ratio1_ratio_name": i[33], "other_ratio1_financial": Number(i[34]) == "" ? "0.00" : Number(i[34]), "other_ratio1_current": Number(i[35]) == "" ? "0.00" : Number(i[35]), "other_ratio2_ratio_name": i[36], "other_ratio2_financial": Number(i[37]) == "" ? "0.00" : Number(i[37]), "other_ratio2_current": Number(i[38]) == "" ? "0.00" : Number(i[38]), "other_ratio3_ratio_name": i[39], "other_ratio3_financial": Number(i[40]) == "" ? "0.00" : Number(i[40]), "other_ratio3_current": Number(i[41]) == "" ? "0.00" : Number(i[41]), "other_ratio4_ratio_name": i[42], "other_ratio4_financial": Number(i[43]) == "" ? "0.00" : Number(i[43]), "other_ratio4_current": Number(i[44]) == "" ? "0.00" : Number(i[44]), "notes": i[45], }) } else { data.push({ "item_report_id": i[1], "borrower_comp_name": i[5], "bank_name": i[6] == null ? [6] : i[6].value, "type_of_credit": i[7] == null ? i[7] : i[7].value, "remarks": i[8], "loan_maturity_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])), "interest": i[10] == "" ? "0.00" : i[10], "currency": i[11], "loan_plafond_amount_ori": fixNumber(Number(i[12]), 1) == "" ? "0.0" : fixNumber(Number(i[12]), 1), "loan_plafond_amount_idr": fixNumber(Number(i[13]), 1) == "" ? "0.0" : fixNumber(Number(i[13]), 1), "out_loan_ki_amount_ori": fixNumber(Number(i[14]), 1) == "" ? "0.0" : fixNumber(Number(i[14]), 1), "out_loan_ki_amount_idr": fixNumber(Number(i[15]), 1) == "" ? "0.0" : fixNumber(Number(i[15]), 1), "out_loan_kmk_amount_ori": fixNumber(Number(i[16]), 1) == "" ? "0.0" : fixNumber(Number(i[16]), 1), "out_loan_kmk_amount_idr": fixNumber(Number(i[17]), 1) == "" ? "0.0" : fixNumber(Number(i[17]), 1), "out_loan_other_type": i[18], "out_loan_other_amount_ori": fixNumber(Number(i[19]), 1) == "" ? "0.0" : fixNumber(Number(i[19]), 1), "out_loan_other_amount_idr": fixNumber(Number(i[20]), 1) == "" ? "0.0" : fixNumber(Number(i[20]), 1), "total_out_loan_ori": fixNumber(Number(i[21]), 1) == "" ? "0.0" : fixNumber(Number(i[21]), 1), "total_out_loan_idr": fixNumber(Number(i[22]), 1) == "" ? "0.0" : fixNumber(Number(i[22]), 1), "remaining_plafond_ori": fixNumber(Number(i[23]), 1) == "" ? "0.0" : fixNumber(Number(i[23]), 1), "remaining_plafond_idr": fixNumber(Number(i[24]), 1) == "" ? "0.0" : fixNumber(Number(i[24]), 1), "current_ratio_financial": fixNumber(Number(i[25]), 2) == "" ? "0.00" : fixNumber(Number(i[25]), 2), "current_ratio_current": fixNumber(Number(i[26]), 2) == "" ? "0.00" : fixNumber(Number(i[26]), 2), "der_financial": fixNumber(Number(i[27]), 2) == "" ? "0.00" : fixNumber(Number(i[27]), 2), "der_current": fixNumber(Number(i[28]), 2) == "" ? "0.00" : fixNumber(Number(i[28]), 2), "debt_to_ebitda_financial": fixNumber(Number(i[29]), 2) == "" ? "0.00" : fixNumber(Number(i[29]), 2), "debt_to_ebitda_current": fixNumber(Number(i[30]), 2) == "" ? "0.00" : fixNumber(Number(i[30]), 2), "ebitda_to_interest_financial": fixNumber(Number(i[31]), 2) == "" ? "0.00" : fixNumber(Number(i[31]), 2), "ebitda_to_interest_current": fixNumber(Number(i[32]), 2) == "" ? "0.00" : fixNumber(Number(i[32]), 2), "other_ratio1_ratio_name": i[33], "other_ratio1_financial": fixNumber(Number(i[34]), 2) == "" ? "0.00" : fixNumber(Number(i[34]), 2), "other_ratio1_current": fixNumber(Number(i[35]), 2) == "" ? "0.00" : fixNumber(Number(i[35]), 2), "other_ratio2_ratio_name": i[36], "other_ratio2_financial": fixNumber(Number(i[37]), 2) == "" ? "0.00" : fixNumber(Number(i[37]), 2), "other_ratio2_current": fixNumber(Number(i[38]), 2) == "" ? "0.00" : fixNumber(Number(i[38]), 2), "other_ratio3_ratio_name": i[39], "other_ratio3_financial": fixNumber(Number(i[40]), 2) == "" ? "0.00" : fixNumber(Number(i[40]), 2), "other_ratio3_current": fixNumber(Number(i[41]), 2) == "" ? "0.00" : fixNumber(Number(i[41]), 2), "other_ratio4_ratio_name": i[42], "other_ratio4_financial": fixNumber(Number(i[43]), 2) == "" ? "0.00" : fixNumber(Number(i[43]), 2), "other_ratio4_current": fixNumber(Number(i[44]), 2) == "" ? "0.00" : fixNumber(Number(i[44]), 2), "notes": i[45], }) } } }) let body = { "monthly_report_id": this.props.monthlyReportId, "company_id": this.props.company.company_id, "periode": this.props.periode, "report_id": this.props.report_id, "status": 'submitted', "months": this.props.month.month_id, "currency_id": this.props.defaultCurrency.id, "locf": data, "per_bs": this.state.perBSLOCF, "diff": this.state.diffLOCF, "total_loan": this.state.totalLoanLOCF } console.log(body); api.create().validateSaveLOCF(body).then((response) => { console.log(response); let dataTablelocf = [] if (response.data) { let res = response.data.data const handlePushChild = (item) => { let indexIDzz = dataTablelocf.findIndex((val) => val[1] === item.id) let tgl = String(item.locf.loan_maturity_date).split('-') if (indexIDzz === -1) { dataTablelocf.push([ item.type_report_id, item.id, item.parent, item.formula, item.level, String(item.locf.bank_name).includes('Total') ? null : item.locf.borrower_comp_name === null || item.locf.borrower_comp_name === "" ? this.props.company.company_name : item.locf.borrower_comp_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.remarks === null || item.locf.remarks === "" ? "" : item.locf.remarks, 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.currency === null || item.locf.currency === "" ? "" : item.locf.currency, item.locf.loan_plafond_amount_ori, item.locf.loan_plafond_amount_idr === null ? "0.0" : item.locf.loan_plafond_amount_idr === "" ? "0.0" : item.locf.loan_plafond_amount_idr, item.locf.out_loan_ki_amount_ori, item.locf.out_loan_ki_amount_idr === null ? "0.0" : item.locf.out_loan_ki_amount_idr === "" ? "0.0" : item.locf.out_loan_ki_amount_idr, item.locf.out_loan_kmk_amount_ori, item.locf.out_loan_kmk_amount_idr === null ? "0.0" : item.locf.out_loan_kmk_amount_idr === "" ? "0.0" : item.locf.out_loan_kmk_amount_idr, item.locf.out_loan_other_type, item.locf.out_loan_other_amount_ori, item.locf.out_loan_other_amount_idr === null ? "0.0" : item.locf.out_loan_other_amount_idr === "" ? "0.0" : item.locf.out_loan_other_amount_idr, item.locf.total_out_loan_ori === null ? "0.0" : item.locf.total_out_loan_ori === "" ? "0.0" : item.locf.total_out_loan_ori, item.locf.total_out_loan_idr === null ? "0.0" : item.locf.total_out_loan_idr === "" ? "0.0" : item.locf.total_out_loan_idr, item.locf.remaining_plafond_ori === null ? "0.0" : item.locf.remaining_plafond_ori === "" ? "0.0" : item.locf.remaining_plafond_ori, item.locf.remaining_plafond_idr === null ? "0.0" : item.locf.remaining_plafond_idr === "" ? "0.0" : item.locf.remaining_plafond_idr, item.locf.current_ratio_financial, item.locf.current_ratio_current === null ? "0.0" : item.locf.current_ratio_current === "" ? "0.0" : item.locf.current_ratio_current, item.locf.der_financial, item.locf.der_current === null ? "0.0" : item.locf.der_current === "" ? "0.0" : item.locf.der_current, item.locf.debt_to_ebitda_financial, item.locf.debt_to_ebitda_current === null ? "0.0" : item.locf.debt_to_ebitda_current === "" ? "0.0" : item.locf.debt_to_ebitda_current, item.locf.ebitda_to_interest_financial, item.locf.ebitda_to_interest_current === null ? "0.0" : item.locf.ebitda_to_interest_current === "" ? "0.0" : item.locf.ebitda_to_interest_current, item.locf.other_ratio1_ratio_name, item.locf.other_ratio1_financial, item.locf.other_ratio1_current === null ? "0.0" : item.locf.other_ratio1_current === "" ? "0.0" : item.locf.other_ratio1_current, item.locf.other_ratio2_ratio_name, item.locf.other_ratio2_financial, item.locf.other_ratio2_current === null ? "0.0" : item.locf.other_ratio2_current === "" ? "0.0" : item.locf.other_ratio2_current, item.locf.other_ratio3_ratio_name, item.locf.other_ratio3_financial, item.locf.other_ratio3_current === null ? "0.0" : item.locf.other_ratio3_current === "" ? "0.0" : item.locf.other_ratio3_current, item.locf.other_ratio4_ratio_name, item.locf.other_ratio4_financial, item.locf.other_ratio4_current === null ? "0.0" : item.locf.other_ratio4_current === "" ? "0.0" : item.locf.other_ratio4_current, item.locf.notes, item.diff, item.total_loan, item.per_bs // index ]) } if (item.children !== null) { if (item.children.length > 0) { item.children.map((items, indexs) => { handlePushChild(items) }) } } } res.map((item, index) => { let tgl = String(item.locf.loan_maturity_date).split('-') dataTablelocf.push([ item.type_report_id, item.id, item.parent, item.formula, item.level, String(item.locf.bank_name).includes('Total') ? null : item.locf.borrower_comp_name === null || item.locf.borrower_comp_name === "" ? this.props.company.company_name : item.locf.borrower_comp_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.remarks === null || item.locf.remarks === "" ? "" : item.locf.remarks, 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.currency === null || item.locf.currency === "" ? "" : item.locf.currency, item.locf.loan_plafond_amount_ori, item.locf.loan_plafond_amount_idr === null ? "0.0" : item.locf.loan_plafond_amount_idr === "" ? "0.0" : item.locf.loan_plafond_amount_idr, item.locf.out_loan_ki_amount_ori, item.locf.out_loan_ki_amount_idr === null ? "0.0" : item.locf.out_loan_ki_amount_idr === "" ? "0.0" : item.locf.out_loan_ki_amount_idr, item.locf.out_loan_kmk_amount_ori, item.locf.out_loan_kmk_amount_idr === null ? "0.0" : item.locf.out_loan_kmk_amount_idr === "" ? "0.0" : item.locf.out_loan_kmk_amount_idr, item.locf.out_loan_other_type, item.locf.out_loan_other_amount_ori, item.locf.out_loan_other_amount_idr === null ? "0.0" : item.locf.out_loan_other_amount_idr === "" ? "0.0" : item.locf.out_loan_other_amount_idr, item.locf.total_out_loan_ori === null ? "0.0" : item.locf.total_out_loan_ori === "" ? "0.0" : item.locf.total_out_loan_ori, item.locf.total_out_loan_idr === null ? "0.0" : item.locf.total_out_loan_idr === "" ? "0.0" : item.locf.total_out_loan_idr, item.locf.remaining_plafond_ori === null ? "0.0" : item.locf.remaining_plafond_ori === "" ? "0.0" : item.locf.remaining_plafond_ori, item.locf.remaining_plafond_idr === null ? "0.0" : item.locf.remaining_plafond_idr === "" ? "0.0" : item.locf.remaining_plafond_idr, item.locf.current_ratio_financial, item.locf.current_ratio_current === null ? "0.0" : item.locf.current_ratio_current === "" ? "0.0" : item.locf.current_ratio_current, item.locf.der_financial, item.locf.der_current === null ? "0.0" : item.locf.der_current === "" ? "0.0" : item.locf.der_current, item.locf.debt_to_ebitda_financial, item.locf.debt_to_ebitda_current === null ? "0.0" : item.locf.debt_to_ebitda_current === "" ? "0.0" : item.locf.debt_to_ebitda_current, item.locf.ebitda_to_interest_financial, item.locf.ebitda_to_interest_current === null ? "0.0" : item.locf.ebitda_to_interest_current === "" ? "0.0" : item.locf.ebitda_to_interest_current, item.locf.other_ratio1_ratio_name, item.locf.other_ratio1_financial, item.locf.other_ratio1_current === null ? "0.0" : item.locf.other_ratio1_current === "" ? "0.0" : item.locf.other_ratio1_current, item.locf.other_ratio2_ratio_name, item.locf.other_ratio2_financial, item.locf.other_ratio2_current === null ? "0.0" : item.locf.other_ratio2_current === "" ? "0.0" : item.locf.other_ratio2_current, item.locf.other_ratio3_ratio_name, item.locf.other_ratio3_financial, item.locf.other_ratio3_current === null ? "0.0" : item.locf.other_ratio3_current === "" ? "0.0" : item.locf.other_ratio3_current, item.locf.other_ratio4_ratio_name, item.locf.other_ratio4_financial, item.locf.other_ratio4_current === null ? "0.0" : item.locf.other_ratio4_current === "" ? "0.0" : item.locf.other_ratio4_current, item.locf.notes, item.diff, item.total_loan, item.per_bs // index ]) if (item.children !== null) { if (item.children.length > 0) { item.children.map((items, indexs) => { handlePushChild(items) }) } } }) let lastArrayLOCF = dataTablelocf[res.length - 1] if (bankNameEmpty) { if (this.state.get_for == 'view') { this.setState({ saveDraft: false, saveComp: true }) } else { this.setState({ saveDraft: false, saveComp: true }) } } else { if (this.state.get_for == 'view') { console.log("view"); } else { this.setState({ saveDraft: false, saveComp: lastArrayLOCF[46] == 0 || lastArrayLOCF[46] == '0.0' || lastArrayLOCF[46] == "-0.0" ? false : true }) } } this.setState({ dataTablelocf, diffLOCF: lastArrayLOCF[46], totalLoanLOCF: lastArrayLOCF[47], perBSLOCF: lastArrayLOCF[48], loading: false }, () => { this.handleCalculateLOV() }) } }) } handleCalculateLOV = () => { this.setState({ loading: true }) let dataTable2 = this.state.dataTablelov == undefined || this.state.tambahLOV == 'tambah' || this.state.tambahLOV == 'upload' ? this.state.dataTableLOV : this.state.dataTablelov let data = [] let error = false let bankNameEmpty = false console.log(dataTable2); dataTable2.map(i => { if (i[6] == null) { bankNameEmpty = true } if (i[0] == 3) { if (i[6] == null || i[7] == null || i[8] == "" || i[9] == "" || i[10] == "" || i[11] == "" || i[12] == "") { error = true } if (i[8] == '' && i[7]?.value == 'Time deposit' || i[7]?.value == 'N/A') { error = true } let tgl = String(i[9]).split('-') let checkUndifined = tgl.findIndex((val) => val == undefined) if (this.props.defaultCurrency.id == 2) { data.push({ "item_report_id": i[1], "company_name": i[5], "institution_name": i[6], "type_of_investment": i[7] == null ? i[7] : i[7].value, "remarks": i[8], "placement_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])), "tenor": i[10], "expected_return": i[11] == "" ? "0.00" : i[11], "currency": i[12] == null ? i[12] : i[12].value, "investment_amount_ori": Number(i[13]) == "" ? "0.0" : Number(i[13]), "investment_amount_cur": Number(i[14]) == "" ? "0.0" : Number(i[14]), "notes": i[15], }) } else { data.push({ "item_report_id": i[1], "company_name": i[5], "institution_name": i[6], "type_of_investment": i[7] == null ? i[7] : i[7].value, "remarks": i[8], "placement_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])), "tenor": i[10], "expected_return": i[11] == "" ? "0.00" : i[11], "currency": i[12] == null ? i[12] : i[12].value, "investment_amount_ori": Number(i[13]) == "" ? "0.0" : Number(i[13]), "investment_amount_cur": Number(i[14]) == "" ? "0.0" : Number(i[14]), "notes": i[15], }) } } }) let body = { "monthly_report_id": this.props.monthlyReportId, "company_id": this.props.company.company_id, "periode": this.props.periode, "report_id": this.props.report_id, "status": 'submitted', "months": this.props.month.month_id, "currency_id": this.props.defaultCurrency.id, "lov": data, "per_bs": this.state.perBSLOV, "diff": this.state.diffLOV, "total_loan": this.state.totalLoanLOV } console.log(body); api.create().validateSaveLOV(body).then((response) => { console.log(response); let dataTablelov = [] if (response.data) { let res = response.data.data const handlePushChild = (item) => { let indexIDzz = dataTablelov.findIndex((val) => val[1] === item.id) let tgl = String(item.lov.placement_date).split('-') if (indexIDzz === -1) { dataTablelov.push([ item.type_report_id, item.id, item.parent, item.formula, item.level, String(item.lov.institution_name).includes('Total') ? null : item.lov.company_name === null || item.lov.company_name === "" ? this.props.company.company_name : item.lov.company_name, item.lov.institution_name === null || item.lov.institution_name === "" ? "" : item.lov.institution_name, item.lov.type_of_investment === null ? null : item.lov.type_of_investment === "" ? null : { value: item.lov.type_of_investment }, item.lov.remarks === null || item.lov.remarks === "" ? "" : item.lov.remarks, item.lov.placement_date == null || item.lov.placement_date == "" ? null : (item.lov.placement_date !== "null" ? String(tgl[2]).length > 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(item.lov.placement_date) : null), item.lov.tenor === null || item.lov.tenor === "" ? "" : item.lov.tenor, item.lov.expected_return === null || item.lov.expected_return === "" ? "0.0" : item.lov.expected_return, item.lov.currency === null ? null : item.lov.currency === "" ? null : { value: item.lov.currency }, item.lov.investment_amount_ori === null ? "0.0" : item.lov.investment_amount_ori === "" ? "0.0" : item.lov.investment_amount_ori, item.lov.investment_amount_cur === null ? "0.0" : item.lov.investment_amount_cur === "" ? "0.0" : item.lov.investment_amount_cur, item.lov.notes, item.diff, item.total_loan, item.per_bs // index ]) } if (item.children !== null) { if (item.children.length > 0) { item.children.map((items, indexs) => { handlePushChild(items) }) } } } res.map((item, index) => { let tgl = String(item.lov.placement_date).split('-') dataTablelov.push([ item.type_report_id, item.id, item.parent, item.formula, item.level, String(item.lov.institution_name).includes('Total') ? null : item.lov.company_name === null || item.lov.company_name === "" ? this.props.company.company_name : item.lov.company_name, item.lov.institution_name === null || item.lov.institution_name === "" ? "" : item.lov.institution_name, item.lov.type_of_investment === null ? null : item.lov.type_of_investment === "" ? null : { value: item.lov.type_of_investment }, item.lov.remarks === null || item.lov.remarks === "" ? "" : item.lov.remarks, item.lov.placement_date == null || item.lov.placement_date == "" ? null : (item.lov.placement_date !== "null" ? String(tgl[2]).length > 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(item.lov.placement_date) : null), item.lov.tenor === null || item.lov.tenor === "" ? "" : item.lov.tenor, item.lov.expected_return === null || item.lov.expected_return === "" ? "0.0" : item.lov.expected_return, item.lov.currency === null ? null : item.lov.currency === "" ? null : { value: item.lov.currency }, item.lov.investment_amount_ori === null ? "0.0" : item.lov.investment_amount_ori === "" ? "0.0" : item.lov.investment_amount_ori, item.lov.investment_amount_cur === null ? "0.0" : item.lov.investment_amount_cur === "" ? "0.0" : item.lov.investment_amount_cur, item.lov.notes, item.diff, item.total_loan, item.per_bs // index ]) if (item.children !== null) { if (item.children.length > 0) { item.children.map((items, indexs) => { handlePushChild(items) }) } } }) let lastArrayLOV = dataTablelov[res.length - 1] if (bankNameEmpty) { if (this.state.get_for == 'view') { this.setState({ saveDraft: false, saveCompLOV: true }) } else { this.setState({ saveDraft: false, saveCompLOV: true }) } } else { if (this.state.get_for == 'view') { console.log("view"); } else { this.setState({ saveDraft: false, saveCompLOV: lastArrayLOV[16] == 0 || lastArrayLOV[16] == '0.0' || lastArrayLOV[16] == "-0.0" ? false : true }) } } this.setState({ dataTablelov, diffLOV: lastArrayLOV[16], totalLoanLOV: lastArrayLOV[17], perBSLOV: lastArrayLOV[18], loading: false, loadingChild: false }, () => { // this.handleCalculateLOV() }) } else { this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false }) } }) } uploadLOCF(type) { console.log('masoook LOCF'); let dataTable2 = this.state.dataTablelocf == undefined || this.state.tambah == 'tambah' || this.state.tambah == 'upload' ? this.state.dataTableLOCF : this.state.dataTablelocf let data = [] let error = false // this.deleteReport() console.log(dataTable2); dataTable2.map(i => { if (i[0] == 3) { if (i[6] == null || i[7] == null || i[8] == "" || i[9] == "" || i[10] == "" || i[11] == "") { error = true } if (i[7].value == 'Others' && i[18] == '') { error = true } let tgl = String(i[9]).split('-') let checkUndifined = tgl.findIndex((val) => val == undefined) if (this.props.defaultCurrency.id == 2) { data.push({ "item_report_id": i[1], "borrower_comp_name": i[5], "bank_name": i[6] == null ? [6] : i[6].value, "type_of_credit": i[7] == null ? i[7] : i[7].value, "remarks": i[8], // "loan_maturity_date": i[9], "loan_maturity_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])), // "loan_maturity_date": i[9] !== undefined || i[9] !== "null" || i[9] !== null? (String(tgl[2]).length <= 2? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])) : "", "interest": i[10] == "" ? "0.00" : i[10], "currency": i[11], "loan_plafond_amount_ori": Number(i[12]) == "" ? "0.0" : Number(i[12]), "loan_plafond_amount_idr": Number(i[13]) == "" ? "0.0" : Number(i[13]), "out_loan_ki_amount_ori": Number(i[14]) == "" ? "0.0" : Number(i[14]), "out_loan_ki_amount_idr": Number(i[15]) == "" ? "0.0" : Number(i[15]), "out_loan_kmk_amount_ori": Number(i[16]) == "" ? "0.0" : Number(i[16]), "out_loan_kmk_amount_idr": Number(i[17]) == "" ? "0.0" : Number(i[17]), // "mtd_vs_previous_month": i[18], "out_loan_other_type": i[18], "out_loan_other_amount_ori": Number(i[19]) == "" ? "0.0" : Number(i[19]), "out_loan_other_amount_idr": Number(i[20]) == "" ? "0.0" : Number(i[20]), "total_out_loan_ori": Number(i[21]) == "" ? "0.0" : Number(i[21]), "total_out_loan_idr": Number(i[22]) == "" ? "0.0" : Number(i[22]), "remaining_plafond_ori": Number(i[23]) == "" ? "0.0" : Number(i[23]), "remaining_plafond_idr": Number(i[24]) == "" ? "0.0" : Number(i[24]), "current_ratio_financial": Number(i[25]) == "" ? "0.00" : Number(i[25]), "current_ratio_current": Number(i[26]) == "" ? "0.00" : Number(i[26]), "der_financial": Number(i[27]) == "" ? "0.00" : Number(i[27]), "der_current": Number(i[28]) == "" ? "0.00" : Number(i[28]), "debt_to_ebitda_financial": Number(i[29]) == "" ? "0.00" : Number(i[29]), "debt_to_ebitda_current": Number(i[30]) == "" ? "0.00" : Number(i[30]), "ebitda_to_interest_financial": Number(i[31]) == "" ? "0.00" : Number(i[31]), "ebitda_to_interest_current": Number(i[32]) == "" ? "0.00" : Number(i[32]), "other_ratio1_ratio_name": i[33], "other_ratio1_financial": Number(i[34]) == "" ? "0.00" : Number(i[34]), "other_ratio1_current": Number(i[35]) == "" ? "0.00" : Number(i[35]), "other_ratio2_ratio_name": i[36], "other_ratio2_financial": Number(i[37]) == "" ? "0.00" : Number(i[37]), "other_ratio2_current": Number(i[38]) == "" ? "0.00" : Number(i[38]), "other_ratio3_ratio_name": i[39], "other_ratio3_financial": Number(i[40]) == "" ? "0.00" : Number(i[40]), "other_ratio3_current": Number(i[41]) == "" ? "0.00" : Number(i[41]), "other_ratio4_ratio_name": i[42], "other_ratio4_financial": Number(i[43]) == "" ? "0.00" : Number(i[43]), "other_ratio4_current": Number(i[44]) == "" ? "0.00" : Number(i[44]), "notes": i[45], }) } else { data.push({ "item_report_id": i[1], "borrower_comp_name": i[5], "bank_name": i[6] == null ? [6] : i[6].value, "type_of_credit": i[7] == null ? i[7] : i[7].value, "remarks": i[8], // "loan_maturity_date": i[9], "loan_maturity_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])), // "loan_maturity_date": i[9] !== undefined || i[9] !== "null" || i[9] !== null? (String(tgl[2]).length <= 2? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])) : "", "interest": i[10] == "" ? "0.00" : i[10], "currency": i[11], "loan_plafond_amount_ori": fixNumber(Number(i[12]), 1) == "" ? "0.0" : fixNumber(Number(i[12]), 1), "loan_plafond_amount_idr": fixNumber(Number(i[13]), 1) == "" ? "0.0" : fixNumber(Number(i[13]), 1), "out_loan_ki_amount_ori": fixNumber(Number(i[14]), 1) == "" ? "0.0" : fixNumber(Number(i[14]), 1), "out_loan_ki_amount_idr": fixNumber(Number(i[15]), 1) == "" ? "0.0" : fixNumber(Number(i[15]), 1), "out_loan_kmk_amount_ori": fixNumber(Number(i[16]), 1) == "" ? "0.0" : fixNumber(Number(i[16]), 1), "out_loan_kmk_amount_idr": fixNumber(Number(i[17]), 1) == "" ? "0.0" : fixNumber(Number(i[17]), 1), // "mtd_vs_previous_month": i[18], "out_loan_other_type": i[18], "out_loan_other_amount_ori": fixNumber(Number(i[19]), 1) == "" ? "0.0" : fixNumber(Number(i[19]), 1), "out_loan_other_amount_idr": fixNumber(Number(i[20]), 1) == "" ? "0.0" : fixNumber(Number(i[20]), 1), "total_out_loan_ori": fixNumber(Number(i[21]), 1) == "" ? "0.0" : fixNumber(Number(i[21]), 1), "total_out_loan_idr": fixNumber(Number(i[22]), 1) == "" ? "0.0" : fixNumber(Number(i[22]), 1), "remaining_plafond_ori": fixNumber(Number(i[23]), 1) == "" ? "0.0" : fixNumber(Number(i[23]), 1), "remaining_plafond_idr": fixNumber(Number(i[24]), 1) == "" ? "0.0" : fixNumber(Number(i[24]), 1), "current_ratio_financial": fixNumber(Number(i[25]), 2) == "" ? "0.00" : fixNumber(Number(i[25]), 2), "current_ratio_current": fixNumber(Number(i[26]), 2) == "" ? "0.00" : fixNumber(Number(i[26]), 2), "der_financial": fixNumber(Number(i[27]), 2) == "" ? "0.00" : fixNumber(Number(i[27]), 2), "der_current": fixNumber(Number(i[28]), 2) == "" ? "0.00" : fixNumber(Number(i[28]), 2), "debt_to_ebitda_financial": fixNumber(Number(i[29]), 2) == "" ? "0.00" : fixNumber(Number(i[29]), 2), "debt_to_ebitda_current": fixNumber(Number(i[30]), 2) == "" ? "0.00" : fixNumber(Number(i[30]), 2), "ebitda_to_interest_financial": fixNumber(Number(i[31]), 2) == "" ? "0.00" : fixNumber(Number(i[31]), 2), "ebitda_to_interest_current": fixNumber(Number(i[32]), 2) == "" ? "0.00" : fixNumber(Number(i[32]), 2), "other_ratio1_ratio_name": i[33], "other_ratio1_financial": fixNumber(Number(i[34]), 2) == "" ? "0.00" : fixNumber(Number(i[34]), 2), "other_ratio1_current": fixNumber(Number(i[35]), 2) == "" ? "0.00" : fixNumber(Number(i[35]), 2), "other_ratio2_ratio_name": i[36], "other_ratio2_financial": fixNumber(Number(i[37]), 2) == "" ? "0.00" : fixNumber(Number(i[37]), 2), "other_ratio2_current": fixNumber(Number(i[38]), 2) == "" ? "0.00" : fixNumber(Number(i[38]), 2), "other_ratio3_ratio_name": i[39], "other_ratio3_financial": fixNumber(Number(i[40]), 2) == "" ? "0.00" : fixNumber(Number(i[40]), 2), "other_ratio3_current": fixNumber(Number(i[41]), 2) == "" ? "0.00" : fixNumber(Number(i[41]), 2), "other_ratio4_ratio_name": i[42], "other_ratio4_financial": fixNumber(Number(i[43]), 2) == "" ? "0.00" : fixNumber(Number(i[43]), 2), "other_ratio4_current": fixNumber(Number(i[44]), 2) == "" ? "0.00" : fixNumber(Number(i[44]), 2), "notes": i[45], }) } } }) let body = { "monthly_report_id": this.props.monthlyReportId, "company_id": this.props.company.company_id, "periode": this.props.periode, "report_id": this.props.report_id, "status": type, "months": this.props.month.month_id, "currency_id": this.props.defaultCurrency.id, "locf": data, "per_bs": this.state.perBSLOCF, "diff": this.state.diffLOCF, "total_loan": this.state.totalLoanLOCF } console.log(body); if (error && type == 'submitted') { this.setState({ handleDoubleClick: 0, saveDraft: false, saveComp: true, loading: false, snekbar: true, snekbarMsg: 'Data Incomplete', handleDoubleClick: 0 }) } else { api.create('UPLOAD').uploadMonthlyReportLOCF(body).then(response => { console.log(response); if (response.data) { if (response.ok) { if (response.data.status === "success") { this.uploadLOV(type) // this.props.saveToMonthlyReport('LOCF') // this.props.onClickClose() // this.props.getReport() } else { if (response.data?.message == "Please Set Up Rate Currency First") { this.setState({ visibleAlertSave: true }) } else { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) { setTimeout(() => { localStorage.removeItem(Constant.TOKEN) window.location.reload(); }, 1000); } }) } // alert(response.data.status) } } else { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false, handleDoubleClick: 0 }) } } else { this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false, handleDoubleClick: 0 }) } this.setState({ handleDoubleClick: 0 }) }) } } uploadLOV(type) { console.log('masoook LOV'); let dataTable2 = this.state.dataTablelov == undefined || this.state.tambahLOV == 'tambah' || this.state.tambahLOV == 'upload' ? this.state.dataTableLOV : this.state.dataTablelov let data = [] let error = false // this.deleteReport() console.log(dataTable2); dataTable2.map(i => { if (i[0] == 3) { if (i[6] == null || i[7] == null || i[8] == "" || i[9] == "" || i[10] == "" || i[11] == "" || i[12] == "") { error = true } if (i[8] == '' && i[7]?.value == 'Time deposit' || i[7]?.value == 'N/A') { error = true } let tgl = String(i[9]).split('-') let checkUndifined = tgl.findIndex((val) => val == undefined) if (this.props.defaultCurrency.id == 2) { data.push({ "item_report_id": i[1], "company_name": i[5], "institution_name": i[6], "type_of_investment": i[7] == null ? i[7] : i[7].value, "remarks": i[8], "placement_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])), "tenor": i[10], "expected_return": i[11] == "" ? "0.00" : i[11], "currency": i[12] == null ? i[12] : i[12].value, "investment_amount_ori": Number(i[13]) == "" ? "0.0" : Number(i[13]), "investment_amount_cur": Number(i[14]) == "" ? "0.0" : Number(i[14]), "notes": i[15], }) } else { data.push({ "item_report_id": i[1], "company_name": i[5], "institution_name": i[6], "type_of_investment": i[7] == null ? i[7] : i[7].value, "remarks": i[8], "placement_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])), "tenor": i[10], "expected_return": i[11] == "" ? "0.00" : i[11], "currency": i[12] == null ? i[12] : i[12].value, "investment_amount_ori": Number(i[13]) == "" ? "0.0" : Number(i[13]), "investment_amount_cur": Number(i[14]) == "" ? "0.0" : Number(i[14]), "notes": i[15], }) } } }) let body = { "monthly_report_id": this.props.monthlyReportId, "company_id": this.props.company.company_id, "periode": this.props.periode, "report_id": this.props.report_id, "status": type, "months": this.props.month.month_id, "currency_id": this.props.defaultCurrency.id, "lov": data, "per_bs": this.state.perBSLOV, "diff": this.state.diffLOV, "total_loan": this.state.totalLoanLOV } console.log(body); if (error && type == 'submitted') { this.setState({ handleDoubleClick: 0, saveDraft: false, saveComp: true, loading: false, snekbar: true, snekbarMsg: 'Data Incomplete', handleDoubleClick: 0 }) } else { api.create('UPLOAD').createMonthlyReportLOV(body).then(response => { console.log(response); if (response.data) { if (response.ok) { if (response.data.status === "success") { this.props.saveToMonthlyReport('LOCF') this.setState({ loadingChild : false}) // this.props.onClickClose() // this.props.getReport() } else { if (response.data?.message == "Please Set Up Rate Currency First") { this.setState({ visibleAlertSave: true }) } else { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) { setTimeout(() => { localStorage.removeItem(Constant.TOKEN) window.location.reload(); }, 1000); } }) } // alert(response.data.status) } } else { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false, handleDoubleClick: 0 }) } } else { this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false, handleDoubleClick: 0 }) } this.setState({ handleDoubleClick: 0 }) }) } } render() { let dataTable2 = this.state.dataTable let loading = this.state.loading const loadingComponent = (
); const handleClose = (event, reason) => { if (reason === 'clickaway') { return; } this.setState({ snekbar: false, snekbarMsg: '' }) }; return (
Monthly Report
{this.state.visibleParent ? < Paper style={{ paddingTop: 10, paddingBottom: 20 }}> {this.state.snekbarMsg}
Monthly Report - List Of Credit Facilities and Investment

{/* (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? */} {this.props.isApprover === true ? null :
{this.state.get_for == 'view' && this.state.viewOnly && } {this.state.get_for == 'edit' && } {this.state.get_for == 'edit' && } {this.state.get_for == 'edit' && }
} {/* : null } */}
: {this.state.snekbarMsg}
Monthly Report - List Of Credit Facilities and Investment

{/* {this.props.isApprover === true || this.state.dataTable.length == 0 ? null : (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? */}
{/* : null } */}
}
{ this.state.visibleAlertSave && (
Rate Currency USD pada periode yang dipilih belum diatur.
Silahkan menghubungi Superadmin
) }
) } }