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

triggerRatio!

parent ce59f4e2
...@@ -323,7 +323,7 @@ const create = (type = "") => { ...@@ -323,7 +323,7 @@ const create = (type = "") => {
const getReportFRLastMR = (body) => api.post('/transaction/summary_ratio/monthly_report_last_year/get_report_hierarki', body) 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 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 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 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 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) const getHierarkiReportHistorical = (body) => api.post('/transaction/summary_historical/summary/get_report_hierarki', body)
...@@ -361,7 +361,7 @@ const create = (type = "") => { ...@@ -361,7 +361,7 @@ const create = (type = "") => {
const checkApproverOLPA = () => api.get('transaction/outlook_pa/is_approver') const checkApproverOLPA = () => api.get('transaction/outlook_pa/is_approver')
const createPeriodeRevisionOLPA = (body) => api.post('transaction/outlook_pa/create_periode_revision', body) 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 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 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 getHierarkiDBPLRO = (body) => api.post('transaction/db_profit_loss/rolling_outlook/get_report_hierarki', body)
...@@ -429,8 +429,8 @@ const create = (type = "") => { ...@@ -429,8 +429,8 @@ const create = (type = "") => {
const validateSubmitReportFAM = (body) => api.post('transaction/fam/monthly_report/validate_save', body) 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 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 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 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}`) const getListUserSubcoOL = (periode) => api.get(`transaction/get_dashboard_sub_co/outlook_pa/${periode}`)
// Cronjob // Cronjob
...@@ -445,6 +445,10 @@ const create = (type = "") => { ...@@ -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 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 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 // MonthlyPL
// const getHierarkiMontlyReportPL = (body) => api.post('transaction/monthly_report_pl/get_report_hierarki', body) // 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) // const createMonthlyReportPL = (body) => api.post('transaction/monthly_report_pl/create_monthly_report', body)
...@@ -480,7 +484,7 @@ const create = (type = "") => { ...@@ -480,7 +484,7 @@ const create = (type = "") => {
const getMonitoringOLPA = (body) => api.get(`transaction/monitoring/outlook_pa?year=${body.year}`) const getMonitoringOLPA = (body) => api.get(`transaction/monitoring/outlook_pa?year=${body.year}`)
// Superadmin Approve // 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}`) const getIdToken = (userId) => api.get(`transaction/get_token/${userId}`)
// ------ // ------
// STEP 3 // STEP 3
...@@ -823,6 +827,9 @@ const create = (type = "") => { ...@@ -823,6 +827,9 @@ const create = (type = "") => {
createCATOLPA, createCATOLPA,
getRatioLOCF, getRatioLOCF,
triggerRatioFromLOCF, triggerRatioFromLOCF,
triggerRatioMB,
triggerRatioRO,
triggerRatioOLPA,
getMonitoringMB, getMonitoringMB,
getMonitoringMR, getMonitoringMR,
getMonitoringRO, getMonitoringRO,
......
...@@ -534,7 +534,7 @@ export default class BudgetTahunan extends Component { ...@@ -534,7 +534,7 @@ export default class BudgetTahunan 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.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) console.log(payload)
api.create().getSubmission(payload).then(response => { api.create().getSubmission(payload).then(response => {
...@@ -558,24 +558,35 @@ export default class BudgetTahunan extends Component { ...@@ -558,24 +558,35 @@ export default class BudgetTahunan extends Component {
// this.getPL(type) // this.getPL(type)
if (this.state.isAdmin) { if (this.state.isAdmin) {
console.log('masuk') 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) console.log(response)
if (response.data.data) { if (response.data.data) {
let dataListApprover = [] let dataListApprover = []
response.data.data.map((item,index) => { response.data.data.map((item, index) => {
dataListApprover.push({userId: item.user_id, fullname: item.fullname}) dataListApprover.push({ userId: item.user_id, fullname: item.fullname })
}) })
let defaultProps = { let defaultProps = {
options: dataListApprover, options: dataListApprover,
getOptionLabel: (option) => option.fullname, getOptionLabel: (option) => option.fullname,
}; };
this.setState({listApprover: defaultProps}) this.setState({ listApprover: defaultProps })
} }
}) })
} }
if (type != undefined && type == 'PL') { if (type != undefined && type == 'PL') {
// this.getCashFlow(type) // this.getCashFlow(type)
this.getPL(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 { } else {
this.setState({ loading: false }) this.setState({ loading: false })
} }
...@@ -2052,7 +2063,7 @@ export default class BudgetTahunan extends Component { ...@@ -2052,7 +2063,7 @@ export default class BudgetTahunan extends Component {
// }) // })
if (this.state.isAdmin && type == 'approve') { if (this.state.isAdmin && type == 'approve') {
localStorage.setItem(Constant.TOKEN, realToken) localStorage.setItem(Constant.TOKEN, realToken)
this.setState({visibleApproveSuperadmin: false}) this.setState({ visibleApproveSuperadmin: false })
} }
setTimeout(() => { setTimeout(() => {
if (type == 'revision') { if (type == 'revision') {
......
...@@ -54,7 +54,7 @@ export default class BalanceSheetMR extends Component { ...@@ -54,7 +54,7 @@ export default class BalanceSheetMR extends Component {
notes: "", notes: "",
judulColumn: null, judulColumn: null,
get_for: "view", get_for: "view",
viewOnly : true, viewOnly: true,
kansas: 0 kansas: 0
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -96,7 +96,7 @@ export default class BalanceSheetMR extends Component { ...@@ -96,7 +96,7 @@ export default class BalanceSheetMR extends Component {
checkStatus = false checkStatus = false
} }
this.setState({viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev}) this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
// this.setState({viewOnly: true}) // this.setState({viewOnly: true})
} }
...@@ -174,7 +174,7 @@ export default class BalanceSheetMR extends Component { ...@@ -174,7 +174,7 @@ export default class BalanceSheetMR extends Component {
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
"monthly_report_id": this.props.monthlyReportId, "monthly_report_id": this.props.monthlyReportId,
"months": this.props.month.month_id, "months": this.props.month.month_id,
"get_for" : this.state.get_for "get_for": this.state.get_for
} }
api.create().getHierarkiMontlyReportBS(payload).then(response => { api.create().getHierarkiMontlyReportBS(payload).then(response => {
console.log(payload); console.log(payload);
...@@ -321,7 +321,7 @@ export default class BalanceSheetMR extends Component { ...@@ -321,7 +321,7 @@ export default class BalanceSheetMR extends Component {
} }
handleGetFor(type) { handleGetFor(type) {
this.setState({get_for: type}, () => { this.setState({ get_for: type }, () => {
this.getSettingControl() this.getSettingControl()
this.getLatestUpdate() this.getLatestUpdate()
}) })
...@@ -440,7 +440,7 @@ export default class BalanceSheetMR extends Component { ...@@ -440,7 +440,7 @@ export default class BalanceSheetMR extends Component {
uploadBalanceSheet(type) { uploadBalanceSheet(type) {
let data = [] let data = []
this.setState({loading: true}) this.setState({ loading: true })
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
data.push({ data.push({
item_report_id: i[1], item_report_id: i[1],
...@@ -480,10 +480,20 @@ export default class BalanceSheetMR extends Component { ...@@ -480,10 +480,20 @@ export default class BalanceSheetMR extends Component {
// this.props.onClickClose() // this.props.onClickClose()
if (type == 'submitted') { if (type == 'submitted') {
this.props.saveToMonthlyReport('BS') this.props.saveToMonthlyReport('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 { } else {
this.props.saveToMonthlyReport() this.props.saveToMonthlyReport()
} }
this.setState({loading: false, handleTekTekTek: 0}) this.setState({ loading: false, handleTekTekTek: 0 })
// this.props.getReport() // this.props.getReport()
} 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 }, () => {
...@@ -540,6 +550,16 @@ export default class BalanceSheetMR extends Component { ...@@ -540,6 +550,16 @@ export default class BalanceSheetMR extends Component {
if (response.data.status === "success") { if (response.data.status === "success") {
if (type == 'submitted') { if (type == 'submitted') {
this.props.saveToMonthlyReport('BS') this.props.saveToMonthlyReport('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 { } else {
this.props.saveToMonthlyReport() this.props.saveToMonthlyReport()
} }
...@@ -568,23 +588,23 @@ export default class BalanceSheetMR extends Component { ...@@ -568,23 +588,23 @@ export default class BalanceSheetMR extends Component {
let editAble = this.state.editAble let editAble = this.state.editAble
let dataTable = this.state.dataTable let dataTable = this.state.dataTable
let kansas = this.state.kansas let kansas = this.state.kansas
console.log(dataTable[dataTable.length-1]) console.log(dataTable[dataTable.length - 1])
dataTable.map((i, index) => { dataTable.map((i, index) => {
if(i[0] === 3) { if (i[0] === 3) {
// console.log(i); // console.log(i);
// if ( i[17] === "" && (Number(i[12]) < this.state.minValue || Number(i[12]) > this.state.maxValue)) { // if ( i[17] === "" && (Number(i[12]) < this.state.minValue || Number(i[12]) > this.state.maxValue)) {
// console.log('msk 1'); // console.log('msk 1');
// // console.log(i); // // console.log(i);
// err = true // err = true
// } else // } else
if ( i[18] === "" && (Number(i[14]).toFixed(1) < this.state.minValue || Number(i[14]).toFixed(1) > this.state.maxValue)) { if (i[18] === "" && (Number(i[14]).toFixed(1) < this.state.minValue || Number(i[14]).toFixed(1) > this.state.maxValue)) {
console.log('msk 2'); console.log('msk 2');
err = true err = true
} }
} }
if (String(i[5]) == "Control (should be nil)") { if (String(i[5]) == "Control (should be nil)") {
if (Number(i[9]).toFixed(1) < this.state.minValue || Number(i[9]).toFixed(1) > this.state.maxValue ) { if (Number(i[9]).toFixed(1) < this.state.minValue || Number(i[9]).toFixed(1) > this.state.maxValue) {
errorContrl = true errorContrl = true
editAble = true editAble = true
} }
...@@ -648,23 +668,23 @@ export default class BalanceSheetMR extends Component { ...@@ -648,23 +668,23 @@ export default class BalanceSheetMR extends Component {
console.log(errorContrl); console.log(errorContrl);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
if (response.data.data.result && err === false && errorContrl === false ) { if (response.data.data.result && err === false && errorContrl === false) {
this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false }) this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false })
if (kansas == 0) { if (kansas == 0) {
this.setState({kansas: 1, loading: true}, () => { this.setState({ kansas: 1, loading: true }, () => {
this.handleValidate() this.handleValidate()
}) })
} else { } else {
this.setState({kansas: 0}) this.setState({ kansas: 0 })
} }
} else { } else {
this.setState({ loading: false, buttonError: true, editable: true, saveDraft: false }) this.setState({ loading: false, buttonError: true, editable: true, saveDraft: false })
if (kansas == 0) { if (kansas == 0) {
this.setState({kansas: 1, loading: true}, () => { this.setState({ kansas: 1, loading: true }, () => {
this.handleValidate() this.handleValidate()
}) })
} else { } else {
this.setState({kansas: 0}) this.setState({ kansas: 0 })
} }
} }
} else { } else {
...@@ -759,11 +779,11 @@ export default class BalanceSheetMR extends Component { ...@@ -759,11 +779,11 @@ export default class BalanceSheetMR extends Component {
// } // }
if (dex === 1) { if (dex === 1) {
let selisih = Number(dataTable2[tableMeta.rowIndex][11]) let selisih = Number(dataTable2[tableMeta.rowIndex][11])
let prevMonth = Number(String(dataTable2[tableMeta.rowIndex][10]).includes('-')? Number(dataTable2[tableMeta.rowIndex][10]) *-1 : dataTable2[tableMeta.rowIndex][10]) let prevMonth = Number(String(dataTable2[tableMeta.rowIndex][10]).includes('-') ? Number(dataTable2[tableMeta.rowIndex][10]) * -1 : dataTable2[tableMeta.rowIndex][10])
total = R.equals(selisih/prevMonth, 0) total = R.equals(selisih / prevMonth, 0)
|| R.equals(selisih/prevMonth, NaN) || R.equals(selisih / prevMonth, NaN)
|| R.equals(selisih/prevMonth, Infinity) || R.equals(selisih / prevMonth, Infinity)
|| R.equals(selisih/prevMonth, -Infinity) ? 0 : (selisih/prevMonth) * 100 || R.equals(selisih / prevMonth, -Infinity) ? 0 : (selisih / prevMonth) * 100
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = String(selisih).includes('-') ? Number(total * -1).toFixed(1) : Number(total).toFixed(1) // dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = String(selisih).includes('-') ? Number(total * -1).toFixed(1) : Number(total).toFixed(1)
...@@ -779,11 +799,11 @@ export default class BalanceSheetMR extends Component { ...@@ -779,11 +799,11 @@ export default class BalanceSheetMR extends Component {
// } // }
} else if (dex === 2) { } else if (dex === 2) {
let selisih = Number(dataTable2[tableMeta.rowIndex][13]) let selisih = Number(dataTable2[tableMeta.rowIndex][13])
let prevMonth = Number(String(dataTable2[tableMeta.rowIndex][7]).includes('-')? Number(dataTable2[tableMeta.rowIndex][7]) *-1 : dataTable2[tableMeta.rowIndex][7]) let prevMonth = Number(String(dataTable2[tableMeta.rowIndex][7]).includes('-') ? Number(dataTable2[tableMeta.rowIndex][7]) * -1 : dataTable2[tableMeta.rowIndex][7])
total = R.equals(selisih/prevMonth, 0) total = R.equals(selisih / prevMonth, 0)
|| R.equals(selisih/prevMonth, NaN) || R.equals(selisih / prevMonth, NaN)
|| R.equals(selisih/prevMonth, Infinity) || R.equals(selisih / prevMonth, Infinity)
|| R.equals(selisih/prevMonth, -Infinity) ? 0 : (selisih/prevMonth) * 100 || R.equals(selisih / prevMonth, -Infinity) ? 0 : (selisih / prevMonth) * 100
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = String(selisih).includes('-') ? Number(total * -1).toFixed(1) : Number(total).toFixed(1) // dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = String(selisih).includes('-') ? Number(total * -1).toFixed(1) : Number(total).toFixed(1)
// total = String(selisih).includes('-') && Number(tableMeta.rowData[9]) < Number(tableMeta.rowData[7]) ? Number(total * -1).toFixed(1) : Number(total).toFixed(1) // total = String(selisih).includes('-') && Number(tableMeta.rowData[9]) < Number(tableMeta.rowData[7]) ? Number(total * -1).toFixed(1) : Number(total).toFixed(1)
...@@ -792,11 +812,11 @@ export default class BalanceSheetMR extends Component { ...@@ -792,11 +812,11 @@ export default class BalanceSheetMR extends Component {
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1) // dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
} else if (dex === 3) { } else if (dex === 3) {
let selisih = Number(dataTable2[tableMeta.rowIndex][15]) let selisih = Number(dataTable2[tableMeta.rowIndex][15])
let prevMonth = Number(String(dataTable2[tableMeta.rowIndex][8]).includes('-')? Number(dataTable2[tableMeta.rowIndex][8]) *-1 : dataTable2[tableMeta.rowIndex][8]) let prevMonth = Number(String(dataTable2[tableMeta.rowIndex][8]).includes('-') ? Number(dataTable2[tableMeta.rowIndex][8]) * -1 : dataTable2[tableMeta.rowIndex][8])
total = R.equals(selisih/prevMonth, 0) total = R.equals(selisih / prevMonth, 0)
|| R.equals(selisih/prevMonth, NaN) || R.equals(selisih / prevMonth, NaN)
|| R.equals(selisih/prevMonth, Infinity) || R.equals(selisih / prevMonth, Infinity)
|| R.equals(selisih/prevMonth, -Infinity) ? 0 : (selisih/prevMonth) * 100 || R.equals(selisih / prevMonth, -Infinity) ? 0 : (selisih / prevMonth) * 100
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = String(selisih).includes('-') ? Number(total * -1).toFixed(1) : Number(total).toFixed(1) // dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = String(selisih).includes('-') ? Number(total * -1).toFixed(1) : Number(total).toFixed(1)
// total = String(selisih).includes('-') && Number(tableMeta.rowData[9]) < Number(tableMeta.rowData[8])? Number(total * -1).toFixed(1) : Number(total).toFixed(1) // total = String(selisih).includes('-') && Number(tableMeta.rowData[9]) < Number(tableMeta.rowData[8])? Number(total * -1).toFixed(1) : Number(total).toFixed(1)
...@@ -839,14 +859,14 @@ export default class BalanceSheetMR extends Component { ...@@ -839,14 +859,14 @@ export default class BalanceSheetMR extends Component {
if (String(item).includes('[M-1]')) { if (String(item).includes('[M-1]')) {
let tst = String(item).replace('[M-1]', '') let tst = String(item).replace('[M-1]', '')
// let indexID = dataTable2.findIndex((val) => val[21] == tst) // let indexID = dataTable2.findIndex((val) => val[21] == tst)
let data = tableMeta.rowData[20] == null? [] : tableMeta.rowData[20] let data = tableMeta.rowData[20] == null ? [] : tableMeta.rowData[20]
let indexID = data.findIndex((val) => val.item_formula == String(`${item}`)) let indexID = data.findIndex((val) => val.item_formula == String(`${item}`))
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = data[indexID].value let valuezz = data[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
} }
} else { } else {
let data = tableMeta.rowData[20] == null? [] : tableMeta.rowData[20] let data = tableMeta.rowData[20] == null ? [] : tableMeta.rowData[20]
let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`)) let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`))
if (indexID !== -1) { if (indexID !== -1) {
// console.log(tableMeta) // console.log(tableMeta)
...@@ -1412,7 +1432,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1412,7 +1432,7 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view'? this.state.get_for == 'view' ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
...@@ -1433,7 +1453,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1433,7 +1453,7 @@ export default class BalanceSheetMR extends Component {
style={{ color: this.props.isApprover || this.state.get_for == 'view' ? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.isApprover || this.state.get_for == 'view' ? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
value={Number(tableMeta.rowData[9]).toFixed(1)} value={Number(tableMeta.rowData[9]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1450,11 +1470,11 @@ export default class BalanceSheetMR extends Component { ...@@ -1450,11 +1470,11 @@ export default class BalanceSheetMR extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" && this.props.periode == 2021 && this.props.month.month_id == 1? "#5198ea" : "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" && this.props.periode == 2021 && this.props.month.month_id == 1 ? "#5198ea" : "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" && this.props.periode == 2021 && this.props.month.month_id == 1? false : true} disabled={String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" && this.props.periode == 2021 && this.props.month.month_id == 1 ? false : true}
value={String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" && this.props.periode == 2021 && this.props.month.month_id == 1? Number(tableMeta.rowData[9]).toFixed(1) : Number(handleValueFormula(tableMeta, 9)).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" && this.props.periode == 2021 && this.props.month.month_id == 1 ? Number(tableMeta.rowData[9]).toFixed(1) : Number(handleValueFormula(tableMeta, 9)).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1552,7 +1572,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1552,7 +1572,7 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ?
null : null :
this.state.get_for == 'view'? this.state.get_for == 'view' ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
...@@ -1697,7 +1717,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1697,7 +1717,7 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ?
null : null :
this.state.get_for == 'view'? this.state.get_for == 'view' ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
...@@ -1766,7 +1786,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1766,7 +1786,7 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ?
null : null :
this.state.get_for == 'view'? this.state.get_for == 'view' ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
...@@ -1841,7 +1861,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1841,7 +1861,7 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ?
null : null :
this.state.get_for == 'view'? this.state.get_for == 'view' ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
...@@ -1910,7 +1930,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1910,7 +1930,7 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ?
null : null :
this.state.get_for == 'view'? this.state.get_for == 'view' ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
...@@ -1985,7 +2005,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1985,7 +2005,7 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ?
null : null :
this.state.get_for == 'view'? this.state.get_for == 'view' ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
...@@ -2054,7 +2074,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2054,7 +2074,7 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ?
null : null :
this.state.get_for == 'view'? this.state.get_for == 'view' ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
...@@ -2166,7 +2186,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2166,7 +2186,7 @@ export default class BalanceSheetMR extends Component {
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
{tableMeta.rowData[0] !== 3 ? {tableMeta.rowData[0] !== 3 ?
null : null :
(this.state.get_for == 'view'? (this.state.get_for == 'view' ?
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
...@@ -2178,7 +2198,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2178,7 +2198,7 @@ export default class BalanceSheetMR extends Component {
defaultValue={tableMeta.rowData[17]} defaultValue={tableMeta.rowData[17]}
inputProps={{ inputProps={{
style: { style: {
color:'black', color: 'black',
textAlign: 'left' textAlign: 'left'
} }
}} }}
...@@ -2254,7 +2274,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2254,7 +2274,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={Number(tableMeta.rowData[12]) < this.state.minValue || Number(tableMeta.rowData[12]) > this.state.maxValue ? false : true} // disabled={Number(tableMeta.rowData[12]) < this.state.minValue || Number(tableMeta.rowData[12]) > this.state.maxValue ? false : true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
multiline={true} multiline={true}
defaultValue={tableMeta.rowData[17]} defaultValue={tableMeta.rowData[17]}
inputProps={{ inputProps={{
...@@ -2276,7 +2296,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2276,7 +2296,7 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
{tableMeta.rowData[0] !== 3 ? null : {tableMeta.rowData[0] !== 3 ? null :
(this.state.get_for == 'view'? (this.state.get_for == 'view' ?
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
...@@ -2288,7 +2308,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2288,7 +2308,7 @@ export default class BalanceSheetMR extends Component {
defaultValue={tableMeta.rowData[18]} defaultValue={tableMeta.rowData[18]}
inputProps={{ inputProps={{
style: { style: {
color:'black', color: 'black',
textAlign: 'left' textAlign: 'left'
} }
}} }}
...@@ -2307,7 +2327,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2307,7 +2327,7 @@ export default class BalanceSheetMR extends Component {
placeholder="" placeholder=""
multiline={true} multiline={true}
// disabled={false} // disabled={false}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
defaultValue={tableMeta.rowData[18]} defaultValue={tableMeta.rowData[18]}
inputProps={{ inputProps={{
style: { style: {
...@@ -2367,7 +2387,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2367,7 +2387,7 @@ export default class BalanceSheetMR extends Component {
multiline={true} multiline={true}
placeholder="" placeholder=""
// disabled={Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? false : true} // disabled={Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? false : true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
defaultValue={tableMeta.rowData[18]} defaultValue={tableMeta.rowData[18]}
inputProps={{ inputProps={{
style: { style: {
...@@ -2388,7 +2408,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2388,7 +2408,7 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
{tableMeta.rowData[0] !== 3 ? null : {tableMeta.rowData[0] !== 3 ? null :
(this.state.get_for == 'view'? (this.state.get_for == 'view' ?
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
...@@ -2400,7 +2420,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2400,7 +2420,7 @@ export default class BalanceSheetMR extends Component {
defaultValue={tableMeta.rowData[19]} defaultValue={tableMeta.rowData[19]}
inputProps={{ inputProps={{
style: { style: {
color:'black', color: 'black',
textAlign: 'left' textAlign: 'left'
} }
}} }}
...@@ -2477,7 +2497,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2477,7 +2497,7 @@ export default class BalanceSheetMR extends Component {
multiline={true} multiline={true}
placeholder="" placeholder=""
// disabled={Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? false : true} // disabled={Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? false : true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
defaultValue={tableMeta.rowData[19]} defaultValue={tableMeta.rowData[19]}
inputProps={{ inputProps={{
style: { style: {
...@@ -2588,7 +2608,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2588,7 +2608,7 @@ export default class BalanceSheetMR extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
{this.props.isApprover === true || this.state.get_for == 'view'? {this.props.isApprover === true || this.state.get_for == 'view' ?
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download'} data-for="download"> <a data-tip={'Download'} data-for="download">
<button <button
...@@ -2675,9 +2695,9 @@ export default class BalanceSheetMR extends Component { ...@@ -2675,9 +2695,9 @@ export default class BalanceSheetMR extends Component {
)} )}
</div> </div>
<div style={{display: 'flex'}}> <div style={{ display: 'flex' }}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : </Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : </Typography>
<div style={{marginLeft: 10, overflowY: 'scroll', height: this.state.updateBy.length < 2 ? 25 : 75, marginTop: 10}}> <div style={{ marginLeft: 10, overflowY: 'scroll', height: this.state.updateBy.length < 2 ? 25 : 75, marginTop: 10 }}>
{ {
this.state.updateBy.length > 0 ? this.state.updateBy.reverse().map((item, index) => { this.state.updateBy.length > 0 ? this.state.updateBy.reverse().map((item, index) => {
return ( return (
...@@ -2749,7 +2769,7 @@ export default class BalanceSheetMR extends Component { ...@@ -2749,7 +2769,7 @@ export default class BalanceSheetMR extends Component {
marginRight: 20 marginRight: 20
}} }}
onClick={() => { onClick={() => {
this.setState({loading: true}, () => { this.setState({ loading: true }, () => {
this.handleGetFor('edit') this.handleGetFor('edit')
}) })
}} }}
...@@ -2854,8 +2874,8 @@ export default class BalanceSheetMR extends Component { ...@@ -2854,8 +2874,8 @@ export default class BalanceSheetMR extends Component {
)} )}
</div> </div>
</div> </div>
<div className="grid grid-2x" style={{ marginTop: 10, padding: 20}}> <div className="grid grid-2x" style={{ marginTop: 10, padding: 20 }}>
<div className="col-1" style={{paddingLeft: 0}}> <div className="col-1" style={{ paddingLeft: 0 }}>
<button <button
type="button" type="button"
onClick={() => this.setState({ loading: true, visibleBSMR: true }, () => { onClick={() => this.setState({ loading: true, visibleBSMR: true }, () => {
......
...@@ -326,6 +326,16 @@ export default class BalanceSheetOLPA extends Component { ...@@ -326,6 +326,16 @@ export default class BalanceSheetOLPA extends Component {
console.log(data); console.log(data);
this.setState({ loading: false }) this.setState({ loading: false })
this.props.saveToOLPA(payload) 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() this.props.onClickClose()
} }
...@@ -484,6 +494,16 @@ export default class BalanceSheetOLPA extends Component { ...@@ -484,6 +494,16 @@ export default class BalanceSheetOLPA extends Component {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { 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.onClickClose()
this.props.getReport() this.props.getReport()
} else { } else {
......
...@@ -372,6 +372,17 @@ export default class BalanceSheetRO extends Component { ...@@ -372,6 +372,17 @@ export default class BalanceSheetRO extends Component {
// console.log(JSON.stringify(payload)) // console.log(JSON.stringify(payload))
if (response.data) { if (response.data) {
if (response.data.status === "success") { 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.onClickClose()
this.props.refresh() this.props.refresh()
} else { } else {
...@@ -582,6 +593,17 @@ export default class BalanceSheetRO extends Component { ...@@ -582,6 +593,17 @@ export default class BalanceSheetRO extends Component {
// console.log(JSON.stringify(payload)) // console.log(JSON.stringify(payload))
if (response.data) { if (response.data) {
if (response.data.status === "success") { 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.onClickClose()
this.props.refresh() this.props.refresh()
} 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