Commit 19b6a282 authored by d.arizona's avatar d.arizona

apdet gays

parent 408e1f6f
...@@ -136,18 +136,56 @@ export default class CashFlow extends Component { ...@@ -136,18 +136,56 @@ export default class CashFlow extends Component {
const handleValueFormula = (value, tableMeta, column) => { const handleValueFormula = (value, tableMeta, column) => {
// console.log(value) // console.log(value)
// console.log(dataTable2[tableMeta.rowIndex]) // console.log(dataTable2[tableMeta.rowIndex])
// let splitFormula = String(tableMeta.rowData[3]).split(/([()@])/)
let splitFormula = String(tableMeta.rowData[3]).split('@') let splitFormula = String(tableMeta.rowData[3]).split('@')
// console.log(splitFormula) // console.log(splitFormula)
let baru = [] let baru = []
let anjay = [] let anjay = []
splitFormula.map((item, index) => { splitFormula.map((item, index) => {
let items = String(item).substr(Number(String(item).length) - 1, 1) let items = String(item).substr(Number(String(item).length) - 1, 1)
let subForm = String(item).substr(0, Number(String(item).length) - 1)
let re = /^[a-zA-Z0-9_]+$/; let re = /^[a-zA-Z0-9_]+$/;
let asd = '' let asd = ''
if (item !== "") { if (item !== "") {
if (!re.test(items)) { if (!re.test(items)) {
baru.push(String(item).substr(0, Number(String(item).length) - 1)) let itemss = String(subForm).substr(Number(String(subForm).length) - 1, 1)
baru.push(String(item).substr(Number(String(item).length) - 1, 1)) let subForms = String(subForm).substr(0, Number(String(subForm).length) - 1)
if (subForm !== "") {
if (!re.test(itemss)) {
let itemsss = String(subForms).substr(Number(String(subForms).length) - 1, 1)
let subFormss = String(subForms).substr(0, Number(String(subForms).length) - 1)
if (subForms !== "") {
if (!re.test(itemsss)) {
let itemssss = String(subFormss).substr(Number(String(subFormss).length) - 1, 1)
let subFormsss = String(subFormss).substr(0, Number(String(subFormss).length) - 1)
if (subFormss !== "") {
if (!re.test(itemssss)) {
let itemsssss = String(subFormsss).substr(Number(String(subFormsss).length) - 1, 1)
let subFormssss = String(subFormsss).substr(0, Number(String(subFormsss).length) - 1)
if (subFormsss !== "") {
if (!re.test(itemsssss)) {
} else {
baru.push(subFormsss)
}
}
baru.push(itemsss)
} else {
baru.push(subFormss)
}
}
baru.push(itemsss)
} else {
baru.push(subForms)
}
}
baru.push(itemss)
} else {
baru.push(subForm)
}
}
// baru.push(String(item).substr(0, Number(String(item).length) - 1))
baru.push(items)
} else { } else {
baru.push(String(item)) baru.push(String(item))
} }
...@@ -158,7 +196,8 @@ export default class CashFlow extends Component { ...@@ -158,7 +196,8 @@ export default class CashFlow extends Component {
// console.log(splitFormula) // console.log(splitFormula)
// console.log(baru) // console.log(baru)
// } // }
console.log(baru) // console.log(tableMeta.rowData[3])
// console.log(baru)
baru.map((item, index) => { baru.map((item, index) => {
if (item == '-' || item == '+' || item == '/' || item == '*'|| item == '(' || item == ')') { if (item == '-' || item == '+' || item == '/' || item == '*'|| item == '(' || item == ')') {
anjay.push(item) anjay.push(item)
...@@ -170,11 +209,19 @@ export default class CashFlow extends Component { ...@@ -170,11 +209,19 @@ export default class CashFlow extends Component {
let period = data == 18 ? Number(this.props.periode) - 1 : this.props.periode let period = data == 18 ? Number(this.props.periode) - 1 : this.props.periode
// console.log(data) // console.log(data)
// console.log(column) // console.log(column)
// console.log(tableMeta.rowData) // console.log(tableMeta.rowData)
// console.log(tableMeta.rowData[data]) // console.log(tableMeta.rowData[data])
let indexID = tableMeta.rowData[data].formula.findIndex((val) => val.item_formula == String(`@${tst}`) && val.periode == period) let indexID = tableMeta.rowData[data].formula.findIndex((val) => val.item_formula == String(`@${tst}`) && val.periode == period)
// // console.log(indexID) // // console.log(indexID)
if (item == '79[M-1]#BS') {
console.log(tableMeta.rowData)
console.log(tableMeta.rowData[data].formula)
}
if (indexID !== -1) { if (indexID !== -1) {
if (item == '79[M-1]#BS') {
console.log(tableMeta.rowData[data].formula[indexID])
}
let valuezz = tableMeta.rowData[data].formula[indexID].value let valuezz = tableMeta.rowData[data].formula[indexID].value
// baru.push(valuezz) // baru.push(valuezz)
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
......
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