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

issue formula

parent 01971cb0
...@@ -722,8 +722,16 @@ export default class CashFlow extends Component { ...@@ -722,8 +722,16 @@ export default class CashFlow extends Component {
let totalBeginning = dataTable2[tableMeta.rowIndex][18] = dataTable2[tableMeta.rowIndex][6].value let totalBeginning = dataTable2[tableMeta.rowIndex][18] = dataTable2[tableMeta.rowIndex][6].value
return totalBeginning return totalBeginning
}else if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "cash at the end of the period") { }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 let value = Number(dataTable2[tableMeta.rowIndex - 1][18]) + Number(dataTable2[tableMeta.rowIndex - 2][18])
return totalEnd 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 { } else {
dataTable2[tableMeta.rowIndex][18] = total dataTable2[tableMeta.rowIndex][18] = total
return total return total
......
...@@ -123,7 +123,7 @@ export default class OutlookPA extends Component { ...@@ -123,7 +123,7 @@ export default class OutlookPA extends Component {
{ name: 'Approved', value: 'approved' }, { name: 'Approved', value: 'approved' },
] ]
api.create().checkApproverOLPA().then(response => { api.create().checkApproverOLPA().then(response => {
// console.log(response); if (response.data.status === 'success') {
if (response.data.data.is_approver === true) { if (response.data.data.is_approver === true) {
this.setState({ isApprover: true, checkApprover: true, listStatus: listStatus1, selectedStatus: listStatus1 }, () => this.setState({ isApprover: true, checkApprover: true, listStatus: listStatus1, selectedStatus: listStatus1 }, () =>
this.getPeriode()) this.getPeriode())
...@@ -131,6 +131,16 @@ export default class OutlookPA extends Component { ...@@ -131,6 +131,16 @@ export default class OutlookPA extends Component {
this.setState({ isApprover: false, checkApprover: false, listStatus: listStatus2, selectedStatus: listStatus2 }, () => this.setState({ isApprover: false, checkApprover: false, listStatus: listStatus2, selectedStatus: listStatus2 }, () =>
this.getPeriode()) this.getPeriode())
} }
} else {
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 { ...@@ -726,17 +726,16 @@ export default class CashFlow extends Component {
let totalBeginning = dataTable2[tableMeta.rowIndex][18] = dataTable2[tableMeta.rowIndex][6].value let totalBeginning = dataTable2[tableMeta.rowIndex][18] = dataTable2[tableMeta.rowIndex][6].value
return totalBeginning return totalBeginning
} else if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "cash at the end of the period") { } 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]) 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)) 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)") { } 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 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(cashOfTheEndFy);
// console.log(cahsOfTheEndDec); // console.log(cahsOfTheEndDec);
let value = Number(cashOfTheEndFy) - Number(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)) return R.equals(value, NaN) ? "0.0" : (R.equals(value, Infinity) ? "0.0" : (value == "-Infinity" ? "0.0" : value))
} else { } else {
dataTable2[tableMeta.rowIndex][18] = total dataTable2[tableMeta.rowIndex][18] = total
......
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