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

Merge branch 'didam' into 'master'

apdet gays

See merge request !545
parents 7a0efa59 19b6a282
......@@ -136,18 +136,56 @@ export default class CashFlow extends Component {
const handleValueFormula = (value, tableMeta, column) => {
// console.log(value)
// console.log(dataTable2[tableMeta.rowIndex])
// let splitFormula = String(tableMeta.rowData[3]).split(/([()@])/)
let splitFormula = String(tableMeta.rowData[3]).split('@')
// console.log(splitFormula)
let baru = []
let anjay = []
splitFormula.map((item, index) => {
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 asd = ''
if (item !== "") {
if (!re.test(items)) {
baru.push(String(item).substr(0, Number(String(item).length) - 1))
baru.push(String(item).substr(Number(String(item).length) - 1, 1))
let itemss = String(subForm).substr(Number(String(subForm).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 {
baru.push(String(item))
}
......@@ -158,7 +196,8 @@ export default class CashFlow extends Component {
// console.log(splitFormula)
// console.log(baru)
// }
console.log(baru)
// console.log(tableMeta.rowData[3])
// console.log(baru)
baru.map((item, index) => {
if (item == '-' || item == '+' || item == '/' || item == '*'|| item == '(' || item == ')') {
anjay.push(item)
......@@ -170,11 +209,19 @@ export default class CashFlow extends Component {
let period = data == 18 ? Number(this.props.periode) - 1 : this.props.periode
// console.log(data)
// console.log(column)
// console.log(tableMeta.rowData)
// console.log(tableMeta.rowData[data])
let indexID = tableMeta.rowData[data].formula.findIndex((val) => val.item_formula == String(`@${tst}`) && val.periode == period)
// // console.log(indexID)
if (item == '79[M-1]#BS') {
console.log(tableMeta.rowData)
console.log(tableMeta.rowData[data].formula)
}
if (indexID !== -1) {
if (item == '79[M-1]#BS') {
console.log(tableMeta.rowData[data].formula[indexID])
}
let valuezz = tableMeta.rowData[data].formula[indexID].value
// baru.push(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