Commit a554cc01 authored by Riri Novita's avatar Riri Novita

update note formula

parent 4fccc3b6
...@@ -326,6 +326,7 @@ export default class ProfitLossMR extends Component { ...@@ -326,6 +326,7 @@ export default class ProfitLossMR extends Component {
// if (err === true) { // if (err === true) {
// this.setState({ bebas: true }) // this.setState({ bebas: true })
// } // }
console.log(dataTable);
this.setState({ dataTable, loading: false, buttonError: true, saveDraft: true, refresh: false }) this.setState({ dataTable, loading: false, buttonError: true, saveDraft: true, refresh: false })
} else { } else {
this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
...@@ -968,12 +969,14 @@ export default class ProfitLossMR extends Component { ...@@ -968,12 +969,14 @@ export default class ProfitLossMR extends Component {
// } // }
dataTable2[tableMeta.rowIndex].map((item, index) => { dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index == 10) { if (index == 10) {
// ytd = ytd actual balikan be + actual
let itemActual = item == undefined || item == "" || item == "undefined" ? 0.0 : item let itemActual = item == undefined || item == "" || item == "undefined" ? 0.0 : item
total = Number(tableMeta.rowData[23]) + Number(itemActual) total = Number(tableMeta.rowData[23]) + Number(itemActual)
} }
}) })
if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "sales price") { if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "sales price") {
// Sales Price = Unit Business / Sales Volume
let value = Number(dataTable2[tableMeta.rowIndex - 2][11]) / Number(dataTable2[tableMeta.rowIndex - 1][11]) let value = Number(dataTable2[tableMeta.rowIndex - 2][11]) / Number(dataTable2[tableMeta.rowIndex - 1][11])
dataTable2[tableMeta.rowIndex][11] = R.equals(value, NaN) ? "0.0" : (R.equals(value, Infinity) ? "0.0" : (value == "-Infinity" ? "0.0" : value)) dataTable2[tableMeta.rowIndex][11] = 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)) return R.equals(value, NaN) ? "0.0" : (R.equals(value, Infinity) ? "0.0" : (value == "-Infinity" ? "0.0" : value))
......
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