Commit d56b1ea3 authored by Rifka Kurnia's avatar Rifka Kurnia

Merge branch 'rifka' into 'master'

historical

See merge request !1094
parents 59c7d0dd f4fc329e
...@@ -1191,87 +1191,179 @@ export default class SummaryOfTriputra extends Component { ...@@ -1191,87 +1191,179 @@ export default class SummaryOfTriputra extends Component {
console.log(newPayload); console.log(newPayload);
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[0] === item.company_id)
// if (indexIDzz === -1) { if (indexIDzz === -1) {
// dataTable.push([ dataTable.push([
// item.type_report_id, item.company_id,
// item.id, item.parent,
// item.parent, item.level,
// item.formula, item.company_name,
// item.level, item.revenue_one,
// item.description, item.revenue_two,
// item.ratio.total_actual_before === null ? "0.0" : item.ratio.total_actual_before === "" ? "0.0" : item.ratio.total_actual_before, item.revenue_three,
// Number(item.ratio.january).toFixed(1), item.revenue_four,
// Number(item.ratio.february).toFixed(1), item.revenue_five,
// Number(item.ratio.march).toFixed(1), item.revenue_six,
// Number(item.ratio.april).toFixed(1), item.revenue_seven,
// Number(item.ratio.may).toFixed(1), item.revenue_eight,
// Number(item.ratio.june).toFixed(1), item.revenue_nine,
// Number(item.ratio.july).toFixed(1), item.revenue_ten,
// Number(item.ratio.august).toFixed(1), item.revenue_twelve,
// Number(item.ratio.september).toFixed(1), item.ebitda_one,
// Number(item.ratio.october).toFixed(1), item.ebitda_two,
// Number(item.ratio.november).toFixed(1), item.ebitda_three,
// Number(item.ratio.december).toFixed(1), item.ebitda_four,
// Number(item.ratio.total_current_year).toFixed(1), item.ebitda_five,
// Number(item.ratio.total_next_year).toFixed(1), item.ebitda_six,
// Number(item.ratio.total_more_year).toFixed(1), item.ebitda_seven,
// item.order, item.ebitda_eight,
// item.condition_it_should_be, item.ebitda_nine,
// item.condition_if_wrong item.ebitda_ten,
// ]) item.ebitda_twelve,
// } item.tpat_one,
// if (item.children !== null) { item.tpat_two,
// if (item.children.length > 0) { item.tpat_three,
// item.children.map((items, indexs) => { item.tpat_four,
// handlePushChild(items) item.tpat_five,
// }) item.tpat_six,
// } item.tpat_seven,
// } item.tpat_eight,
// } item.tpat_nine,
// res.map((item, index) => { item.tpat_ten,
// dataTable.push([ item.tpat_twelve,
// item.type_report_id, item.npat_one,
// item.id, item.npat_two,
// item.parent, item.npat_three,
// item.formula, item.npat_four,
// item.level, item.npat_five,
// item.description, item.npat_six,
// item.ratio.total_actual_before === null ? "0.0" : item.ratio.total_actual_before === "" ? "0.0" : item.ratio.total_actual_before, item.npat_seven,
// Number(item.ratio.january).toFixed(1), item.npat_eight,
// Number(item.ratio.february).toFixed(1), item.npat_nine,
// Number(item.ratio.march).toFixed(1), item.npat_ten,
// Number(item.ratio.april).toFixed(1), item.npat_twelve,
// Number(item.ratio.may).toFixed(1), item.total_asset_one,
// Number(item.ratio.june).toFixed(1), item.total_asset_two,
// Number(item.ratio.july).toFixed(1), item.total_asset_three,
// Number(item.ratio.august).toFixed(1), item.total_asset_four,
// Number(item.ratio.september).toFixed(1), item.total_asset_five,
// Number(item.ratio.october).toFixed(1), item.total_asset_six,
// Number(item.ratio.november).toFixed(1), item.total_asset_seven,
// Number(item.ratio.december).toFixed(1), item.total_asset_eight,
// Number(item.ratio.total_current_year).toFixed(1), item.total_asset_nine,
// Number(item.ratio.total_next_year).toFixed(1), item.total_asset_ten,
// Number(item.ratio.total_more_year).toFixed(1), item.total_asset_twelve,
// item.order, item.total_equity_one,
// item.condition_it_should_be, item.total_equity_two,
// item.condition_if_wrong item.total_equity_three,
// ]) item.total_equity_four,
// if (item.children !== null) { item.total_equity_five,
// if (item.children.length > 0) { item.total_equity_six,
// item.children.map((items, indexs) => { item.total_equity_seven,
// handlePushChild(items) item.total_equity_eight,
// }) item.total_equity_nine,
// } item.total_equity_ten,
// } item.total_equity_twelve,
// }) item.order,
])
}
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
}
}
res.map((item, index) => {
dataTable.push([
item.company_id,
item.parent,
item.level,
item.company_name,
item.revenue_one,
item.revenue_two,
item.revenue_three,
item.revenue_four,
item.revenue_five,
item.revenue_six,
item.revenue_seven,
item.revenue_eight,
item.revenue_nine,
item.revenue_ten,
item.revenue_twelve,
item.ebitda_one,
item.ebitda_two,
item.ebitda_three,
item.ebitda_four,
item.ebitda_five,
item.ebitda_six,
item.ebitda_seven,
item.ebitda_eight,
item.ebitda_nine,
item.ebitda_ten,
item.ebitda_twelve,
item.tpat_one,
item.tpat_two,
item.tpat_three,
item.tpat_four,
item.tpat_five,
item.tpat_six,
item.tpat_seven,
item.tpat_eight,
item.tpat_nine,
item.tpat_ten,
item.tpat_twelve,
item.npat_one,
item.npat_two,
item.npat_three,
item.npat_four,
item.npat_five,
item.npat_six,
item.npat_seven,
item.npat_eight,
item.npat_nine,
item.npat_ten,
item.npat_twelve,
item.total_asset_one,
item.total_asset_two,
item.total_asset_three,
item.total_asset_four,
item.total_asset_five,
item.total_asset_six,
item.total_asset_seven,
item.total_asset_eight,
item.total_asset_nine,
item.total_asset_ten,
item.total_asset_twelve,
item.total_equity_one,
item.total_equity_two,
item.total_equity_three,
item.total_equity_four,
item.total_equity_five,
item.total_equity_six,
item.total_equity_seven,
item.total_equity_eight,
item.total_equity_nine,
item.total_equity_ten,
item.total_equity_twelve,
item.order,
])
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
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 })
// } }
}) })
} }
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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