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