Commit 3fe47993 authored by Riri Novita's avatar Riri Novita

FAM

parent 2dbf25a3
......@@ -365,12 +365,12 @@ export default class FixedAssetsMovementMR extends Component {
"mtd_rb": i[7],
"mtd_actual": i[8],
"act_previous_month": i[9],
"act_vs_prev_month_amount": i[10],
"act_vs_prev_month_percent": i[11],
"act_vs_mb_amount": i[12],
"act_vs_mb_percent": i[13],
"act_vs_rb_amount": i[14],
"act_vs_rb_percent": i[15]
"act_vs_prev_month_amount": String(i[10]) === 'NaN' || String(i[10]) === 'Infinity' || String(i[10]) === '-Infinity' ? '0.0' : String(i[10]) ,
"act_vs_prev_month_percent": String(i[11]) === 'NaN' || String(i[11]) === 'Infinity' || String(i[11]) === '-Infinity' ? '0.0' : String(i[11]),
"act_vs_mb_amount": String(i[12]) === 'NaN' || String(i[12]) === 'Infinity' || String(i[12]) === '-Infinity' ? '0.0' : String(i[12]),
"act_vs_mb_percent": String(i[13]) === 'NaN' || String(i[13]) === 'Infinity' || String(i[13]) === '-Infinity' ? '0.0' : String(i[13]),
"act_vs_rb_amount": String(i[14]) === 'NaN' || String(i[14]) === 'Infinity' || String(i[14]) === '-Infinity' ? '0.0' : String(i[14]),
"act_vs_rb_percent": String(i[15]) === 'NaN' || String(i[15]) === 'Infinity' || String(i[15]) === '-Infinity' ? '0.0' : String(i[15])
})
})
let payload = {
......@@ -439,17 +439,20 @@ export default class FixedAssetsMovementMR extends Component {
})
// console.log(baru);
let tambahan = false
let opet = ""
baru.map((item, index) => {
if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') {
if (item == 'X') {
tambahan = true
} else if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') {
anjay.push(item)
} else {
if (String(item).includes('#')) {
if (String(item).includes('[M-1]')) {
let tst = String(item).replace('[M-1]', '[M1]')
let tst = '@' + String(item).replace('[M-1]', '[M1]')
// console.log(dataTable2[tableMeta.rowIndex]);
// console.log(tableMeta);
// console.log(tst);
console.log(tst);
let indexID = dataTable2[tableMeta.rowIndex][16].findIndex((val) => val.item_formula == tst)
// console.log(indexID);
......@@ -476,16 +479,28 @@ export default class FixedAssetsMovementMR extends Component {
}
} else {
let indexID = dataTable2.findIndex((val) => val[17] == item)
if (indexID !== -1) {
let valuezz = dataTable2[indexID][colIdx]
if (item == dataTable2[tableMeta.rowIndex][28]) {
anjay.push(0)
if (item == 'X-1') {
anjay.push(-1)
} else if (tambahan) {
if (item == '-' || item == '+' || item == '/' || item == '*') {
opet = item
} else {
anjay.push(valuezz == "" ? 0 : valuezz)
anjay.push(opet == ''? Number(item) : Number(String(opet + String(item))))
tambahan = false
opet = ""
}
} else {
if (item === '(-1)') {
anjay.push(-1)
if (indexID !== -1) {
let valuezz = dataTable2[indexID][colIdx]
if (item == dataTable2[tableMeta.rowIndex][28]) {
anjay.push(0)
} else {
anjay.push(valuezz == "" ? 0 : valuezz)
}
} else {
if (item === '(-1)') {
anjay.push(-1)
}
}
}
}
......@@ -658,9 +673,9 @@ export default class FixedAssetsMovementMR extends Component {
if (dex === 1) {
total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[9]) == NaN? "0.0" : Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[9])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
// console.log(tableMeta.rowData[8]);
// console.log(tableMeta.rowData[9]);
// console.log(total)
// console.log(tableMeta.rowData[8]);
// console.log(tableMeta.rowData[9]);
// console.log(total)
} else if (dex === 2) {
total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[6]) == NaN? "0.0" : Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[6])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
......@@ -1042,7 +1057,7 @@ export default class FixedAssetsMovementMR extends Component {
<div className="grid grid-2x content-center">
<div className="column-1">
<div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
......
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