Commit a1497d92 authored by Riri Novita's avatar Riri Novita

update dulu sebelum ganti laptop

parent e1263d6c
...@@ -393,7 +393,7 @@ export default class BalanceSheet extends Component { ...@@ -393,7 +393,7 @@ export default class BalanceSheet extends Component {
balance_sheet: payload, balance_sheet: payload,
status: 'submitted' status: 'submitted'
} }
// console.log(body) console.log(body)
this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[2] }) this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[2] })
} }
}); });
...@@ -440,6 +440,7 @@ export default class BalanceSheet extends Component { ...@@ -440,6 +440,7 @@ export default class BalanceSheet extends Component {
item.error item.error
] ]
}) })
console.log(dataTable);
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, errorPreview: false, saveDraft: true }, () => { this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, errorPreview: false, saveDraft: true }, () => {
this.state.dataTable.map(item => { this.state.dataTable.map(item => {
if (item[26].length > 0) { if (item[26].length > 0) {
...@@ -1125,7 +1126,7 @@ export default class BalanceSheet extends Component { ...@@ -1125,7 +1126,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)} disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
value={this.props.defaultCurrency.id == 1 ? (String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? fixNumber(Number(value.value), 1) : fixNumber(Number(handleValueFormula(value, tableMeta)), 1)) : (String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? Number(value.value) : Number(handleValueFormula(value, tableMeta)))} value={this.props.defaultCurrency.id == 1 ? String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? fixNumber(Number(value.value), 1) : fixNumber(Number(handleValueFormula(value, tableMeta)), 1) : String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? Number(value.value) : Number(handleValueFormula(value, tableMeta))}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 'r/e') handleChange(event.target.value, tableMeta, 'r/e')
// console.log(dataTable2) // console.log(dataTable2)
......
...@@ -66,7 +66,7 @@ export default class BalanceSheetMR extends Component { ...@@ -66,7 +66,7 @@ export default class BalanceSheetMR extends Component {
componentDidMount() { componentDidMount() {
this.getSettingControl() this.getSettingControl()
this.getLatestUpdate() this.getLatestUpdate()
// this.handleViewOnly() this.handleViewOnly()
} }
handleViewOnly() { handleViewOnly() {
......
...@@ -97,7 +97,7 @@ export default class CashFlowMR extends Component { ...@@ -97,7 +97,7 @@ export default class CashFlowMR extends Component {
componentDidMount() { componentDidMount() {
// this.getItemHierarki() // this.getItemHierarki()
console.log(this.props.PLBSFAMSubmitted) console.log(this.props.PLBSFAMSubmitted)
// this.handleViewOnly() this.handleViewOnly()
this.getSettingControl() this.getSettingControl()
} }
......
...@@ -4,7 +4,7 @@ import React, { Component } from 'react' ...@@ -4,7 +4,7 @@ import React, { Component } from 'react'
import ReactTooltip from 'react-tooltip'; import ReactTooltip from 'react-tooltip';
import Images from '../../assets/Images'; import Images from '../../assets/Images';
import api from '../../api'; import api from '../../api';
import { titleCase } from '../../library/Utils'; import { fixNumber, titleCase } from '../../library/Utils';
import Tooltip from '@material-ui/core/Tooltip'; import Tooltip from '@material-ui/core/Tooltip';
import NumberFormat from 'react-number-format'; import NumberFormat from 'react-number-format';
import Constant from '../../library/Constant'; import Constant from '../../library/Constant';
...@@ -237,7 +237,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -237,7 +237,7 @@ export default class CorporateAnnualTargetMR extends Component {
// parentTrue ? item.corporate_annual_target.max_ach == "" ? null : { value: titleCase(item.corporate_annual_target.max_ach) } : item.max_ach == "" ? null : { value: titleCase(item.max_ach) }, // parentTrue ? item.corporate_annual_target.max_ach == "" ? null : { value: titleCase(item.corporate_annual_target.max_ach) } : item.max_ach == "" ? null : { value: titleCase(item.max_ach) },
item.corporate_annual_target.formula_ytd == "" ? null : item.corporate_annual_target.formula_ytd, item.corporate_annual_target.formula_ytd == "" ? null : item.corporate_annual_target.formula_ytd,
// parentTrue ? item.corporate_annual_target.formula == "" ? null : { value: item.corporate_annual_target.formula } : item.formula_ytd == "" ? null : { value: item.formula_ytd }, // parentTrue ? item.corporate_annual_target.formula == "" ? null : { value: item.corporate_annual_target.formula } : item.formula_ytd == "" ? null : { value: item.formula_ytd },
item.corporate_annual_target.actual_monthly == "" ? item.corporate_annual_target.actual_monthly : String(item.corporate_annual_target.actual_monthly).indexOf(".") == -1 ? Number(item.corporate_annual_target.actual_monthly) : Number(item.corporate_annual_target.actual_monthly).toFixed(1), item.corporate_annual_target.actual_monthly == "" ? item.corporate_annual_target.actual_monthly : String(item.corporate_annual_target.actual_monthly).indexOf(".") == -1 ? Number(item.corporate_annual_target.actual_monthly) : Number(item.corporate_annual_target.actual_monthly),
item.corporate_annual_target.target_monthly === null ? "0" : item.corporate_annual_target.target_monthly, item.corporate_annual_target.target_monthly === null ? "0" : item.corporate_annual_target.target_monthly,
item.corporate_annual_target.achivement_monthly === null ? "0" : item.corporate_annual_target.achivement_monthly, item.corporate_annual_target.achivement_monthly === null ? "0" : item.corporate_annual_target.achivement_monthly,
item.corporate_annual_target.score === null ? "0" : item.corporate_annual_target.score, item.corporate_annual_target.score === null ? "0" : item.corporate_annual_target.score,
...@@ -289,7 +289,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -289,7 +289,7 @@ export default class CorporateAnnualTargetMR extends Component {
item.formula, item.formula,
item.level, item.level,
item.description, item.description,
item.weight == '' ? Number(0).toFixed(1) : Number(Number(item.weight) * 100).toFixed(1), item.weight == '' ? Number(0) : Number(Number(item.weight) * 100),
item.uom, item.uom,
item.kpi_type == "" ? null : item.kpi_type, item.kpi_type == "" ? null : item.kpi_type,
// item.kpi_type == "" ? null : { value: item.kpi_type }, // item.kpi_type == "" ? null : { value: item.kpi_type },
...@@ -297,7 +297,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -297,7 +297,7 @@ export default class CorporateAnnualTargetMR extends Component {
// item.max_ach == "" ? null : { value: titleCase(item.max_ach) }, // item.max_ach == "" ? null : { value: titleCase(item.max_ach) },
item.corporate_annual_target.formula == "" ? null : item.corporate_annual_target.formula_ytd, item.corporate_annual_target.formula == "" ? null : item.corporate_annual_target.formula_ytd,
// item.formula == "" ? null : { value: item.formula_ytd }, // item.formula == "" ? null : { value: item.formula_ytd },
item.corporate_annual_target.actual_monthly == "" ? item.corporate_annual_target.actual_monthly : String(item.corporate_annual_target.actual_monthly).indexOf(".") == -1 ? Number(item.corporate_annual_target.actual_monthly) : Number(item.corporate_annual_target.actual_monthly).toFixed(1), item.corporate_annual_target.actual_monthly == "" ? item.corporate_annual_target.actual_monthly : String(item.corporate_annual_target.actual_monthly).indexOf(".") == -1 ? Number(item.corporate_annual_target.actual_monthly) : Number(item.corporate_annual_target.actual_monthly),
item.corporate_annual_target.target_monthly === null ? "0" : item.corporate_annual_target.target_monthly, item.corporate_annual_target.target_monthly === null ? "0" : item.corporate_annual_target.target_monthly,
item.corporate_annual_target.achivement_monthly === null ? "0" : item.corporate_annual_target.achivement_monthly, item.corporate_annual_target.achivement_monthly === null ? "0" : item.corporate_annual_target.achivement_monthly,
item.corporate_annual_target.score === null ? "0" : item.corporate_annual_target.score, item.corporate_annual_target.score === null ? "0" : item.corporate_annual_target.score,
...@@ -473,23 +473,44 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -473,23 +473,44 @@ export default class CorporateAnnualTargetMR extends Component {
uploadCATMR(type) { uploadCATMR(type) {
let data = [] let data = []
this.state.dataTable.map(i => { if (this.props.defaultCurrency.id == 2) {
data.push({ this.state.dataTable.map(i => {
item_report_id: i[1], data.push({
item_report: String(i[5]), item_report_id: i[1],
weight: String(i[6]), item_report: String(i[5]),
uom: String(i[7]), weight: String(i[6]),
jenis_kpi: i[8] == null ? "" : i[8], uom: String(i[7]),
max_ach: i[9] == null ? "" : i[9], jenis_kpi: i[8] == null ? "" : i[8],
formula_ytd: i[10] == null ? "" : i[10], max_ach: i[9] == null ? "" : i[9],
actual_monthly: String(Number(i[11]).toFixed(1)), formula_ytd: i[10] == null ? "" : i[10],
target_monthly: String(Number(i[12]).toFixed(1)), actual_monthly: String(Number(i[11])),
achivement_monthly: String(Number(i[13]).toFixed(1)), target_monthly: String(Number(i[12])),
score: String(Number(i[14]).toFixed(0)), achivement_monthly: String(Number(i[13])),
score_x_weight: String(Number(i[15]).toFixed(2)), score: String(Number(i[14])),
notes: String(i[16]) score_x_weight: String(Number(i[15])),
notes: String(i[16])
})
}) })
}) } else {
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
item_report: String(i[5]),
weight: String(i[6]),
uom: String(i[7]),
jenis_kpi: i[8] == null ? "" : i[8],
max_ach: i[9] == null ? "" : i[9],
formula_ytd: i[10] == null ? "" : i[10],
actual_monthly: String(fixNumber(Number(i[11]), 1)),
target_monthly: String(fixNumber(Number(i[12]), 1)),
achivement_monthly: String(fixNumber(Number(i[13]), 1)),
score: String(fixNumber(Number(i[14]), 0)),
score_x_weight: String(fixNumber(Number(i[15]), 2)),
notes: String(i[16])
})
})
}
let body = { let body = {
// "monthly_report_id": this.props.monthlyReportId, // "monthly_report_id": this.props.monthlyReportId,
"monthly_report_id": this.props.monthlyReportId, "monthly_report_id": this.props.monthlyReportId,
...@@ -624,22 +645,42 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -624,22 +645,42 @@ export default class CorporateAnnualTargetMR extends Component {
this.setState({ loading: true }) this.setState({ loading: true })
console.log(this.state.dataTable); console.log(this.state.dataTable);
let data = [] let data = []
this.state.dataTable.map(i => { if (this.props.defaultCurrency.id == 2) {
data.push({ this.state.dataTable.map(i => {
"item_report_id": i[1], data.push({
"weight": i[6], "item_report_id": i[1],
"uom": i[7], "weight": i[6],
"jenis_kpi": i[8] == null ? "" : i[8], "uom": i[7],
"max_ach": i[9] == null ? "" : i[9], "jenis_kpi": i[8] == null ? "" : i[8],
"formula_ytd": i[10] == null ? "" : i[10], "max_ach": i[9] == null ? "" : i[9],
"actual_monthly": i[11] == null || i[11] == "" ? 0.0 : String(Number(i[11]).toFixed(1)), "formula_ytd": i[10] == null ? "" : i[10],
"target_monthly": i[12] == null || i[12] == "" ? 0.0 : String(Number(i[12]).toFixed(1)), "actual_monthly": i[11] == null || i[11] == "" ? 0.0 : String(Number(i[11])),
"achivement_monthly": String(Number(i[13]).toFixed(1)), "target_monthly": i[12] == null || i[12] == "" ? 0.0 : String(Number(i[12])),
"score": String(Number(i[14]).toFixed(0)), "achivement_monthly": String(Number(i[13])),
"score_x_weight": String(Number(i[15]).toFixed(2)), "score": String(Number(i[14])),
"notes": i[16] "score_x_weight": String(Number(i[15])),
"notes": i[16]
})
}) })
}) } else {
this.state.dataTable.map(i => {
data.push({
"item_report_id": i[1],
"weight": i[6],
"uom": i[7],
"jenis_kpi": i[8] == null ? "" : i[8],
"max_ach": i[9] == null ? "" : i[9],
"formula_ytd": i[10] == null ? "" : i[10],
"actual_monthly": i[11] == null || i[11] == "" ? 0.0 : String(fixNumber(Number(i[11]), 1)),
"target_monthly": i[12] == null || i[12] == "" ? 0.0 : String(fixNumber(Number(i[12]), 1)),
"achivement_monthly": String(fixNumber(Number(i[13]), 1)),
"score": String(fixNumber(Number(i[14]), 0)),
"score_x_weight": String(fixNumber(Number(i[15]), 2)),
"notes": i[16]
})
})
}
let payload = { let payload = {
"monthly_report_id": this.props.monthlyReportId, "monthly_report_id": this.props.monthlyReportId,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
...@@ -796,7 +837,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -796,7 +837,7 @@ export default class CorporateAnnualTargetMR extends Component {
} }
}) })
} }
let totalScorez = this.props.lastStatus == 'APPROVED' ? item[14] : Number(totalScore).toFixed(0) let totalScorez = this.props.lastStatus == 'APPROVED' ? item[14] : this.props.defaultCurrency.id == 1 ? fixNumber(Number(totalScore), 0) : Number(totalScore)
// if (item[5] == "Max Quality drop from Bor-Barge") { // if (item[5] == "Max Quality drop from Bor-Barge") {
// console.log(totalScorez) // console.log(totalScorez)
// } // }
...@@ -813,7 +854,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -813,7 +854,7 @@ export default class CorporateAnnualTargetMR extends Component {
} else { } else {
totalSW = (Number(totalScorez) * Number(handlePercent) / 100) totalSW = (Number(totalScorez) * Number(handlePercent) / 100)
} }
totalSW = this.props.lastStatus == 'APPROVED' ? item[15] : Number(totalSW).toFixed(2) totalSW = this.props.lastStatus == 'APPROVED' ? item[15] : this.props.defaultCurrency.id == 1 ? fixNumber(Number(totalSW), 2) : Number(totalSW)
if (item[0] !== 1 && item[0] !== 4) { if (item[0] !== 1 && item[0] !== 4) {
total += Number(totalSW) total += Number(totalSW)
} }
...@@ -855,7 +896,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -855,7 +896,7 @@ export default class CorporateAnnualTargetMR extends Component {
// console.log(total) // console.log(total)
// console.log(datatable3); // console.log(datatable3);
let totalWeightz = Number(totalWeight) / 100 let totalWeightz = Number(totalWeight) / 100
let totalz = Number(Number(total).toFixed(2) / Number(totalWeightz)).toFixed(2) let totalz = this.props.defaultCurrency.id == 1 ? (Number(fixNumber(fixNumber(Number(total), 2) / Number(totalWeightz)), 2)) : Number(Number(total) / Number(totalWeightz))
console.log(totalz) console.log(totalz)
let lastTotal = R.equals(totalz, NaN) ? 0.0 : totalz let lastTotal = R.equals(totalz, NaN) ? 0.0 : totalz
...@@ -865,7 +906,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -865,7 +906,7 @@ export default class CorporateAnnualTargetMR extends Component {
lastTotal = totalz lastTotal = totalz
} }
console.log(Number(Number(total).toFixed(2) / Number(totalWeightz)).toFixed(2)) console.log(fixNumber(Number(Number(total), 2) / fixNumber(Number(totalWeightz)), 2))
let indexPerform = this.state.parameterPerfom.findIndex((val) => val.company_id == this.props.company.company_id) let indexPerform = this.state.parameterPerfom.findIndex((val) => val.company_id == this.props.company.company_id)
let listPerfomanceDefault = [] let listPerfomanceDefault = []
if (indexPerform == -1) { if (indexPerform == -1) {
...@@ -1214,10 +1255,10 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1214,10 +1255,10 @@ export default class CorporateAnnualTargetMR extends Component {
// if (dataTable2[tableMeta.rowIndex][5] == "ROIC") { // if (dataTable2[tableMeta.rowIndex][5] == "ROIC") {
// dataTable2[tableMeta.rowIndex][column] = 0 // dataTable2[tableMeta.rowIndex][column] = 0
// } else { // } else {
dataTable2[tableMeta.rowIndex][column] = Number(total).toFixed(1) dataTable2[tableMeta.rowIndex][column] = this.props.defaultCurrency.i == 1 ? fixNumber(Number(total), 1) : Number(total)
// } // }
return Number(total).toFixed(1) return this.props.defaultCurrency.i == 1 ? fixNumber(Number(total), 1) : Number(total)
} }
const handleChangeText = (value, tableMeta) => { const handleChangeText = (value, tableMeta) => {
...@@ -1410,11 +1451,11 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1410,11 +1451,11 @@ export default class CorporateAnnualTargetMR extends Component {
}) })
} }
if (Number(tableMeta.rowData[12]) == Number(0)) { if (Number(tableMeta.rowData[12]) == Number(0)) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(0).toFixed(0) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = this.props.defaultCurrency.id == 1 ? fixNumber(Number(0), 0) : Number(0)
return Number(0).toFixed(0) return this.props.defaultCurrency.id == 1 ? fixNumber(Number(0), 0) : Number(0)
} else { } else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(totalScore).toFixed(0) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = this.props.defaultCurrency.id == 1 ? fixNumber(Number(totalScore), 0) : Number(totalScore)
return Number(totalScore).toFixed(0) return this.props.defaultCurrency.id == 1 ? fixNumber(Number(totalScore), 0) : Number(totalScore)
} }
} }
...@@ -1432,9 +1473,9 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1432,9 +1473,9 @@ export default class CorporateAnnualTargetMR extends Component {
totalScore += Number(item[15]) totalScore += Number(item[15])
} }
}) })
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(totalScore).toFixed(2) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = this.props.defaultCurrency.id == 1 ? fixNumber(Number(totalScore), 2) : Number(totalScore)
if (tableMeta.rowIndex == dataTable2.length - 1) { if (tableMeta.rowIndex == dataTable2.length - 1) {
someXXX = Number(totalScore).toFixed(2) someXXX = this.props.defaultCurrency.id == 1 ? fixNumber(Number(totalScore), 2) : Number(totalScore)
// console.log(someXXX) // console.log(someXXX)
} }
return null return null
...@@ -1452,7 +1493,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1452,7 +1493,7 @@ export default class CorporateAnnualTargetMR extends Component {
total = Number(dataTable2[tableMeta.rowIndex][14]) * Number(handlePercent) / 100 total = Number(dataTable2[tableMeta.rowIndex][14]) * Number(handlePercent) / 100
// console.log(total) // console.log(total)
} }
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total).toFixed(2) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = this.props.defaultCurrency.id == 1 ? fixNumber(Number(total), 2) : Number(total)
return total return total
} }
...@@ -1583,7 +1624,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1583,7 +1624,7 @@ export default class CorporateAnnualTargetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
suffix={"%"} suffix={"%"}
value={Number(value).toFixed(1)} value={fixNumber(Number(value), 1)}
disabled={true} disabled={true}
// disabled={this.props.isApprover ? true : ((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') ? false : true)} // disabled={this.props.isApprover ? true : ((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') ? false : true)}
decimalScale={1} decimalScale={1}
...@@ -1690,7 +1731,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1690,7 +1731,7 @@ export default class CorporateAnnualTargetMR extends Component {
style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
// disabled={this.props.isApprover ? true : ((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') ? false : true)} // disabled={this.props.isApprover ? true : ((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') ? false : true)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
...@@ -1699,14 +1740,14 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1699,14 +1740,14 @@ export default class CorporateAnnualTargetMR extends Component {
<div style={{ flex: 1, textAlign: 'right' }}> <div style={{ flex: 1, textAlign: 'right' }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={Number(value).toFixed(1)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 1) : Number(value)}
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: this.state.get_for == 'view' ? "black" : handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta) ? "#5198ea" : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.state.get_for == 'view' ? "black" : handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta) ? "#5198ea" : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ? Number(handleValueFormula(value, tableMeta, tableMeta.columnIndex)).toFixed(1) : Number(value).toFixed(1)} value={Number(value) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ? fixNumber(Number(handleValueFormula(value, tableMeta, tableMeta.columnIndex)), 1) : fixNumber(Number(value), 1)) : (tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ? Number(handleValueFormula(value, tableMeta, tableMeta.columnIndex)) : Number(value))}
// disabled={this.props.isApprover ? true : ((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') ? false : true)} // disabled={this.props.isApprover ? true : ((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') ? false : true)}
disabled={this.state.get_for == 'view' ? true : !handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta)} disabled={this.state.get_for == 'view' ? true : !handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta)}
decimalScale={1} decimalScale={1}
...@@ -1739,14 +1780,14 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1739,14 +1780,14 @@ export default class CorporateAnnualTargetMR extends Component {
null : null :
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={Number(value).toFixed(1)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 1) : Number(value) == 0 ? "0.0" : Number(value)}
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 1) : Number(value) == 0 ? "0.0" : Number(value)}
decimalScale={1} decimalScale={1}
disabled={true} disabled={true}
/> />
...@@ -1776,7 +1817,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1776,7 +1817,7 @@ export default class CorporateAnnualTargetMR extends Component {
style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={fixNumber(Number(value), 1)}
// disabled={this.props.isApprover ? true : ((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') ? false : true)} // disabled={this.props.isApprover ? true : ((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') ? false : true)}
disabled={true} disabled={true}
suffix={"%"} suffix={"%"}
...@@ -1785,7 +1826,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1785,7 +1826,7 @@ export default class CorporateAnnualTargetMR extends Component {
: :
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={Number(value).toFixed(1)} value={fixNumber(Number(value), 1)}
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
...@@ -1793,7 +1834,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1793,7 +1834,7 @@ export default class CorporateAnnualTargetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
suffix={"%"} suffix={"%"}
value={handleAchiement(tableMeta).toFixed(1)} value={fixNumber(handleAchiement(tableMeta), 1)}
decimalScale={1} decimalScale={1}
disabled={true} disabled={true}
/> />
...@@ -1823,7 +1864,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1823,7 +1864,7 @@ export default class CorporateAnnualTargetMR extends Component {
style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(0)} value={fixNumber(Number(value), 0)}
// disabled={this.props.isApprover ? true : ((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') ? false : true)} // disabled={this.props.isApprover ? true : ((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') ? false : true)}
disabled={true} disabled={true}
decimalScale={0} decimalScale={0}
...@@ -1831,7 +1872,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1831,7 +1872,7 @@ export default class CorporateAnnualTargetMR extends Component {
: :
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={Number(value).toFixed(0)} value={fixNumber(Number(value), 0)}
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
...@@ -1876,7 +1917,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1876,7 +1917,7 @@ export default class CorporateAnnualTargetMR extends Component {
style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(2)} value={fixNumber(Number(value), 2)}
// disabled={this.props.isApprover ? true : ((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') ? false : true)} // disabled={this.props.isApprover ? true : ((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') ? false : true)}
disabled={true} disabled={true}
decimalScale={2} decimalScale={2}
...@@ -1887,7 +1928,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1887,7 +1928,7 @@ export default class CorporateAnnualTargetMR extends Component {
style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={handleTotal(tableMeta).toFixed(2)} value={fixNumber(handleTotal(tableMeta), 2)}
decimalScale={2} decimalScale={2}
disabled={true} disabled={true}
/> />
......
...@@ -571,7 +571,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -571,7 +571,7 @@ export default class ListOfCreditFacilities extends Component {
item.type_of_credit == "Others" ? item.out_loan_other_type : "", item.type_of_credit == "Others" ? item.out_loan_other_type : "",
item.type_of_credit == "Others" ? item.out_loan_other_amount_ori : "0.0", item.type_of_credit == "Others" ? item.out_loan_other_amount_ori : "0.0",
item.type_of_credit == "Others" ? (item.out_loan_other_amount_idr === null ? "0.0" : item.out_loan_other_amount_idr === "" ? "0.0" : item.out_loan_other_amount_idr) : "0.0", item.type_of_credit == "Others" ? (item.out_loan_other_amount_idr === null ? "0.0" : item.out_loan_other_amount_idr === "" ? "0.0" : item.out_loan_other_amount_idr) : "0.0",
item.total_out_loan_ori === null ? "0.0" : item.total_out_loan_ori === "" ? "0.0" : item.total_out_loan_ori, item.total_out_loan_ori === null ? "0.0" : item.total_out_loan_ori === "" ? "0.0" : item.total_out_loan_ori === 0 ? "0.0" : item.total_out_loan_ori,
item.total_out_loan_idr === null ? "0.0" : item.total_out_loan_idr === "" ? "0.0" : item.total_out_loan_idr, item.total_out_loan_idr === null ? "0.0" : item.total_out_loan_idr === "" ? "0.0" : item.total_out_loan_idr,
item.remaining_plafond_ori === null ? "0.0" : item.remaining_plafond_ori === "" ? "0.0" : item.remaining_plafond_ori, item.remaining_plafond_ori === null ? "0.0" : item.remaining_plafond_ori === "" ? "0.0" : item.remaining_plafond_ori,
item.remaining_plafond_idr === null ? "0.0" : item.remaining_plafond_idr === "" ? "0.0" : item.remaining_plafond_idr, item.remaining_plafond_idr === null ? "0.0" : item.remaining_plafond_idr === "" ? "0.0" : item.remaining_plafond_idr,
...@@ -658,7 +658,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -658,7 +658,7 @@ export default class ListOfCreditFacilities extends Component {
// } // }
// } // }
}) })
// console.log(dataTable); console.log(dataTable);
if (dataTable.length == 0) { if (dataTable.length == 0) {
dataTable.push( dataTable.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, "0.00", "", "", "0", "", "0", "", "0", "", "", "0", "0", "0", "0", "0", "", "0", "", "0", "", "0", "", "0", "", "", "", "", "", "", "", "", "", "", "", "", "", 0],
...@@ -1308,6 +1308,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1308,6 +1308,7 @@ export default class ListOfCreditFacilities extends Component {
let dataCoba = [] let dataCoba = []
let bankNameEmpty = false let bankNameEmpty = false
let totalLoan = 0 let totalLoan = 0
console.log(dataTable2);
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
if (item[0] !== 8) { if (item[0] !== 8) {
if (item[6] == null) { if (item[6] == null) {
...@@ -1336,6 +1337,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1336,6 +1337,7 @@ export default class ListOfCreditFacilities extends Component {
} }
} }
}) })
console.log(dataCoba);
let dataGabung = [] let dataGabung = []
if (!bankNameEmpty) { if (!bankNameEmpty) {
dataCoba.map((item, index) => { dataCoba.map((item, index) => {
...@@ -1343,9 +1345,11 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1343,9 +1345,11 @@ export default class ListOfCreditFacilities extends Component {
dataGabung.push(items) dataGabung.push(items)
}) })
}) })
console.log(dataGabung);
dataGabung.map((items, index) => { dataGabung.map((items, index) => {
console.log(items);
if (items[0] == 3) { if (items[0] == 3) {
console.log(Number(totalLoan));
this.props.defaultCurrency.id == 1 ? totalLoan += items[22] : totalLoan += items[21] this.props.defaultCurrency.id == 1 ? totalLoan += items[22] : totalLoan += items[21]
} }
if (bankPrev != "") { if (bankPrev != "") {
...@@ -1500,10 +1504,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1500,10 +1504,10 @@ export default class ListOfCreditFacilities extends Component {
// console.log(dataGabung) // console.log(dataGabung)
console.log(newData) console.log(newData)
// console.log(dataTampungBank) // console.log(dataTampungBank)
console.log(fixNumber(Number(totalLoan), 1)); console.log(totalLoan);
console.log(this.state.perBS) console.log(this.state.perBS)
console.log(this.state.diff) console.log(this.state.diff)
// console.log(bankNameEmpty) console.log(bankNameEmpty)
// dataTable: newData, totalOutStand: newData[newData.length-1][22] // dataTable: newData, totalOutStand: newData[newData.length-1][22]
if (bankNameEmpty) { if (bankNameEmpty) {
if (this.state.get_for == 'view') { if (this.state.get_for == 'view') {
...@@ -1521,7 +1525,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1521,7 +1525,7 @@ export default class ListOfCreditFacilities extends Component {
} else { } else {
if (this.props.defaultCurrency.id == 1) { if (this.props.defaultCurrency.id == 1) {
this.setState({ loading: false, dataTable: newData, diff: fixNumber(Number(fixNumber(Number(totalLoan), 1) - this.state.perBS),), saveDraft: false, saveComp: Number(fixNumber(Number(totalLoan), 1) - this.state.perBS) == 0 || Number(fixNumber(Number(totalLoan), 1) - this.state.perBS) == "-0.0" ? false : true }) this.setState({ loading: false, dataTable: newData, diff: fixNumber(Number(fixNumber(Number(totalLoan), 1) - this.state.perBS), 1), saveDraft: false, saveComp: Number(fixNumber(Number(totalLoan), 1) - this.state.perBS) == 0 || Number(fixNumber(Number(totalLoan), 1) - this.state.perBS) == "-0.0" ? false : true })
} else { } else {
this.setState({ loading: false, dataTable: newData, diff: Number(Number(totalLoan) - this.state.perBS), saveDraft: false, saveComp: Number(Number(totalLoan) - this.state.perBS) == 0 || Number(Number(totalLoan) - this.state.perBS) == "-0.0" ? false : true }) this.setState({ loading: false, dataTable: newData, diff: Number(Number(totalLoan) - this.state.perBS), saveDraft: false, saveComp: Number(Number(totalLoan) - this.state.perBS) == 0 || Number(Number(totalLoan) - this.state.perBS) == "-0.0" ? false : true })
} }
...@@ -1644,6 +1648,9 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1644,6 +1648,9 @@ export default class ListOfCreditFacilities extends Component {
} }
const handleFormulaHardcode = (value, tableMeta, column) => { const handleFormulaHardcode = (value, tableMeta, column) => {
// console.log("------------coba------------------");
// console.log(tableMeta);
// console.log(tableMeta.rowData[0]);
let valuez = 0 let valuez = 0
if (tableMeta.rowData[0] == 8) { if (tableMeta.rowData[0] == 8) {
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
...@@ -1658,7 +1665,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1658,7 +1665,7 @@ export default class ListOfCreditFacilities extends Component {
} }
}) })
if (column == 22) { if (column == 22) {
totalLoan = valuez totalLoan = valuez
} }
} else { } else {
if (column == 21) { if (column == 21) {
...@@ -1670,8 +1677,9 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1670,8 +1677,9 @@ export default class ListOfCreditFacilities extends Component {
} 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])
} }
} }
dataTable2[tableMeta.rowIndex][column] = valuez dataTable2[tableMeta.rowIndex][column] = valuez
return valuez return valuez
} }
...@@ -2114,7 +2122,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2114,7 +2122,7 @@ export default class ListOfCreditFacilities extends Component {
value={Number(value) == 0 ? "0.0" : this.state.get_for == 'view' ? fixNumber(Number(value), 2) : this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 2) : Number(value)} value={Number(value) == 0 ? "0.0" : this.state.get_for == 'view' ? fixNumber(Number(value), 2) : this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 2) : Number(value)}
disabled={this.state.get_for == 'view'} disabled={this.state.get_for == 'view'}
// disabled={this.props.isApprover ? true : ((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') ? false : true)} // disabled={this.props.isApprover ? true : ((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') ? false : true)}
decimalScale={2} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, tableMeta.columnIndex) handleChange(event.target.value, tableMeta, tableMeta.columnIndex)
...@@ -2754,7 +2762,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2754,7 +2762,7 @@ export default class ListOfCreditFacilities 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={Number(tableMeta.rowData[21]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[21], tableMeta, 21)), 1) : 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))}
/> />
} }
/> />
...@@ -2772,7 +2780,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2772,7 +2780,7 @@ export default class ListOfCreditFacilities 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={Number(tableMeta.rowData[21]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[21], tableMeta, 21)), 1) : 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))}
/> />
} }
/> />
...@@ -2797,7 +2805,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2797,7 +2805,7 @@ export default class ListOfCreditFacilities 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={Number(tableMeta.rowData[22]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[22], tableMeta, 22)), 1) : 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))}
/> />
} }
/> />
...@@ -2815,7 +2823,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2815,7 +2823,7 @@ export default class ListOfCreditFacilities 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={Number(tableMeta.rowData[22]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleFormulaHardcode(tableMeta.rowData[22], tableMeta, 22)), 1) : 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))}
/> />
} }
/> />
...@@ -2992,9 +3000,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2992,9 +3000,10 @@ export default class ListOfCreditFacilities extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={this.state.get_for == 'view'} disabled={this.state.get_for == 'view'}
fixedDecimalScale={2} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
decimalScale={2} // decimalScale={2}
value={fixNumber(Number(tableMeta.rowData[25]), 2)} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={Number(tableMeta.rowData[25]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[25]), 2) : Number(tableMeta.rowData[25])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 25) handleChange(event.target.value, tableMeta, 25)
}} }}
...@@ -3020,7 +3029,8 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3020,7 +3029,8 @@ export default class ListOfCreditFacilities extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleTableRatio(tableMeta.rowData[26], tableMeta, 26, "Current Ratio")), 1)} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
value={Number(tableMeta.rowData[26]) == 0 ? "0.0" : 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"))}
/> />
} }
/> />
...@@ -3075,9 +3085,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3075,9 +3085,10 @@ export default class ListOfCreditFacilities extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={this.state.get_for == 'view'} disabled={this.state.get_for == 'view'}
fixedDecimalScale={2} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
decimalScale={2} // decimalScale={2}
value={fixNumber(Number(tableMeta.rowData[27]), 2)} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={Number(tableMeta.rowData[27]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[27]), 2) : Number(tableMeta.rowData[27])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 27) handleChange(event.target.value, tableMeta, 27)
}} }}
...@@ -3103,7 +3114,8 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3103,7 +3114,8 @@ export default class ListOfCreditFacilities extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleTableRatio(tableMeta.rowData[28], tableMeta, 28, "Debt to Equity Ratio")), 2)} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
value={Number(tableMeta.rowData[28]) == 0 ? "0.0" : 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"))}
/> />
} }
/> />
...@@ -3158,9 +3170,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3158,9 +3170,10 @@ export default class ListOfCreditFacilities extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={this.state.get_for == 'view'} disabled={this.state.get_for == 'view'}
fixedDecimalScale={2} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
decimalScale={2} // decimalScale={2}
value={fixNumber(Number(tableMeta.rowData[29]), 2)} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={Number(tableMeta.rowData[29]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[29]), 2) : Number(tableMeta.rowData[29])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 29) handleChange(event.target.value, tableMeta, 29)
}} }}
...@@ -3186,7 +3199,8 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3186,7 +3199,8 @@ export default class ListOfCreditFacilities extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleTableRatio(tableMeta.rowData[30], tableMeta, 30, "Debt to EBITDA - YTD")), 2)} decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
value={Number(tableMeta.rowData[30]) == 0 ? "0.0" : 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"))}
/> />
} }
/> />
...@@ -3241,9 +3255,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3241,9 +3255,10 @@ export default class ListOfCreditFacilities extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={this.state.get_for == 'view'} disabled={this.state.get_for == 'view'}
fixedDecimalScale={2} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
decimalScale={2} // decimalScale={2}
value={fixNumber(Number(tableMeta.rowData[31]), 2)} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={Number(tableMeta.rowData[31]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[31]), 2) : Number(tableMeta.rowData[31])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 31) handleChange(event.target.value, tableMeta, 31)
}} }}
...@@ -3269,7 +3284,8 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3269,7 +3284,8 @@ export default class ListOfCreditFacilities extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(handleTableRatio(tableMeta.rowData[32], tableMeta, 32, "EBITDA to Interest - YTD")), 2)} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={Number(tableMeta.rowData[32]) == 0 ? "0.0" : 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"))}
/> />
} }
/> />
...@@ -3357,9 +3373,9 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3357,9 +3373,9 @@ export default class ListOfCreditFacilities extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={this.state.get_for == 'view'} disabled={this.state.get_for == 'view'}
fixedDecimalScale={2} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
decimalScale={2} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={fixNumber(Number(tableMeta.rowData[34]), 2)} value={Number(tableMeta.rowData[34]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[34]), 2) : Number(tableMeta.rowData[34])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 34) handleChange(event.target.value, tableMeta, 34)
}} }}
...@@ -3385,9 +3401,9 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3385,9 +3401,9 @@ export default class ListOfCreditFacilities extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={this.state.get_for == 'view'} disabled={this.state.get_for == 'view'}
fixedDecimalScale={2} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
decimalScale={2} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={fixNumber(Number(tableMeta.rowData[35]), 2)} value={Number(tableMeta.rowData[35]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[35]), 2) : Number(tableMeta.rowData[35])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 35) handleChange(event.target.value, tableMeta, 35)
}} }}
...@@ -3478,9 +3494,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3478,9 +3494,10 @@ export default class ListOfCreditFacilities extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={this.state.get_for == 'view'} disabled={this.state.get_for == 'view'}
fixedDecimalScale={2} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
decimalScale={2} // decimalScale={2}
value={fixNumber(Number(tableMeta.rowData[37]), 2)} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={Number(tableMeta.rowData[37]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[37]), 2) : Number(tableMeta.rowData[37])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 37) handleChange(event.target.value, tableMeta, 37)
}} }}
...@@ -3506,9 +3523,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3506,9 +3523,10 @@ export default class ListOfCreditFacilities extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={this.state.get_for == 'view'} disabled={this.state.get_for == 'view'}
fixedDecimalScale={2} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
decimalScale={2} // decimalScale={2}
value={fixNumber(Number(tableMeta.rowData[38]), 2)} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={Number(tableMeta.rowData[38]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[38]), 2) : Number(tableMeta.rowData[38])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 38) handleChange(event.target.value, tableMeta, 38)
}} }}
...@@ -3599,9 +3617,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3599,9 +3617,10 @@ export default class ListOfCreditFacilities extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={this.state.get_for == 'view'} disabled={this.state.get_for == 'view'}
fixedDecimalScale={2} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
decimalScale={2} // decimalScale={2}
value={fixNumber(Number(tableMeta.rowData[40]), 2)} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={Number(tableMeta.rowData[40]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[40]), 2) : Number(tableMeta.rowData[40])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 40) handleChange(event.target.value, tableMeta, 40)
}} }}
...@@ -3627,9 +3646,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3627,9 +3646,10 @@ export default class ListOfCreditFacilities extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={this.state.get_for == 'view'} disabled={this.state.get_for == 'view'}
fixedDecimalScale={2} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
decimalScale={2} // decimalScale={2}
value={fixNumber(Number(tableMeta.rowData[41]), 2)} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={Number(tableMeta.rowData[41]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[41]), 2) : Number(tableMeta.rowData[41])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 41) handleChange(event.target.value, tableMeta, 41)
}} }}
...@@ -3720,9 +3740,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3720,9 +3740,10 @@ export default class ListOfCreditFacilities extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={this.state.get_for == 'view'} disabled={this.state.get_for == 'view'}
fixedDecimalScale={2} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
decimalScale={2} // decimalScale={2}
value={fixNumber(Number(tableMeta.rowData[43]), 2)} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={Number(tableMeta.rowData[43]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[43]), 2) : Number(tableMeta.rowData[43])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 43) handleChange(event.target.value, tableMeta, 43)
}} }}
...@@ -3748,9 +3769,10 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3748,9 +3769,10 @@ export default class ListOfCreditFacilities extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={this.state.get_for == 'view'} disabled={this.state.get_for == 'view'}
fixedDecimalScale={2} fixedDecimalScale={this.props.defaultCurrency.id == 1 ? true : false}
decimalScale={2} // decimalScale={2}
value={fixNumber(Number(tableMeta.rowData[44]), 2)} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={Number(tableMeta.rowData[44]) == 0 ? "0.0" : this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[44]), 2) : Number(tableMeta.rowData[44])}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 44) handleChange(event.target.value, tableMeta, 44)
}} }}
......
...@@ -2565,9 +2565,9 @@ export default class MonthlyReport extends Component { ...@@ -2565,9 +2565,9 @@ export default class MonthlyReport extends Component {
: :
// { // {
// (tableMeta.rowData[5] ? (tableMeta.rowData[5] ?
this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2], tableMeta.rowData[3]) this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2], tableMeta.rowData[3])
// : null) : null)
// console.log(tableMeta.rowData) // console.log(tableMeta.rowData)
// } // }
......
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