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 { ...@@ -520,9 +520,11 @@ export default class BalanceSheetMR extends Component {
if (String(item).includes('#')) { if (String(item).includes('#')) {
if (String(item).includes('[M-1]')) { if (String(item).includes('[M-1]')) {
let tst = String(item).replace('[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) { if (indexID !== -1) {
let valuezz = dataTable2[indexID][9] let valuezz = data[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
} }
} else { } else {
...@@ -584,9 +586,11 @@ export default class BalanceSheetMR extends Component { ...@@ -584,9 +586,11 @@ export default class BalanceSheetMR extends Component {
let totalPrio = 0 let totalPrio = 0
let optPrio = "" let optPrio = ""
let prio = false let prio = false
let optPrev = ""
anjay2.map((item, index) => { anjay2.map((item, index) => {
if (Array.isArray(item)) { if (Array.isArray(item)) {
prio = true prio = true
optPrev = opt
item.map((items, indexs) => { item.map((items, indexs) => {
if (items == "+") { if (items == "+") {
optPrio = "tambah" optPrio = "tambah"
...@@ -628,7 +632,17 @@ export default class BalanceSheetMR extends Component { ...@@ -628,7 +632,17 @@ export default class BalanceSheetMR extends Component {
if (item == "+") { if (item == "+") {
opt = "tambah" opt = "tambah"
if (prio) { 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 prio = false
totalPrio = 0 totalPrio = 0
optPrio = "" optPrio = ""
...@@ -636,7 +650,17 @@ export default class BalanceSheetMR extends Component { ...@@ -636,7 +650,17 @@ export default class BalanceSheetMR extends Component {
} else if (item == "-") { } else if (item == "-") {
opt = "kurang" opt = "kurang"
if (prio) { 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 prio = false
totalPrio = 0 totalPrio = 0
optPrio = "" optPrio = ""
...@@ -644,7 +668,17 @@ export default class BalanceSheetMR extends Component { ...@@ -644,7 +668,17 @@ export default class BalanceSheetMR extends Component {
} else if (item == "*") { } else if (item == "*") {
opt = "kali" opt = "kali"
if (prio) { 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 prio = false
totalPrio = 0 totalPrio = 0
optPrio = "" optPrio = ""
...@@ -652,7 +686,17 @@ export default class BalanceSheetMR extends Component { ...@@ -652,7 +686,17 @@ export default class BalanceSheetMR extends Component {
} else if (item == "/") { } else if (item == "/") {
opt = "bagi" opt = "bagi"
if (prio) { 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 prio = false
totalPrio = 0 totalPrio = 0
optPrio = "" 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