Commit 5390f937 authored by rifkaki's avatar rifkaki

tbsubhold

parent bf35abb2
...@@ -485,6 +485,7 @@ export default class TableSubHolding extends Component { ...@@ -485,6 +485,7 @@ export default class TableSubHolding extends Component {
} }
const handleFormulaRatio = (value, tableMeta, month) => { const handleFormulaRatio = (value, tableMeta, month) => {
// console.log(dataTable2)
let total = 0 let total = 0
if (month > 12) { if (month > 12) {
total = Number(dataTable2[35][7 + month]) total = Number(dataTable2[35][7 + month])
...@@ -500,6 +501,23 @@ export default class TableSubHolding extends Component { ...@@ -500,6 +501,23 @@ export default class TableSubHolding extends Component {
return Number(hasil).toFixed(1) return Number(hasil).toFixed(1)
} }
const handleFormulaRatioMR = (value, tableMeta, month) => {
console.log(dataTable2)
let total = 0
if (month > 12) {
total = Number(dataTable2[35][21 + month])
} else {
for (let index = 0; index < month; index++) {
total += Number(dataTable2[35][22 + index])
// console.log(index);
}
total = total/month
}
let hasil = Number(value) / total
// console.log(hasil, value, total);
return Number(hasil).toFixed(1)
}
const columnDBBS = [{ const columnDBBS = [{
name: "", name: "",
options: { options: {
...@@ -3816,7 +3834,7 @@ export default class TableSubHolding extends Component { ...@@ -3816,7 +3834,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormulaRatio(tableMeta.rowData[22], tableMeta, 1)} value={handleFormulaRatioMR(tableMeta.rowData[22], tableMeta, 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