Commit 88be97c6 authored by Riri Novita's avatar Riri Novita

pl

parent 45ae943f
......@@ -251,7 +251,7 @@ export default class ProfitLossMR extends Component {
}
backToMonthlyReport(type) {
// console.log(this.state.dataTable);
console.log("masuk");
let data = []
this.state.dataTable.map(i => {
data.push({
......@@ -275,7 +275,7 @@ export default class ProfitLossMR extends Component {
})
})
let payload = {
"monthly_report_id": this.props.submissionID,
"monthly_report_id": this.props.monthlyReportId,
"company_id": this.props.company.company_id,
"periode": this.props.periode,
"report_id": this.props.report_id,
......@@ -415,7 +415,7 @@ export default class ProfitLossMR extends Component {
})
})
let body = {
submission_id: this.props.submissionID,
monthly_report_id: this.props.monthlyReportId,
company_id: this.props.company.company_id,
periode: this.props.periode,
report_id: this.props.report_id,
......@@ -423,14 +423,15 @@ export default class ProfitLossMR extends Component {
status: type,
profit_loss: data
}
// console.log(data);
console.log(data);
api.create('UPLOAD').uploadMonthlyReportPL(body).then(response => {
// console.log(response);
console.log(response);
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
this.props.onClickClose()
this.props.getReport()
this.props.saveToMonthlyReport()
// this.props.onClickClose()
// this.props.getReport()
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
......@@ -1856,7 +1857,7 @@ export default class ProfitLossMR extends Component {
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
:
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
this.setState({ handleTekTekTek: 1, loading: true }, () => {
this.backToMonthlyReport('submitted')
})}
style={{
......@@ -1974,7 +1975,7 @@ export default class ProfitLossMR extends Component {
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
:
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
this.setState({ handleTekTekTek: 1, loading: true }, () => {
this.uploadProfitLossMR('submitted')
})}
style={{
......@@ -2023,7 +2024,7 @@ export default class ProfitLossMR extends Component {
this.setState({ uploadStatus: 'idle', percentage: '0' })
}}
onUpload={() => {
this.state.judul === "MONTHLY REPORT - PROFIT LOSS" ?
String(this.state.judul).includes("MONTHLY") && String(this.state.judul).includes("REPORT") && String(this.state.judul).includes("PROFIT") && String(this.state.judul).includes("LOSS") ?
this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}}
......
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