Commit 8fe76710 authored by d.arizona's avatar d.arizona

update ro bs

parent fc6ea8f5
...@@ -241,12 +241,22 @@ const create = (type = "") => { ...@@ -241,12 +241,22 @@ const create = (type = "") => {
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)
// Rolling Outlook // Rolling Outlook
const getRollingOutlookID = (body) => api.post('transaction/rolling_outlook/get_rolling_outlook_id', body) const getRollingOutlookID = (body) => api.post('transaction/rolling_outlook/get_monthly_report_id', body)
const getRollingOutlookAttachment = (body) => api.post('transaction/rolling_outlook/get_report_attachment', body)
const uploadRollingOutlookAttachment = (body) => api.post('transaction/rolling_outlook/upload_attachment', body)
const deleteRollingOutlookAttachment = (body) => api.post(`transaction/rolling_outlook/delete_attachment/${body}`)
const getRollingOutlookReport = (body) => api.post('transaction/rolling_outlook/get_all_report', body)
const getRollingOutlookLastUpdate = (body) => api.post('transaction/rolling_outlook/get_latest_update', body)
const getRollingOutlookRevision = (body) => api.post('transaction/rolling_outlook/get_revision', body)
const getRollingOutlookIsApprover = (body) => api.get('transaction/rolling_outlook/is_approver')
const getRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/get_report_hierarki', body) const getRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/get_report_hierarki', body)
const checkImportRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/check_import', body)
const importRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/import_rolling_outlook', body)
const createRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/create_rolling_outlook', body) const createRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/create_rolling_outlook', body)
const getRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/get_report_hierarki', body) const getRollingOutlookPL = (body) => api.post('transaction/profit_loss/rolling_outlook/get_report_hierarki', body)
const getRollingOutlookTP = (body) => api.post('transaction/rolling_outlook/tax_planning/get_report_hierarki', body) const getRollingOutlookTP = (body) => api.post('transaction/rolling_outlook/tax_planning/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)
...@@ -707,7 +717,16 @@ const create = (type = "") => { ...@@ -707,7 +717,16 @@ const create = (type = "") => {
deleteMasterDataCat, deleteMasterDataCat,
getListChildDashboardCAT, getListChildDashboardCAT,
getDashboardCATDetail, getDashboardCATDetail,
getRollingOutlookPL getRollingOutlookPL,
getRollingOutlookAttachment,
uploadRollingOutlookAttachment,
deleteRollingOutlookAttachment,
getRollingOutlookReport,
getRollingOutlookLastUpdate,
getRollingOutlookRevision,
getRollingOutlookIsApprover,
checkImportRollingOutlookBS,
importRollingOutlookBS
} }
} }
......
...@@ -68,7 +68,7 @@ export default class RollingOutlook extends Component { ...@@ -68,7 +68,7 @@ export default class RollingOutlook extends Component {
{value: 'q1', name: 'Q1'}, {value: 'q1', name: 'Q1'},
{value: 'q2', name: 'Q2'}, {value: 'q2', name: 'Q2'},
{value: 'q3', name: 'Q3'}, {value: 'q3', name: 'Q3'},
{value: 'ol_pa', name: 'OL PA'}, // {value: 'ol_pa', name: 'OL PA'},
], ],
quarter: null quarter: null
} }
...@@ -81,18 +81,18 @@ export default class RollingOutlook extends Component { ...@@ -81,18 +81,18 @@ export default class RollingOutlook extends Component {
componentDidMount() { componentDidMount() {
this.setState({ loading: true }) this.setState({ loading: true })
this.props.selectIndex('Rolling Outlook & CAT') this.props.selectIndex('Rolling Outlook & CAT')
if (this.props.location.state !== undefined) { // if (this.props.location.state !== undefined) {
console.log(this.props); // console.log(this.props);
this.setState({ userType: this.props.location.state.userType, intent: 'Home', lastPeriod: this.props.location.state.rawData.periode, rawData: this.props.location.state.rawData }, () => { // this.setState({ userType: this.props.location.state.userType, intent: 'Home', lastPeriod: this.props.location.state.rawData.periode, rawData: this.props.location.state.rawData }, () => {
this.checkApprover() // this.checkApprover()
}) // })
} else { // } else {
this.checkApprover() this.checkApprover()
} // }
} }
checkApprover() { checkApprover() {
api.create().checkApprover().then(response => { api.create().getRollingOutlookIsApprover().then(response => {
console.log(response); console.log(response);
if (response.data.data.is_approver === true) { if (response.data.data.is_approver === true) {
this.setState({ isApprover: true, checkApprover: true }, () => this.setState({ isApprover: true, checkApprover: true }, () =>
...@@ -158,8 +158,9 @@ export default class RollingOutlook extends Component { ...@@ -158,8 +158,9 @@ export default class RollingOutlook extends Component {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
"revision": this.state.revision.revision, "revision": this.state.revision.revision,
"quartal": this.state.quarter.value
} }
api.create().getMasterBudgetAtt(payload).then(response => { api.create().getRollingOutlookAttachment(payload).then(response => {
console.log(response) console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -175,8 +176,9 @@ export default class RollingOutlook extends Component { ...@@ -175,8 +176,9 @@ export default class RollingOutlook extends Component {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
"report_type": "Rolling Outlook", "report_type": "Rolling Outlook",
"quartal": this.state.quarter.value
} }
api.create().getReportTypeBody(payload).then(response => { api.create().getRollingOutlookReport(payload).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -216,7 +218,7 @@ export default class RollingOutlook extends Component { ...@@ -216,7 +218,7 @@ 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.setState({ isSubmit: response.data.data.is_can_submit }, () => { this.setState({ isSubmit: true }, () => {
this.getReport() this.getReport()
this.getReportAttachment() this.getReportAttachment()
}) })
...@@ -360,9 +362,10 @@ export default class RollingOutlook extends Component { ...@@ -360,9 +362,10 @@ export default class RollingOutlook extends Component {
getRevision() { getRevision() {
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,
"quartal": this.state.quarter.value
} }
api.create().getRevision(payload).then(response => { api.create().getRollingOutlookRevision(payload).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -389,22 +392,23 @@ export default class RollingOutlook extends Component { ...@@ -389,22 +392,23 @@ export default class RollingOutlook extends Component {
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,
"quartal": this.state.quarter.value
} }
// api.create().getRollingOutlookID(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({
// rollingOutlookID: response.data.data.rolling_outlook_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,
// loading: false, loading: false,
// lastRevision: response.data.data.last_revision, lastRevision: response.data.data.last_revision,
// btnApprove: response.data.data.is_submit btnApprove: response.data.data.is_submit
// }, () => { }, () => {
// console.log(this.state.lastStatus); console.log(this.state.lastStatus);
this.historyApproval() this.historyApproval()
this.getLatestPeriodSubmit() this.getLatestPeriodSubmit()
api.create().checkApprover().then(response => { api.create().checkApprover().then(response => {
...@@ -416,12 +420,12 @@ export default class RollingOutlook extends Component { ...@@ -416,12 +420,12 @@ export default class RollingOutlook extends Component {
} }
}) })
// }) })
// } else { } else {
// this.setState({ rollingOutlookID: null, loading: false }) this.setState({ rollingOutlookID: null, loading: false })
// } }
// } }
// }) })
} }
historyApproval() { historyApproval() {
...@@ -441,7 +445,7 @@ export default class RollingOutlook extends Component { ...@@ -441,7 +445,7 @@ export default class RollingOutlook extends Component {
item.history_approval_date item.history_approval_date
] ]
}) })
this.setState({ dataTableHistory, visibleTableHistory: true }) this.setState({ dataTableHistory, visibleTableHistory: false })
} }
}) })
} }
...@@ -1236,9 +1240,10 @@ export default class RollingOutlook extends Component { ...@@ -1236,9 +1240,10 @@ export default class RollingOutlook extends Component {
revision={this.state.revisionTable} revision={this.state.revisionTable}
periode={this.state.periode.periode} periode={this.state.periode.periode}
rollingOutlookID={this.state.rollingOutlookID} rollingOutlookID={this.state.rollingOutlookID}
refresh={this.getRollingOutlookID.bind(this)}
onClickClose={() => this.setState({ visibleBS: false, visibleRollingOutlook: true })} onClickClose={() => this.setState({ visibleBS: false, visibleRollingOutlook: true })}
isApprover={'false'} isApprover={'false'}
quarter={this.state.quarter} quarter={this.state.quarter.value}
/> />
)} )}
...@@ -1253,7 +1258,8 @@ export default class RollingOutlook extends Component { ...@@ -1253,7 +1258,8 @@ export default class RollingOutlook extends Component {
periode={this.state.periode.periode} periode={this.state.periode.periode}
rollingOutlookID={this.state.rollingOutlookID} rollingOutlookID={this.state.rollingOutlookID}
onClickClose={() => this.setState({ visiblePL: false, visibleRollingOutlook: true })} onClickClose={() => this.setState({ visiblePL: false, visibleRollingOutlook: true })}
quarter={this.state.quarter} refresh={this.getRollingOutlookID.bind(this)}
quarter={this.state.quarter.value}
isApprover={'false'} isApprover={'false'}
/> />
)} )}
...@@ -1269,9 +1275,10 @@ export default class RollingOutlook extends Component { ...@@ -1269,9 +1275,10 @@ export default class RollingOutlook extends Component {
periode={this.state.periode.periode} periode={this.state.periode.periode}
rollingOutlookID={this.state.rollingOutlookID} rollingOutlookID={this.state.rollingOutlookID}
onClickClose={() => this.setState({ visibleTP: false, visibleRollingOutlook: true })} onClickClose={() => this.setState({ visibleTP: false, visibleRollingOutlook: true })}
refresh={this.getRollingOutlookID.bind(this)}
status={this.state.status} status={this.state.status}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
quarter={this.state.quarter} quarter={this.state.quarter.value}
isApprover={'false'} isApprover={'false'}
/> />
)} )}
......
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