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

pl

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