Commit 136ec101 authored by Riri Novita's avatar Riri Novita

pl semua

parent 02e5bcba
This diff is collapsed.
This diff is collapsed.
......@@ -376,22 +376,22 @@ export default class ProfitLossMR extends Component {
this.state.dataTable.map(i => {
data.push({
"item_report_id": i[1],
"notes": i[6],
"rolling_outlook": i[7],
"master_budget": i[8],
"rolling_budget": i[9],
"actual": i[10],
"ytd_actual": i[11],
"actual_previous_month": i[12],
"amount_act_vs_previous_month": i[13],
"percent_act_vs_previous_month": i[14],
"amount_act_vs_mb": i[15],
"percent_act_vs_mb": i[16],
"amount_act_vs_rb": i[17],
"percent_act_vs_rb": i[18],
"mtd_vs_mb": i[19],
"mtd_vs_rb": i[20],
"mtd_vs_previous_month": i[21],
"notes": String(i[6]),
"rolling_outlook": String(Number(i[7]).toFixed(1)),
"master_budget": String(Number(i[8]).toFixed(1)),
"rolling_budget": String(Number(i[9]).toFixed(1)),
"actual": String(Number(i[10]).toFixed(1)),
"ytd_actual": String(Number(i[11]).toFixed(1)),
"actual_previous_month": String(Number(i[12]).toFixed(1)),
"amount_act_vs_previous_month": String(Number(i[13]).toFixed(1)),
"percent_act_vs_previous_month": String(Number(i[14]).toFixed(1)),
"amount_act_vs_mb": String(Number(i[15]).toFixed(1)),
"percent_act_vs_mb": String(Number(i[16]).toFixed(1)),
"amount_act_vs_rb": String(Number(i[17]).toFixed(1)),
"percent_act_vs_rb": String(Number(i[18]).toFixed(1)),
"mtd_vs_mb": String(i[19]),
"mtd_vs_rb": String(i[20]),
"mtd_vs_previous_month": String(i[21]),
})
})
let payload = {
......@@ -405,31 +405,31 @@ export default class ProfitLossMR extends Component {
}
console.log(payload);
// console.log(JSON.stringify(payload));
api.create('UPLOAD').createMonthlyReportPL(payload).then(response => {
console.log(response);
if (response.data) {
if (response.data.status === "success") {
if (type == 'submitted') {
this.props.saveToMonthlyReport('PL')
} else {
this.props.saveToMonthlyReport()
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 }, () => {
document.body.style.overflow = 'unset';
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
this.props.saveToMonthlyReport()
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 })
}
})
// api.create('UPLOAD').createMonthlyReportPL(payload).then(response => {
// console.log(response);
// if (response.data) {
// if (response.data.status === "success") {
// if (type == 'submitted') {
// this.props.saveToMonthlyReport('PL')
// } else {
// this.props.saveToMonthlyReport()
// }
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 }, () => {
// document.body.style.overflow = 'unset';
// if (response.data.message.includes("Someone Logged In")) {
// setTimeout(() => {
// localStorage.removeItem(Constant.TOKEN)
// window.location.reload();
// }, 1000);
// }
// this.props.saveToMonthlyReport()
// })
// }
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 })
// }
// })
}
fileHandler = (event) => {
......
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