Commit 92930d4b authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

apdet

See merge request !786
parents 01c05bf3 76ae7cba
...@@ -731,17 +731,17 @@ export default class CorporateAnnualTarget extends Component { ...@@ -731,17 +731,17 @@ export default class CorporateAnnualTarget extends Component {
let valReal = Number(i[7] == "" || i[7] == undefined ? 0 : i[7].replace('%', '')) let valReal = Number(i[7] == "" || i[7] == undefined ? 0 : i[7].replace('%', ''))
let totalBaru = valChild + valReal let totalBaru = valChild + valReal
if (totalBaru > weightParent) { if (totalBaru > weightParent) {
dataTableBaru[index][7] = `${(weightParent - valChild)}%` dataTableBaru[index][7] = `${String(Number(weightParent - valChild).toFixed(1)) + '%'}`
dataTampung[indexID].valChild = dataTampung[indexID].valChild + weightParent - valChild dataTampung[indexID].valChild = dataTampung[indexID].valChild + weightParent - valChild
weightReal = `${(weightParent - valChild)}%` weightReal = `${String(Number(weightParent - valChild).toFixed(1)) + '%'}`
} else { } else {
dataTableBaru[index][7] = i[7] dataTableBaru[index][7] = i[7]
weightReal = i[7] weightReal = i[7]
dataTampung[indexID].valChild = dataTampung[indexID].valChild + Number(i[7] == "" || i[7] == undefined ? 0 : i[7].replace('%', '')) dataTampung[indexID].valChild = dataTampung[indexID].valChild + Number(i[7] == "" || i[7] == undefined ? 0 : i[7].replace('%', ''))
} }
// // // // console.log(weightReal) // // // // console.log(weightReal)
// // // // console.log(dataTableBaru[index][7]) // console.log(dataTableBaru[index][7])
// // // // console.log(dataTampung[indexID].valChild) // console.log(dataTampung[indexID].valChild)
} }
} }
// // console.log(String(weightReal).substr(0,String(weightReal).length-1)) // // console.log(String(weightReal).substr(0,String(weightReal).length-1))
...@@ -750,7 +750,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -750,7 +750,7 @@ export default class CorporateAnnualTarget extends Component {
"item_report_id": i[1] == "" || i[1] == null ? 0 : i[1], "item_report_id": i[1] == "" || i[1] == null ? 0 : i[1],
"item_name": String(i[6]), "item_name": String(i[6]),
"parent": i[2] == "" ? null : i[2], "parent": i[2] == "" ? null : i[2],
"weight": weightReal == null ? String(i[7]) : String(Number(String(weightReal).substr(0,String(weightReal).length-1)).toFixed(1)) + '%', "weight": weightReal == null ? String(i[7]) : weightReal,
"uom": String(i[8]), "uom": String(i[8]),
"kpi_type": i[9] == null ? "" : i[9].value, "kpi_type": i[9] == null ? "" : i[9].value,
"max_ach": i[10] == null ? "" : i[10].value, "max_ach": i[10] == null ? "" : i[10].value,
......
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