Commit 6a0ffc6e authored by Faisal Hamdi's avatar Faisal Hamdi

triggerRatio!

parent ce59f4e2
......@@ -323,7 +323,7 @@ const create = (type = "") => {
const getReportFRLastMR = (body) => api.post('/transaction/summary_ratio/monthly_report_last_year/get_report_hierarki', body)
const getReportBSSuma = (body) => api.post('/transaction/summary_balance_sheet/summary/get_report_hierarki', body)
const getDashboardCAT = (body) => api.post('/transaction/dashboard/get_dashboard_cat', body)
const getListChildDashboardCAT = (periode,month) => api.get(`/transaction/dashboard/get_home_cat/${periode}/${month}`)
const getListChildDashboardCAT = (periode, month) => api.get(`/transaction/dashboard/get_home_cat/${periode}/${month}`)
const getDashboardCATDetail = (body) => api.post('/transaction/dashboard/get_dashboard_cat_detail', body)
const getHierarkiReportYtd = (body) => api.post('/transaction/summary_ytd/summary/get_report_hierarki', body)
const getHierarkiReportHistorical = (body) => api.post('/transaction/summary_historical/summary/get_report_hierarki', body)
......@@ -361,7 +361,7 @@ const create = (type = "") => {
const checkApproverOLPA = () => api.get('transaction/outlook_pa/is_approver')
const createPeriodeRevisionOLPA = (body) => api.post('transaction/outlook_pa/create_periode_revision', body)
const getHierarkiCFOLPA = (body) => api.post('transaction/cash_flow/outlook_pa/get_report_hierarki', body)
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 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)
......@@ -429,8 +429,8 @@ const create = (type = "") => {
const validateSubmitReportFAM = (body) => api.post('transaction/fam/monthly_report/validate_save', body)
const getListUserSubcoMB = (periode) => api.get(`transaction/get_dashboard_sub_co/master_budget/${periode}`)
const getListUserSubcoMR = (months,periode) => api.get(`transaction/get_dashboard_sub_co/monthly_report/${periode}/${months}`)
const getListUserSubcoRO = (periode,quartal) => api.get(`transaction/get_dashboard_sub_co/rolling_outlook/${periode}/${quartal}`)
const getListUserSubcoMR = (months, periode) => api.get(`transaction/get_dashboard_sub_co/monthly_report/${periode}/${months}`)
const getListUserSubcoRO = (periode, quartal) => api.get(`transaction/get_dashboard_sub_co/rolling_outlook/${periode}/${quartal}`)
const getListUserSubcoOL = (periode) => api.get(`transaction/get_dashboard_sub_co/outlook_pa/${periode}`)
// Cronjob
......@@ -445,6 +445,10 @@ const create = (type = "") => {
const getRatioLOCF = (body) => api.get(`/transaction/cronjob/create_monthly_report/${body.report}/${body.monthlyReportId}/${body.companyId}/${body.months}/${body.periode}`)
const triggerRatioFromLOCF = (body) => api.get(`/transaction/cronjob/create_monthly_report_locf/${body.report}/${body.monthlyReportId}/${body.companyId}/${body.months}/${body.periode}`)
const triggerRatioMB = (body) => api.get(`/transaction/cronjob/create_master_budget_company/${body.report}/${body.submissionId}/${body.companyId}/${body.periode}`)
const triggerRatioRO = (body) => api.get(`/transaction/cronjob/create_rolling_outlook_company/${body.report}/${body.rollingOutlookId}/${body.companyId}/${body.quartal}/${body.periode}`)
const triggerRatioOLPA = (body) => api.get(`/transaction/cronjob/create_outlook_pa_company/${body.report}/${body.outlookPaId}/${body.companyId}/${body.periode}`)
// MonthlyPL
// const getHierarkiMontlyReportPL = (body) => api.post('transaction/monthly_report_pl/get_report_hierarki', body)
// const createMonthlyReportPL = (body) => api.post('transaction/monthly_report_pl/create_monthly_report', body)
......@@ -480,7 +484,7 @@ const create = (type = "") => {
const getMonitoringOLPA = (body) => api.get(`transaction/monitoring/outlook_pa?year=${body.year}`)
// Superadmin Approve
const getListApprover = (report,monthlyReportId) => api.get(`transaction/${report}/get_approver/${monthlyReportId}`)
const getListApprover = (report, monthlyReportId) => api.get(`transaction/${report}/get_approver/${monthlyReportId}`)
const getIdToken = (userId) => api.get(`transaction/get_token/${userId}`)
// ------
// STEP 3
......@@ -823,6 +827,9 @@ const create = (type = "") => {
createCATOLPA,
getRatioLOCF,
triggerRatioFromLOCF,
triggerRatioMB,
triggerRatioRO,
triggerRatioOLPA,
getMonitoringMB,
getMonitoringMR,
getMonitoringRO,
......
......@@ -534,7 +534,7 @@ export default class BudgetTahunan extends Component {
let payload = {
"company_id": this.state.company.company_id,
"periode": this.state.periode.periode,
"is_approver": this.state.isAdmin && this.state.lastStatus == 'WAITING FOR APPROVAL'? false : (this.state.permissionhandle ? this.state.permissionhandle : this.state.isApprover)
"is_approver": this.state.isAdmin && this.state.lastStatus == 'WAITING FOR APPROVAL' ? false : (this.state.permissionhandle ? this.state.permissionhandle : this.state.isApprover)
}
console.log(payload)
api.create().getSubmission(payload).then(response => {
......@@ -558,24 +558,35 @@ export default class BudgetTahunan extends Component {
// this.getPL(type)
if (this.state.isAdmin) {
console.log('masuk')
api.create().getListApprover('master_budget',this.state.submissionID).then((response) => {
api.create().getListApprover('master_budget', this.state.submissionID).then((response) => {
console.log(response)
if (response.data.data) {
let dataListApprover = []
response.data.data.map((item,index) => {
dataListApprover.push({userId: item.user_id, fullname: item.fullname})
response.data.data.map((item, index) => {
dataListApprover.push({ userId: item.user_id, fullname: item.fullname })
})
let defaultProps = {
options: dataListApprover,
getOptionLabel: (option) => option.fullname,
};
this.setState({listApprover: defaultProps})
this.setState({ listApprover: defaultProps })
}
})
}
if (type != undefined && type == 'PL') {
// this.getCashFlow(type)
this.getPL(type)
} else if (type != undefined && type == 'BS') {
let bodyRatioBs = {
"report": 'ratio',
"submissionId": this.state.submissionId,
"periode": this.state.periode.periode,
"companyId": this.state.company.company_id
}
api.create().triggerRatioMB(bodyRatioBs).then((res) => {
console.log(res)
this.setState({ loading: false })
})
} else {
this.setState({ loading: false })
}
......@@ -2052,7 +2063,7 @@ export default class BudgetTahunan extends Component {
// })
if (this.state.isAdmin && type == 'approve') {
localStorage.setItem(Constant.TOKEN, realToken)
this.setState({visibleApproveSuperadmin: false})
this.setState({ visibleApproveSuperadmin: false })
}
setTimeout(() => {
if (type == 'revision') {
......
......@@ -326,6 +326,16 @@ export default class BalanceSheetOLPA extends Component {
console.log(data);
this.setState({ loading: false })
this.props.saveToOLPA(payload)
let bodyRatioOLPA = {
"report": 'ratio',
"outlookPaId": this.props.outlook_pa_id,
"companyId": this.state.company.company_id,
"periode": this.state.periode.periode
}
api.create().triggerRatioOLPA(bodyRatioOLPA).then((res) => {
console.log(res)
this.setState({ loading: false })
})
this.props.onClickClose()
}
......@@ -484,6 +494,16 @@ export default class BalanceSheetOLPA extends Component {
console.log(response);
if (response.data) {
if (response.data.status === "success") {
let bodyRatioOLPA = {
"report": 'ratio',
"outlookPaId": this.props.outlook_pa_id,
"companyId": this.state.company.company_id,
"periode": this.state.periode.periode
}
api.create().triggerRatioOLPA(bodyRatioOLPA).then((res) => {
console.log(res)
this.setState({ loading: false })
})
this.props.onClickClose()
this.props.getReport()
} else {
......
......@@ -372,6 +372,17 @@ export default class BalanceSheetRO extends Component {
// console.log(JSON.stringify(payload))
if (response.data) {
if (response.data.status === "success") {
let bodyRatioRO = {
"report": 'ratio',
"rollingOutlookId": this.props.rollingOutlookID,
"periode": this.state.periode.periode,
"companyId": this.state.company.company_id,
"quartal": this.props.quarter
}
api.create().triggerRatioRO(bodyRatioRO).then((res) => {
console.log(res)
this.setState({ loading: false })
})
this.props.onClickClose()
this.props.refresh()
} else {
......@@ -582,6 +593,17 @@ export default class BalanceSheetRO extends Component {
// console.log(JSON.stringify(payload))
if (response.data) {
if (response.data.status === "success") {
let bodyRatioRO = {
"report": 'ratio',
"rollingOutlookId": this.props.rollingOutlookID,
"periode": this.state.periode.periode,
"companyId": this.state.company.company_id,
"quartal": this.props.quarter
}
api.create().triggerRatioRO(bodyRatioRO).then((res) => {
console.log(res)
this.setState({ loading: false })
})
this.props.onClickClose()
this.props.refresh()
} 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