Commit ef68e97c authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

ketinggalan

See merge request !751
parents 23bdd5de 43490a74
......@@ -520,9 +520,11 @@ export default class BalanceSheetMR extends Component {
if (String(item).includes('#')) {
if (String(item).includes('[M-1]')) {
let tst = String(item).replace('[M-1]', '')
let indexID = dataTable2.findIndex((val) => val[21] == tst)
// let indexID = dataTable2.findIndex((val) => val[21] == tst)
let data = tableMeta.rowData[20]
let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`))
if (indexID !== -1) {
let valuezz = dataTable2[indexID][9]
let valuezz = data[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz)
}
} else {
......@@ -584,9 +586,11 @@ export default class BalanceSheetMR extends Component {
let totalPrio = 0
let optPrio = ""
let prio = false
let optPrev = ""
anjay2.map((item, index) => {
if (Array.isArray(item)) {
prio = true
optPrev = opt
item.map((items, indexs) => {
if (items == "+") {
optPrio = "tambah"
......@@ -628,7 +632,17 @@ export default class BalanceSheetMR extends Component {
if (item == "+") {
opt = "tambah"
if (prio) {
total = Number(Number(totalPrio) + Number(total))
if (optPrev == "tambah") {
total = Number(total) + Number(totalPrio)
} else if (optPrev == "kurang") {
total = Number(total) - Number(totalPrio)
} else if (optPrev == "kali") {
total = Number(total) * Number(totalPrio)
} else if (optPrev == "bagi") {
total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
} else {
total += Number(totalPrio)
}
prio = false
totalPrio = 0
optPrio = ""
......@@ -636,7 +650,17 @@ export default class BalanceSheetMR extends Component {
} else if (item == "-") {
opt = "kurang"
if (prio) {
total = Number(Number(totalPrio) + Number(total))
if (optPrev == "tambah") {
total = Number(total) + Number(totalPrio)
} else if (optPrev == "kurang") {
total = Number(total) - Number(totalPrio)
} else if (optPrev == "kali") {
total = Number(total) * Number(totalPrio)
} else if (optPrev == "bagi") {
total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
} else {
total += Number(totalPrio)
}
prio = false
totalPrio = 0
optPrio = ""
......@@ -644,7 +668,17 @@ export default class BalanceSheetMR extends Component {
} else if (item == "*") {
opt = "kali"
if (prio) {
total = Number(Number(totalPrio) + Number(total))
if (optPrev == "tambah") {
total = Number(total) + Number(totalPrio)
} else if (optPrev == "kurang") {
total = Number(total) - Number(totalPrio)
} else if (optPrev == "kali") {
total = Number(total) * Number(totalPrio)
} else if (optPrev == "bagi") {
total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
} else {
total += Number(totalPrio)
}
prio = false
totalPrio = 0
optPrio = ""
......@@ -652,7 +686,17 @@ export default class BalanceSheetMR extends Component {
} else if (item == "/") {
opt = "bagi"
if (prio) {
total = Number(Number(totalPrio) + Number(total))
if (optPrev == "tambah") {
total = Number(total) + Number(totalPrio)
} else if (optPrev == "kurang") {
total = Number(total) - Number(totalPrio)
} else if (optPrev == "kali") {
total = Number(total) * Number(totalPrio)
} else if (optPrev == "bagi") {
total = Number(total) / Number(totalPrio) == NaN ? 0 : Number(total) / Number(totalPrio)
} else {
total += Number(totalPrio)
}
prio = false
totalPrio = 0
optPrio = ""
......
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