Commit d9749012 authored by faisalhamdi's avatar faisalhamdi

update BS Summary

parent 0b4a2308
......@@ -1308,7 +1308,7 @@ export default class SubHolding extends Component {
"report_id": this.state.report.value,
"company_id": this.state.company.company_id,
"periode": this.state.periode.periode,
"months": "1"
"months": this.state.month.month_id
}
api.create().getReportBSSuma(payload).then(response => {
console.log(payload);
......
......@@ -1029,16 +1029,27 @@ export default class TableSubHolding extends Component {
return total
}
const handleMTDPercent = (tableMeta, dex, type) => {
let total = 0
// if (tableMeta.rowData[5] === "Cash and cash equivalent" ) {
// console.log(tableMeta);
// console.log(dataTable2);
// }
if (dex === 1) {
total = R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][8])), NaN) ? "0" : R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][8])), Infinity) ? "0" : R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][8])), -Infinity) ? "0" : Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][8])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
} else if (dex === 2) {
total = R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][10])), NaN) ? "0" : R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][10])), Infinity) ? "0" : R.equals((Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][10])), -Infinity) ? "0" : Number(dataTable2[tableMeta.rowIndex][7]) / Number(dataTable2[tableMeta.rowIndex][10])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
}
return total
}
let datas = [
["ABCD", "Testing", { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }],
["Total Assets", "Notes", { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }]
]
let dataSummaryBS = [
["ABCD", { a: "0", b: "0", c: "0", d: "0" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }],
["Total Assets", { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }]
]
let dataSummaryPL = [
["ABCD", { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }, { a: "2", b: "3", c: "4", d: "5" }],
["Total Assets", { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }, { a: "6", b: "7", c: "8", d: "9" }]
......@@ -15097,7 +15108,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(1)}
value={Number(handleMTDPercent(tableMeta, 1, 3)).toFixed(1)}
/>
}
/>
......@@ -15145,7 +15156,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[11]).toFixed(1)}
value={Number(handleMTDPercent(tableMeta, 2, 5)).toFixed(1)}
/>
}
/>
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