Commit afd8c0a8 authored by d.arizona's avatar d.arizona

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into didam

parents 72839e64 d9a1f719
......@@ -485,6 +485,7 @@ export default class TableSubHolding extends Component {
}
const handleFormulaRatio = (value, tableMeta, month) => {
// console.log(dataTable2)
let total = 0
if (month > 12) {
total = Number(dataTable2[35][7 + month])
......@@ -500,6 +501,23 @@ export default class TableSubHolding extends Component {
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 = [{
name: "",
options: {
......@@ -3816,7 +3834,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
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