Commit 2b88a4a9 authored by rifkaki's avatar rifkaki

bs

parents 346c1b44 1beb8772
...@@ -417,7 +417,7 @@ export default class BalanceSheetMR extends Component { ...@@ -417,7 +417,7 @@ export default class BalanceSheetMR extends Component {
"months": this.props.month.month_id, "months": this.props.month.month_id,
"balance_sheet": data "balance_sheet": data
} }
console.log(body);
// console.log(JSON.stringify(body)); // console.log(JSON.stringify(body));
console.log(body) console.log(body)
api.create('UPLOAD').uploadMonthlyReportBS(body).then(response => { api.create('UPLOAD').uploadMonthlyReportBS(body).then(response => {
......
...@@ -365,12 +365,12 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -365,12 +365,12 @@ export default class FixedAssetsMovementMR extends Component {
"mtd_rb": i[7], "mtd_rb": i[7],
"mtd_actual": i[8], "mtd_actual": i[8],
"act_previous_month": i[9], "act_previous_month": i[9],
"act_vs_prev_month_amount": i[10], "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": i[11], "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": i[12], "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": i[13], "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": i[14], "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": i[15] "act_vs_rb_percent": String(i[15]) === 'NaN' || String(i[15]) === 'Infinity' || String(i[15]) === '-Infinity' ? '0.0' : String(i[15])
}) })
}) })
let payload = { let payload = {
...@@ -439,17 +439,20 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -439,17 +439,20 @@ export default class FixedAssetsMovementMR extends Component {
}) })
// console.log(baru); // console.log(baru);
let tambahan = false
let opet = ""
baru.map((item, index) => { 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) anjay.push(item)
} else { } else {
if (String(item).includes('#')) { if (String(item).includes('#')) {
if (String(item).includes('[M-1]')) { 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(dataTable2[tableMeta.rowIndex]);
// console.log(tableMeta); // console.log(tableMeta);
// console.log(tst); console.log(tst);
let indexID = dataTable2[tableMeta.rowIndex][16].findIndex((val) => val.item_formula == tst) let indexID = dataTable2[tableMeta.rowIndex][16].findIndex((val) => val.item_formula == tst)
// console.log(indexID); // console.log(indexID);
...@@ -476,6 +479,17 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -476,6 +479,17 @@ export default class FixedAssetsMovementMR extends Component {
} }
} else { } else {
let indexID = dataTable2.findIndex((val) => val[17] == item) let indexID = dataTable2.findIndex((val) => val[17] == item)
if (item == 'X-1') {
anjay.push(-1)
} else if (tambahan) {
if (item == '-' || item == '+' || item == '/' || item == '*') {
opet = item
} else {
anjay.push(opet == ''? Number(item) : Number(String(opet + String(item))))
tambahan = false
opet = ""
}
} else {
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = dataTable2[indexID][colIdx] let valuezz = dataTable2[indexID][colIdx]
if (item == dataTable2[tableMeta.rowIndex][28]) { if (item == dataTable2[tableMeta.rowIndex][28]) {
...@@ -491,6 +505,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -491,6 +505,7 @@ export default class FixedAssetsMovementMR extends Component {
} }
} }
} }
}
}) })
let anjay2 = [] let anjay2 = []
...@@ -661,7 +676,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -661,7 +676,7 @@ export default class FixedAssetsMovementMR extends Component {
// console.log(tableMeta.rowData[8]); // console.log(tableMeta.rowData[8]);
// console.log(tableMeta.rowData[9]); // console.log(tableMeta.rowData[9]);
// console.log(total) // console.log(total)
// } else if (dex === 2) { } else if (dex === 2) {
total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[6]) == NaN? "0.0" : Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[6]) 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) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
// console.log(tableMeta.rowData[8]); // console.log(tableMeta.rowData[8]);
...@@ -670,9 +685,9 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -670,9 +685,9 @@ export default class FixedAssetsMovementMR extends Component {
} else if (dex === 3) { } else if (dex === 3) {
total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[7]) == NaN? "0.0" : Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[7]) total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[7]) == NaN? "0.0" : Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[7])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
console.log(tableMeta.rowData[8]); // console.log(tableMeta.rowData[8]);
console.log(tableMeta.rowData[7]); // console.log(tableMeta.rowData[7]);
console.log(total) // console.log(total)
} }
return total return total
} }
...@@ -1042,7 +1057,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -1042,7 +1057,7 @@ export default class FixedAssetsMovementMR extends Component {
<div className="grid grid-2x content-center"> <div className="grid grid-2x content-center">
<div className="column-1"> <div className="column-1">
<div style={{ textAlign: 'right', width: 120 }}> <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 : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <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