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