Commit 9084700c authored by d.arizona's avatar d.arizona

update CF

parent 5414d716
...@@ -88,6 +88,7 @@ export default class CashFlowMR extends Component { ...@@ -88,6 +88,7 @@ export default class CashFlowMR extends Component {
// console.log(checkApprover) // console.log(checkApprover)
// console.log(checkPrevRev) // console.log(checkPrevRev)
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev }) this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
// this.setState({viewOnly: true})
} }
componentDidMount() { componentDidMount() {
...@@ -346,10 +347,7 @@ export default class CashFlowMR extends Component { ...@@ -346,10 +347,7 @@ export default class CashFlowMR extends Component {
} }
}) })
// console.log(tableMeta.rowData[5])
// console.log(splitFormula)
// console.log(baru)
// console.log(anjay)
let anjay2 = [] let anjay2 = []
let kurung = false let kurung = false
...@@ -402,24 +400,52 @@ export default class CashFlowMR extends Component { ...@@ -402,24 +400,52 @@ export default class CashFlowMR extends Component {
} }
}) })
if (index == anjay2.length - 1) { // if (index == anjay2.length - 1) {
// if (opt == "tambah") {
// total = Number(total) + Number(totalPrio)
// } else if (opt == "kurang") {
// total = Number(total) - Number(totalPrio)
// } else if (opt == "kali") {
// total = Number(total) * Number(totalPrio)
// } else if (opt == "bagi") {
// total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
// } else {
// total += Number(totalPrio)
// }
// }
// if (opt == "") {
// total = Number(Number(total) + Number(totalPrio))
// } else {
if (opt == "tambah") { if (opt == "tambah") {
total = Number(total) + Number(totalPrio) total = Number(total) + Number(totalPrio)
totalPrio = 0
} else if (opt == "kurang") { } else if (opt == "kurang") {
total = Number(total) - Number(totalPrio) total = Number(total) - Number(totalPrio)
totalPrio = 0
} else if (opt == "kali") { } else if (opt == "kali") {
total = Number(total) * Number(totalPrio) total = Number(total) * Number(totalPrio)
totalPrio = 0
} else if (opt == "bagi") { } else if (opt == "bagi") {
total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio) total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
} else { totalPrio = 0
total += Number(totalPrio)
} }
} // }
// if (tableMeta.rowData[5] == '3.2 Movement of SHL and intercompany loan (nett)') {
// console.log(totalPrio)
// console.log(opt)
// console.log(total)
// }
} else { } else {
// const handleReturn = (x,y) => {
// return Number(totalXYZ)
// }
if (item == "+") { if (item == "+") {
opt = "tambah" opt = "tambah"
if (prio) { if (prio) {
total = Number(Number(totalPrio) + Number(total)) total = Number(Number(totalPrio) + Number(total))
// total = handleReturn()
prio = false prio = false
totalPrio = 0 totalPrio = 0
optPrio = "" optPrio = ""
...@@ -428,6 +454,7 @@ export default class CashFlowMR extends Component { ...@@ -428,6 +454,7 @@ export default class CashFlowMR extends Component {
opt = "kurang" opt = "kurang"
if (prio) { if (prio) {
total = Number(Number(totalPrio) + Number(total)) total = Number(Number(totalPrio) + Number(total))
// total = handleReturn()
prio = false prio = false
totalPrio = 0 totalPrio = 0
optPrio = "" optPrio = ""
...@@ -436,6 +463,7 @@ export default class CashFlowMR extends Component { ...@@ -436,6 +463,7 @@ export default class CashFlowMR extends Component {
opt = "kali" opt = "kali"
if (prio) { if (prio) {
total = Number(Number(totalPrio) + Number(total)) total = Number(Number(totalPrio) + Number(total))
// total = handleReturn()
prio = false prio = false
totalPrio = 0 totalPrio = 0
optPrio = "" optPrio = ""
...@@ -444,6 +472,7 @@ export default class CashFlowMR extends Component { ...@@ -444,6 +472,7 @@ export default class CashFlowMR extends Component {
opt = "bagi" opt = "bagi"
if (prio) { if (prio) {
total = Number(Number(totalPrio) + Number(total)) total = Number(Number(totalPrio) + Number(total))
// total = handleReturn()
prio = false prio = false
totalPrio = 0 totalPrio = 0
optPrio = "" optPrio = ""
...@@ -464,6 +493,15 @@ export default class CashFlowMR extends Component { ...@@ -464,6 +493,15 @@ export default class CashFlowMR extends Component {
} }
}) })
// if (tableMeta.rowData[5] == '3.2 Movement of SHL and intercompany loan (nett)' || tableMeta.rowData[5] == '3.6 Other') {
// console.log(tableMeta.rowData[5])
// console.log(splitFormula)
// console.log(baru)
// console.log(anjay)
// console.log(anjay2)
// console.log(total)
// }
dataTable2[tableMeta.rowIndex][6].value = total dataTable2[tableMeta.rowIndex][6].value = total
return total return total
......
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