Commit 64eac1cd authored by Rifka Kurnia's avatar Rifka Kurnia

Merge branch 'rifka' into 'master'

cuma get hierarki bs rolling outlook

See merge request !1186
parents 2ce357a5 e01684b5
......@@ -233,6 +233,10 @@ const create = (type = "") => {
const getReportHierarkiPL = (body) => api.post('transaction/db_profit_loss_detail/get_report_hierarki', body)
const getLastestUpdateMROI = (body) => api.post('transaction/operating_indicator/monthly_report/get_latest_update', body)
const getRollingOutlookID = (body) => api.post('transaction/rolling_outlook/get_rolling_outlook_id', body)
const getRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/get_report_hierarki', body)
//REPORT NEW
const getAllReportBS = (body) => api.post('/transaction/db_balance_sheet/get_report_hierarki', body)
const getReportBSMB = (body) => api.post('/transaction/db_balance_sheet/master_budget/get_report_hierarki', body)
......@@ -677,7 +681,9 @@ const create = (type = "") => {
getHierarkiCronJobMBRatio,
getHierarkiCronJobMRPL,
getHierarkiCronJobMRCF,
getHierarkiCronJobMRRatio
getHierarkiCronJobMRRatio,
getRollingOutlookID,
getRollingOutlookBS
}
}
......
......@@ -47,7 +47,7 @@ export default class RollingOutlook extends Component {
alert: false,
tipeAlert: '',
messageAlert: '',
submissionID: null,
rollingOutlookID: null,
isSubmit: false,
visibleTableHistory: false,
isApprover: false,
......@@ -364,26 +364,26 @@ export default class RollingOutlook extends Component {
getOptionLabel: (option) => option.revision,
};
this.setState({ listRevision: defaultProps, revision: revisionData[0] }, () => {
this.getSubmission()
this.getRollingOutlookID()
})
}
}
})
}
getSubmission() {
getRollingOutlookID() {
this.setState({ loading: true })
let payload = {
"company_id": this.state.company.company_id,
"periode": this.state.periode.periode,
"is_approver": this.state.isApprover
}
api.create().getSubmission(payload).then(response => {
api.create().getRollingOutlookID(payload).then(response => {
console.log(response)
if (response) {
if (response.data.status === "success") {
this.setState({
submissionID: response.data.data.submission_id,
rollingOutlookID: response.data.data.rolling_outlook_id,
submitter: response.data.data.submitter,
approverID: response.data.data.approve_id, pic: response.data.data.approver == null ? '' : response.data.data.approver,
lastStatus: response.data.data.last_status === null ? 'SUBMIT' : response.data.data.last_status,
......@@ -405,7 +405,7 @@ export default class RollingOutlook extends Component {
})
})
} else {
this.setState({ submissionID: null, loading: false })
this.setState({ rollingOutlookID: null, loading: false })
}
}
})
......@@ -450,7 +450,7 @@ export default class RollingOutlook extends Component {
api.create().approvalSubmission(body).then((res) => {
console.log(res)
this.setState({ loading: false }, () => {
this.getSubmission()
this.getRollingOutlookID()
})
if (type == 'revision') {
api.create().createPeriodeRevision(payload).then((res) => console.log(res))
......@@ -538,7 +538,7 @@ export default class RollingOutlook extends Component {
if (response.data) {
if (response.data.status === "success") {
this.setState({ visibleUpload: false }, () => {
this.getSubmission()
this.getRollingOutlookID()
})
}
}
......@@ -549,7 +549,7 @@ export default class RollingOutlook extends Component {
api.create().deleteAttachment(item.attachment_id).then(response => {
if (response.data) {
if (response.data.status === "success") {
this.getSubmission()
this.getRollingOutlookID()
}
}
})
......@@ -566,15 +566,15 @@ export default class RollingOutlook extends Component {
console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.getSubmission()
this.getRollingOutlookID()
} else {
this.setState({ loading: false }, () => {
this.getSubmission()
this.getRollingOutlookID()
})
}
} else {
this.setState({ loading: false }, () => {
this.getSubmission()
this.getRollingOutlookID()
})
}
})
......@@ -619,13 +619,13 @@ export default class RollingOutlook extends Component {
})
if (canSubmit === true) {
let body = {
submission_id: this.state.submissionID
rolling_outlook_id: this.state.rollingOutlookID
}
api.create().submitMasterBudget(body).then(response => {
console.log(response);
if (response.data) {
if (response.data.status === "Success") {
this.getSubmission()
this.getRollingOutlookID()
}
}
})
......@@ -1201,7 +1201,13 @@ export default class RollingOutlook extends Component {
{this.state.visibleBS && (
<BalanceSheetRO
width={this.props.width}
height={this.props.height}
open={this.props.open}
report_id={this.state.report_id}
company={this.state.company}
revision={this.state.revisionTable}
periode={this.state.periode.periode}
rollingOutlookID={this.state.rollingOutlookID}
onClickClose={() => this.setState({ visibleBS: false, visibleRollingOutlook: true })}
/>
)}
......@@ -1223,7 +1229,7 @@ export default class RollingOutlook extends Component {
company={this.state.company}
revision={this.state.revisionTable}
periode={this.state.periode.periode}
submissionID={this.state.submissionID}
rollingOutlookID={this.state.rollingOutlookID}
onClickClose={() => this.setState({ visibleTP: false, visibleRollingOutlook: true })}
status={this.state.status}
lastStatus={this.state.lastStatus}
......
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