Commit 5bf1a946 authored by r.kurnia's avatar r.kurnia

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into rifka

parents 5c55ae8c f12a4977
......@@ -394,6 +394,11 @@ export default class CashFlow extends Component {
const handleValueFormula = (value, tableMeta, column, periode, forecast) => {
loading = true
let splitFormula = String(tableMeta.rowData[3]).split(/([()@])/)
// if (tableMeta.rowData[5] == "Cash at the end of the period" && column == 7) {
// console.log(splitFormula + " aaa");
// splitFormula = String("@2#BS").split(/([()@])/);
// console.log(splitFormula + " bbb");
// }
let baru = []
let anjay = []
......@@ -427,14 +432,14 @@ export default class CashFlow extends Component {
let indexID = tableMeta.rowData[data].formula.findIndex((val) => val.item_formula == String(`@${tst}`) && val.periode == period)
if (indexID !== -1) {
let valuezz = tableMeta.rowData[data].formula[indexID].value
if (tableMeta.rowData[5] == "Cash at the beginning period") {
// console.log(dataTable2[tableMeta.rowIndex+1])
// console.log(dataTable2[tableMeta.rowIndex+1][data].value)
let valuezzz = dataTable2[tableMeta.rowIndex][7].value
forecastt += Number(valuezzz == "" ? 0 : valuezzz)
} else {
// if (tableMeta.rowData[5] == "Cash at the beginning period") {
// // console.log(dataTable2[tableMeta.rowIndex+1])
// // console.log(dataTable2[tableMeta.rowIndex+1][data].value)
// let valuezzz = dataTable2[tableMeta.rowIndex][7].value
// forecastt += Number(valuezzz == "" ? 0 : valuezzz)
// } else {
forecastt += Number(valuezz == "" ? 0 : valuezz)
}
// }
}
}
......@@ -445,12 +450,12 @@ export default class CashFlow extends Component {
let indexID = tableMeta.rowData[data].formula.findIndex((val) => val.item_formula == String(`@${tst}`) && val.periode == period)
if (indexID !== -1) {
let valuezz = tableMeta.rowData[data].formula[indexID].value
if (tableMeta.rowData[5] == "Cash at the beginning period") {
let valuezzz = dataTable2[tableMeta.rowIndex + 1][19]
forecastt += Number(valuezzz == "" ? 0 : valuezzz)
} else {
// if (tableMeta.rowData[5] == "Cash at the beginning period") {
// let valuezzz = dataTable2[tableMeta.rowIndex + 1][19]
// forecastt += Number(valuezzz == "" ? 0 : valuezzz)
// } else {
forecastt += Number(valuezz == "" ? 0 : valuezz)
}
// }
}
}
......@@ -460,12 +465,12 @@ export default class CashFlow extends Component {
let indexID = forecast.findIndex((val) => String(val.item_formula).replace('forecast_', '') == String(`@${tst}`) && val.periode == period)
if (indexID !== -1) {
let valuezz = forecast[indexID].value
if (tableMeta.rowData[5] == "Cash at the beginning period") {
let valuezzz = dataTable2[tableMeta.rowIndex + 1][20]
forecastt += Number(valuezzz == "" ? 0 : valuezzz)
} else {
// if (tableMeta.rowData[5] == "Cash at the beginning period") {
// let valuezzz = dataTable2[tableMeta.rowIndex + 1][20]
// forecastt += Number(valuezzz == "" ? 0 : valuezzz)
// } else {
forecastt += Number(valuezz == "" ? 0 : valuezz)
}
// }
}
}
......@@ -477,19 +482,19 @@ export default class CashFlow extends Component {
let indexID = tableMeta.rowData[data].formula.findIndex((val) => val.item_formula == String(`@${tst}`) && val.periode == period)
if (indexID !== -1) {
let valuezz = tableMeta.rowData[data].formula[indexID].value
if (tableMeta.rowData[5] == "Cash at the beginning period" && column != 7) {
// console.log(data)
// console.log(dataTable2[tableMeta.rowIndex+1][5])
// console.log(dataTable2[tableMeta.rowIndex+1][data])
// console.log(dataTable2[tableMeta.rowIndex-1][data].value)
// console.log(dataTable2[tableMeta.rowIndex][data].value)
// console.log(dataTable2[tableMeta.rowIndex+1][data].value)
let valuezzz = dataTable2[tableMeta.rowIndex + 1][data].value
anjay.push(valuezzz == "" ? 0 : valuezzz)
} else {
let valuezz = tableMeta.rowData[5] == "Audit and other adjustment" && column == 7 ? 0 : tableMeta.rowData[data].formula[indexID].value
// if (tableMeta.rowData[5] == "Cash at the beginning period" && column != 7) {
// // console.log(data)
// // console.log(dataTable2[tableMeta.rowIndex+1][5])
// // console.log(dataTable2[tableMeta.rowIndex+1][data])
// // console.log(dataTable2[tableMeta.rowIndex-1][data].value)
// // console.log(dataTable2[tableMeta.rowIndex][data].value)
// // console.log(dataTable2[tableMeta.rowIndex+1][data].value)
// let valuezzz = dataTable2[tableMeta.rowIndex + 1][data].value
// anjay.push(valuezzz == "" ? 0 : valuezzz)
// } else {
anjay.push(valuezz == "" ? 0 : valuezz)
}
// }
}
}
} else {
......@@ -708,12 +713,15 @@ export default class CashFlow extends Component {
// }
// }
if (tableMeta.rowData[5] == '2.1 Additional fixed assets and CIP' && column == 7) {
if (tableMeta.rowData[5] == "Cash at the end of the period" && column == 7) {
console.log(splitFormula)
console.log(baru)
console.log(anjay)
console.log(anjay2)
console.log(total)
let testttt = dataTable2[tableMeta.rowIndex - 1][8].value
console.log(testttt)
total = testttt
}
if (dataTable2[tableMeta.rowIndex][column].value == undefined) {
......
......@@ -683,13 +683,16 @@ export default class CashFlow extends Component {
total = R.equals(total, NaN) ? "0.0" : total
if (tableMeta.rowData[2] == 'Income Tax') {
if (tableMeta.rowData[5] == "Cash at the end of the period" && column == 6) {
console.log(tableMeta.rowData)
console.log(splitFormula)
console.log(baru)
console.log(anjay)
console.log(anjay2)
console.log(total)
let testttt = dataTable2[tableMeta.rowIndex - 1][7].value
console.log(testttt)
total = testttt
}
if (dataTable2[tableMeta.rowIndex][column].value == undefined) {
......
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