Commit 8eadc59d authored by Riri Novita's avatar Riri Novita

issue formula

parent 01971cb0
......@@ -722,8 +722,16 @@ export default class CashFlow extends Component {
let totalBeginning = dataTable2[tableMeta.rowIndex][18] = dataTable2[tableMeta.rowIndex][6].value
return totalBeginning
}else if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "cash at the end of the period") {
let totalEnd = dataTable2[tableMeta.rowIndex][18] = dataTable2[tableMeta.rowIndex][17].value
return totalEnd
let value = Number(dataTable2[tableMeta.rowIndex - 1][18]) + Number(dataTable2[tableMeta.rowIndex - 2][18])
return R.equals(value, NaN) ? "0.0" : (R.equals(value, Infinity) ? "0.0" : (value == "-Infinity" ? "0.0" : value))
} else if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "control (should be nil)") {
// console.log(dataTable2[tableMeta.rowIndex - 2][tableMeta.columnIndex + 11].value);
let cashOfTheEndFy = Number(dataTable2[tableMeta.rowIndex - 3][18]) + Number(dataTable2[tableMeta.rowIndex - 4][18])
let cahsOfTheEndDec = Number(dataTable2[tableMeta.rowIndex - 2][tableMeta.columnIndex + 11].value)
// console.log(cashOfTheEndFy);
console.log(cahsOfTheEndDec);
let value = Number(cashOfTheEndFy) - Number(cahsOfTheEndDec);
return R.equals(value, NaN) ? "0.0" : (R.equals(value, Infinity) ? "0.0" : (value == "-Infinity" ? "0.0" : value))
} else {
dataTable2[tableMeta.rowIndex][18] = total
return total
......
......@@ -123,13 +123,23 @@ export default class OutlookPA extends Component {
{ name: 'Approved', value: 'approved' },
]
api.create().checkApproverOLPA().then(response => {
// console.log(response);
if (response.data.data.is_approver === true) {
this.setState({ isApprover: true, checkApprover: true, listStatus: listStatus1, selectedStatus: listStatus1 }, () =>
this.getPeriode())
if (response.data.status === 'success') {
if (response.data.data.is_approver === true) {
this.setState({ isApprover: true, checkApprover: true, listStatus: listStatus1, selectedStatus: listStatus1 }, () =>
this.getPeriode())
} else {
this.setState({ isApprover: false, checkApprover: false, listStatus: listStatus2, selectedStatus: listStatus2 }, () =>
this.getPeriode())
}
} else {
this.setState({ isApprover: false, checkApprover: false, listStatus: listStatus2, selectedStatus: listStatus2 }, () =>
this.getPeriode())
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
})
}
......
......@@ -726,17 +726,16 @@ export default class CashFlow extends Component {
let totalBeginning = dataTable2[tableMeta.rowIndex][18] = dataTable2[tableMeta.rowIndex][6].value
return totalBeginning
} else if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "cash at the end of the period") {
console.log(tableMeta.rowIndex);
let value = Number(dataTable2[tableMeta.rowIndex - 1][18]) + Number(dataTable2[tableMeta.rowIndex - 2][18])
return R.equals(value, NaN) ? "0.0" : (R.equals(value, Infinity) ? "0.0" : (value == "-Infinity" ? "0.0" : value))
} else if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "control (should be nil)") {
console.log(tableMeta);
// console.log(dataTable2[tableMeta.rowIndex - 2][tableMeta.columnIndex + 11].value);
let cashOfTheEndFy = Number(dataTable2[tableMeta.rowIndex - 3][18]) + Number(dataTable2[tableMeta.rowIndex - 4][18])
let cahsOfTheEndDec = Number(dataTable2[tableMeta.rowIndex - 2][18])
let cahsOfTheEndDec = Number(dataTable2[tableMeta.rowIndex - 2][tableMeta.columnIndex + 11].value)
// console.log(cashOfTheEndFy);
// console.log(cahsOfTheEndDec);
let value = Number(cashOfTheEndFy) - Number(cahsOfTheEndDec);
// console.log(tablSeMeta.rowIndex);
console.log(value);
return R.equals(value, NaN) ? "0.0" : (R.equals(value, Infinity) ? "0.0" : (value == "-Infinity" ? "0.0" : value))
} else {
dataTable2[tableMeta.rowIndex][18] = total
......@@ -2238,4 +2237,4 @@ export default class CashFlow extends Component {
</div>
)
}
}
}
\ No newline at end of file
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