Commit a2446d77 authored by Riri Novita's avatar Riri Novita

udah oke

parent cfa0136f
...@@ -343,7 +343,7 @@ export default class ProfitLossMR extends Component { ...@@ -343,7 +343,7 @@ export default class ProfitLossMR extends Component {
item.mtd_vs_previous_month, item.mtd_vs_previous_month,
item.mtd_vs_mb, item.mtd_vs_mb,
item.mtd_vs_rb, item.mtd_vs_rb,
item.order, item.orders,
item.error item.error
] ]
}) })
...@@ -356,6 +356,7 @@ export default class ProfitLossMR extends Component { ...@@ -356,6 +356,7 @@ export default class ProfitLossMR extends Component {
}) })
// console.log(this.state.buttonError) // console.log(this.state.buttonError)
}) })
console.log(dataTable);
} }
} }
}) })
...@@ -366,7 +367,7 @@ export default class ProfitLossMR extends Component { ...@@ -366,7 +367,7 @@ export default class ProfitLossMR extends Component {
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
data.push({ data.push({
item_report_id: i[1], item_report_id: i[1],
notes: i[6], notes: String(i[6]),
rolling_outlook: String(Number(i[7]).toFixed(1)), rolling_outlook: String(Number(i[7]).toFixed(1)),
master_budget: String(Number(i[8]).toFixed(1)), master_budget: String(Number(i[8]).toFixed(1)),
rolling_budget: String(Number(i[9]).toFixed(1)), rolling_budget: String(Number(i[9]).toFixed(1)),
...@@ -385,7 +386,7 @@ export default class ProfitLossMR extends Component { ...@@ -385,7 +386,7 @@ export default class ProfitLossMR extends Component {
}) })
}) })
let body = { let body = {
// submission_id: this.props.submissionID, submission_id: this.props.submissionID,
company_id: this.props.company.company_id, company_id: this.props.company.company_id,
periode: this.props.periode, periode: this.props.periode,
report_id: this.props.report_id, report_id: this.props.report_id,
...@@ -448,7 +449,7 @@ export default class ProfitLossMR extends Component { ...@@ -448,7 +449,7 @@ export default class ProfitLossMR extends Component {
let total = 0 let total = 0
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
if (data.rowData[1] == item[2]) { if (data.rowData[1] == item[2]) {
total = item[data.columnIndex] == undefined ? (Number(total) + 0) : (Number(total) + Number(String(item[data.columnIndex]).includes('-')? Number(String(item[data.columnIndex]).substr(1, String(item[data.columnIndex]).length)) * -1 : Number(item[data.columnIndex]))) total = item[data.columnIndex + type] == undefined ? (Number(total) + 0) : (Number(total) + Number(String(item[data.columnIndex + type]).includes('-')? Number(String(item[data.columnIndex + type]).substr(1, String(item[data.columnIndex + type]).length)) * -1 : Number(item[data.columnIndex + type])))
} }
}) })
let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[data.rowIndex][2]) let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[data.rowIndex][2])
......
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