Commit e064b3bb authored by faisalhamdi's avatar faisalhamdi

update report FR

parent 6e8de3dc
...@@ -224,6 +224,7 @@ const create = (type = "") => { ...@@ -224,6 +224,7 @@ const create = (type = "") => {
const getLastestUpdateOI = (body) => api.post('transaction/operating_indicator/get_latest_update', body) const getLastestUpdateOI = (body) => api.post('transaction/operating_indicator/get_latest_update', body)
const getLastPeriodeOI = (idCompany) => api.post(`transaction/master_budget/get_last_periode/${idCompany}`) const getLastPeriodeOI = (idCompany) => api.post(`transaction/master_budget/get_last_periode/${idCompany}`)
const getReportHierarkiPL = (body) => api.post('transaction/db_report_detail/get_report_hierarki', body) const getReportHierarkiPL = (body) => api.post('transaction/db_report_detail/get_report_hierarki', body)
const getReportHierarkiFR = (body) => api.post('transaction/db_ratio/get_report_hierarki', body)
//CASH FLOW //CASH FLOW
const getDetailReportCF = (body) => api.post('/transaction/cash_flow/get_report_hierarki', body) const getDetailReportCF = (body) => api.post('/transaction/cash_flow/get_report_hierarki', body)
...@@ -431,7 +432,8 @@ const create = (type = "") => { ...@@ -431,7 +432,8 @@ const create = (type = "") => {
getLastPeriodOI, getLastPeriodOI,
getDashboardUser, getDashboardUser,
getDetailReportCF, getDetailReportCF,
getReportHierarkiPL getReportHierarkiPL,
getReportHierarkiFR
} }
} }
......
...@@ -451,91 +451,91 @@ export default class SubHolding extends Component { ...@@ -451,91 +451,91 @@ export default class SubHolding extends Component {
} }
}) })
} else if (this.state.report.value === 4) { } else if (this.state.report.value === 4) {
api.create().getDetailReportMB(payload).then(response => { api.create().getReportHierarkiFR(payload).then(response => {
console.log(payload); // console.log(payload);
console.log(response); console.log(response);
// let dataTable = [] let dataTable = []
// if (response.data) { if (response.data) {
// let res = response.data.data let res = response.data.data
// const handlePushChild = (item) => { const handlePushChild = (item) => {
// let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
// if (indexIDzz === -1) { if (indexIDzz === -1) {
// dataTable.push([ dataTable.push([
// item.type_report_id, item.type_report_id,
// item.id, item.id,
// item.parent, item.parent,
// item.formula, item.formula,
// item.level, item.level,
// item.description, item.description,
// item.balance_sheet.total_actual_before === null ? "0.0" : item.balance_sheet.total_actual_before === "" ? "0.0" : item.balance_sheet.total_actual_before, item.ratio.total_actual_before === null ? "0.0" : item.ratio.total_actual_before === "" ? "0.0" : item.ratio.total_actual_before,
// Number(item.balance_sheet.january).toFixed(1), Number(item.ratio.january).toFixed(1),
// Number(item.balance_sheet.february).toFixed(1), Number(item.ratio.february).toFixed(1),
// Number(item.balance_sheet.march).toFixed(1), Number(item.ratio.march).toFixed(1),
// Number(item.balance_sheet.april).toFixed(1), Number(item.ratio.april).toFixed(1),
// Number(item.balance_sheet.may).toFixed(1), Number(item.ratio.may).toFixed(1),
// Number(item.balance_sheet.june).toFixed(1), Number(item.ratio.june).toFixed(1),
// Number(item.balance_sheet.july).toFixed(1), Number(item.ratio.july).toFixed(1),
// Number(item.balance_sheet.august).toFixed(1), Number(item.ratio.august).toFixed(1),
// Number(item.balance_sheet.september).toFixed(1), Number(item.ratio.september).toFixed(1),
// Number(item.balance_sheet.october).toFixed(1), Number(item.ratio.october).toFixed(1),
// Number(item.balance_sheet.november).toFixed(1), Number(item.ratio.november).toFixed(1),
// Number(item.balance_sheet.december).toFixed(1), Number(item.ratio.december).toFixed(1),
// Number(item.balance_sheet.total_current_year).toFixed(1), Number(item.ratio.total_current_year).toFixed(1),
// Number(item.balance_sheet.total_next_year).toFixed(1), Number(item.ratio.total_next_year).toFixed(1),
// Number(item.balance_sheet.total_more_year).toFixed(1), Number(item.ratio.total_more_year).toFixed(1),
// item.order, item.order,
// item.condition_it_should_be, item.condition_it_should_be,
// item.condition_if_wrong item.condition_if_wrong
// ]) ])
// } }
// if (item.children !== null) { if (item.children !== null) {
// if (item.children.length > 0) { if (item.children.length > 0) {
// item.children.map((items, indexs) => { item.children.map((items, indexs) => {
// handlePushChild(items) handlePushChild(items)
// }) })
// } }
// } }
// } }
// res.map((item, index) => { res.map((item, index) => {
// dataTable.push([ dataTable.push([
// item.type_report_id, item.type_report_id,
// item.id, item.id,
// item.parent, item.parent,
// item.formula, item.formula,
// item.level, item.level,
// item.description, item.description,
// item.balance_sheet.total_actual_before === null ? "0.0" : item.balance_sheet.total_actual_before === "" ? "0.0" : item.balance_sheet.total_actual_before, item.ratio.total_actual_before === null ? "0.0" : item.ratio.total_actual_before === "" ? "0.0" : item.ratio.total_actual_before,
// Number(item.balance_sheet.january).toFixed(1), Number(item.ratio.january).toFixed(1),
// Number(item.balance_sheet.february).toFixed(1), Number(item.ratio.february).toFixed(1),
// Number(item.balance_sheet.march).toFixed(1), Number(item.ratio.march).toFixed(1),
// Number(item.balance_sheet.april).toFixed(1), Number(item.ratio.april).toFixed(1),
// Number(item.balance_sheet.may).toFixed(1), Number(item.ratio.may).toFixed(1),
// Number(item.balance_sheet.june).toFixed(1), Number(item.ratio.june).toFixed(1),
// Number(item.balance_sheet.july).toFixed(1), Number(item.ratio.july).toFixed(1),
// Number(item.balance_sheet.august).toFixed(1), Number(item.ratio.august).toFixed(1),
// Number(item.balance_sheet.september).toFixed(1), Number(item.ratio.september).toFixed(1),
// Number(item.balance_sheet.october).toFixed(1), Number(item.ratio.october).toFixed(1),
// Number(item.balance_sheet.november).toFixed(1), Number(item.ratio.november).toFixed(1),
// Number(item.balance_sheet.december).toFixed(1), Number(item.ratio.december).toFixed(1),
// Number(item.balance_sheet.total_current_year).toFixed(1), Number(item.ratio.total_current_year).toFixed(1),
// Number(item.balance_sheet.total_next_year).toFixed(1), Number(item.ratio.total_next_year).toFixed(1),
// Number(item.balance_sheet.total_more_year).toFixed(1), Number(item.ratio.total_more_year).toFixed(1),
// item.order, item.order,
// item.condition_it_should_be, item.condition_it_should_be,
// item.condition_if_wrong item.condition_if_wrong
// ]) ])
// if (item.children !== null) { if (item.children !== null) {
// if (item.children.length > 0) { if (item.children.length > 0) {
// item.children.map((items, indexs) => { item.children.map((items, indexs) => {
// handlePushChild(items) handlePushChild(items)
// }) })
// } }
// } }
// }) })
// this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true }) this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
// } else { } else {
// this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false }) this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: 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