Commit 70c7ed28 authored by d.arizona's avatar d.arizona

update create db pl

parent c0898c4f
...@@ -363,7 +363,9 @@ const create = (type = "") => { ...@@ -363,7 +363,9 @@ const create = (type = "") => {
const createCFOLPA = (body) => api.post ('transaction/cash_flow/outlook_pa/create_outlook_report', body) const createCFOLPA = (body) => api.post ('transaction/cash_flow/outlook_pa/create_outlook_report', body)
const getHierarkiDBPLOLPA = (body) => api.post('transaction/db_profit_loss/outlook_pa/get_report_hierarki', body) const getHierarkiDBPLOLPA = (body) => api.post('transaction/db_profit_loss/outlook_pa/get_report_hierarki', body)
const createDBPLOLPA = (body) => api.post('transaction/db_profit_loss/outlook_pa/create_outlook_report', body) const createDBPLOLPA = (body) => api.post('transaction/db_profit_loss/outlook_pa/create_outlook_report', body)
const getHierarkiDBPLRO = (body) => api.post('transaction/db_profit_loss/rolling_outlook/get_report_hierarki', body)
const createDBPLRO = (body) => api.post('transaction/db_profit_loss/rolling_outlook/create_rolling_outlook', body)
// Monthly // Monthly
const getMonthlyReport = (body) => api.post('transaction/monthly_report/get_all_report', body) const getMonthlyReport = (body) => api.post('transaction/monthly_report/get_all_report', body)
const submitMonthlyReport = (body) => api.post('transaction/monthly_report/submit_monthly_report', body) const submitMonthlyReport = (body) => api.post('transaction/monthly_report/submit_monthly_report', body)
...@@ -796,7 +798,9 @@ const create = (type = "") => { ...@@ -796,7 +798,9 @@ const create = (type = "") => {
getHierarkiCFOLPA, getHierarkiCFOLPA,
createCFOLPA, createCFOLPA,
getHierarkiDBPLOLPA, getHierarkiDBPLOLPA,
createDBPLOLPA createDBPLOLPA,
getHierarkiDBPLRO,
createDBPLRO
} }
} }
......
...@@ -821,7 +821,7 @@ export default class OutlookPA extends Component { ...@@ -821,7 +821,7 @@ export default class OutlookPA extends Component {
"revision": Number(this.state.lastRevision), "revision": Number(this.state.lastRevision),
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"submission_id": this.state.PLID, "outlook_pa_id": this.state.PLID,
} }
api.create().getHierarkiDBPLOLPA(payload).then(response => { api.create().getHierarkiDBPLOLPA(payload).then(response => {
// console.log(response); // console.log(response);
...@@ -1282,7 +1282,6 @@ export default class OutlookPA extends Component { ...@@ -1282,7 +1282,6 @@ export default class OutlookPA extends Component {
"status": "submitted", "status": "submitted",
"profit_loss_id": this.state.PLID, "profit_loss_id": this.state.PLID,
"profit_loss_olpa": this.state.dbPL, "profit_loss_olpa": this.state.dbPL,
"months": 0,
} }
console.log(this.state.dbPL) console.log(this.state.dbPL)
// console.log(JSON.stringify(payload)) // console.log(JSON.stringify(payload))
......
This diff is collapsed.
...@@ -405,7 +405,11 @@ export default class ProfitLossROO extends Component { ...@@ -405,7 +405,11 @@ export default class ProfitLossROO extends Component {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.refresh() if (type == 'submitted') {
this.props.refresh('PL')
} else {
this.props.refresh()
}
this.props.onClickClose() this.props.onClickClose()
} 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 }, () => {
...@@ -573,7 +577,11 @@ export default class ProfitLossROO extends Component { ...@@ -573,7 +577,11 @@ export default class ProfitLossROO extends Component {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.onClickClose() this.props.onClickClose()
this.props.refresh() if (type == 'submitted') {
this.props.refresh('PL')
} else {
this.props.refresh()
}
// this.props.onClickClose() // this.props.onClickClose()
// this.props.getReport() // this.props.getReport()
} else { } else {
......
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