Commit 6959a419 authored by Riri Novita's avatar Riri Novita

issue

parent 10c98a66
......@@ -343,7 +343,7 @@ export default class ProfitLoss extends Component {
checkUpload() {
api.create().checkUploadMB(this.state.payload).then(response => {
// console.log(JSON.stringify(this.state.payload));
// console.log(response)
console.log(response)
if (response.data) {
if (response.data.status === 'success') {
this.setState({ visibleUpload: false, visibleProfitLoss: false, loading: true })
......@@ -385,6 +385,7 @@ export default class ProfitLoss extends Component {
})
// console.log(this.state.buttonError)
})
}
}
})
......@@ -539,12 +540,9 @@ export default class ProfitLoss extends Component {
let indexParent = dataTable2.findIndex((val) => val[1] == tableMeta.rowData[2])
if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "sales price") {
let value = Number(dataTable2[tableMeta.rowIndex - 2][20]) / Number(dataTable2[tableMeta.rowIndex - 1][20])
dataTable2[tableMeta.rowIndex][20] = R.equals(value, NaN) ? "0.0" : value
return R.equals(value, NaN) ? "0.0" : value
dataTable2[tableMeta.rowIndex][20] = R.equals(value, NaN) ? "0.0" : R.equals(value, Infinity) ? "0.0" : value
return R.equals(value, NaN) ? "0.0" : R.equals(value, Infinity) ? "0.0" : value
} else if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "total man power") {
console.log("masuk");
console.log(dataTable2[tableMeta.rowIndex][20]);
console.log(dataTable2[tableMeta.rowIndex][19]);
let totalTMP = dataTable2[tableMeta.rowIndex][20] = dataTable2[tableMeta.rowIndex][19]
return totalTMP
} else if (indexParent !== -1 && String(dataTable2[indexParent][5]).toLocaleUpperCase() == "GROSS PROFIT MARGIN (% OF REVENUE)") {
......@@ -635,13 +633,13 @@ export default class ProfitLoss extends Component {
} else if (opt == "kali") {
total = Number(total) * Number(item)
} else if (opt == "bagi") {
total = R.equals((Number(total) / Number(item)), NaN) ? '0' : Number(total) / Number(item)
total = R.equals((Number(total) / Number(item)), NaN) ? '0' : R.equals((Number(total) / Number(item)), Infinity) ? '0' : Number(total) / Number(item)
} else {
total += Number(item)
}
}
})
total = R.equals(total, NaN) ? "0.0" : R.equals(total, Infinity) ? "0.0" : total
// if (tableMeta.rowData[1] === 20092) {
// console.log(total);
// console.log(arrayJumlah);
......
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