Commit 5235ad91 authored by d.arizona's avatar d.arizona

takse pleninge

parent 22c0e97f
......@@ -728,7 +728,7 @@ export default class TaxPlanning extends Component {
let dataFormula = []
let id = 0
let double = false
const handleValueFormula = (value, tableMeta, dex, xntd) => {
const handleValueFormula = (value, tableMeta, dex, xntd, forecast, periode) => {
// console.log(xntd)
let form = dex === 1 ? tableMeta.rowData[6].tbc : dex === 2 ? tableMeta.rowData[6].fcp : tableMeta.rowData[6].tbf
let splitFormula = String(form).split('@')
......@@ -748,7 +748,11 @@ export default class TaxPlanning extends Component {
}
})
if (tableMeta.rowData[8] == "Under payment /(Over Payment ) Income Tax Art. 29") {
// if (forecast !== undefined) {
// console.log(splitFormula)
// }
if (tableMeta.rowData[8] == "Under payment /(Over Payment ) Income Tax Art. 29" || forecast !== undefined) {
// form.replace("(", "")
// form.replace(")", "")
let opgab = []
......@@ -764,7 +768,7 @@ export default class TaxPlanning extends Component {
baru = opgab
}
}
let totalShldBeNil = 0
baru.map((item, index) => {
if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') {
anjay.push(item)
......@@ -779,7 +783,14 @@ export default class TaxPlanning extends Component {
anjay.push(valuezz == "" ? 0 : valuezz)
}
} else {
if (String(item).includes('[M-1]')) {
if (forecast !== undefined) {
forecast.map((item,index) => {
if (periode == item.periode) {
totalShldBeNil += Number(item.value)
}
})
anjay.push(totalShldBeNil)
} else if (String(item).includes('[M-1]')) {
let tst = String(item).replace('[M-1]', '')
let data = tableMeta.columnIndex == 9 ? 20 : tableMeta.columnIndex - 1
let dataSub = dex == 1 ? tableMeta.rowData[data].tbc : dex == 2 ? tableMeta.rowData[data].fcp : tableMeta.rowData[data].tbf
......@@ -899,16 +910,16 @@ export default class TaxPlanning extends Component {
total = R.equals(total, NaN) ? "0.0" : total
// console.log(tableMeta.rowData[8])
if (xntd !== undefined && tableMeta.rowData[8] == "Under payment /(Over Payment ) Income Tax Art. 29") {
console.log(tableMeta.rowData[8])
// console.log(splitFormula)
console.log(xntd)
console.log(baru)
console.log(anjay)
console.log(total)
console.log(total2)
console.log(opt)
}
// if (xntd !== undefined && tableMeta.rowData[8] == "Under payment /(Over Payment ) Income Tax Art. 29") {
// console.log(tableMeta.rowData[8])
// // console.log(splitFormula)
// console.log(xntd)
// console.log(baru)
// console.log(anjay)
// console.log(total)
// console.log(total2)
// console.log(opt)
// }
// let dataSub = dex == 1? dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc : dex == 2? dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp : dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf
if (dex == 1) {
......@@ -940,14 +951,19 @@ export default class TaxPlanning extends Component {
// console.log(dex)
let data = dex == 1? dataTable2[tableMeta.rowIndex][6].tbc : dex == 2? dataTable2[tableMeta.rowIndex][6].fcp : dataTable2[tableMeta.rowIndex][6].tbf
// let valuue =
// if (tableMeta.rowData[8] == '')
let forecast = dex == 1 ? dataTable2[tableMeta.rowIndex][27] : dex == 2? dataTable2[tableMeta.rowIndex][28] : dataTable2[tableMeta.rowIndex][29]
if (data.includes('#PL')) {
// console.log(tableMeta.rowData[8])
if (tableMeta.rowData[8] == "Control (should be nil)") {
total = handleValueFormula(5, tableMeta, dex, data, forecast, periode)
} else {
forecast.map((item,index) => {
if (periode == item.periode) {
total += Number(item.value)
}
})
}
} else {
// console.log(tableMeta.rowData[8])
// console.log(data)
......
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