Commit bb93b490 authored by d.arizona's avatar d.arizona

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into didam

parents ae95c328 4d4f3397
...@@ -1867,86 +1867,6 @@ export default class SubHolding extends Component { ...@@ -1867,86 +1867,6 @@ export default class SubHolding extends Component {
}) })
} }
getTaxPlanMR(payload) {
api.create().getReportTPMR(payload).then(response => {
console.log(payload);
console.log(response);
let dataTable = this.state.dataTable
console.log(dataTable)
let dataTable2 = []
if (response.data) {
let res = response.data.data
res.map((item, index) => {
let indexID = dataTable.findIndex((val) => val[4] == item.id)
if (indexID != -1) {
const handlePushChild = (items) => {
let indexIDzz = dataTable.findIndex((val) => val[4] === items.id)
// console.log(indexIDzz)
if (indexIDzz != -1) {
dataTable2.push([...dataTable[indexIDzz],
Number(items.tax_planning_report.january).toFixed(1),
Number(items.tax_planning_report.february).toFixed(1),
Number(items.tax_planning_report.march).toFixed(1),
Number(items.tax_planning_report.april).toFixed(1),
Number(items.tax_planning_report.may).toFixed(1),
Number(items.tax_planning_report.june).toFixed(1),
Number(items.tax_planning_report.july).toFixed(1),
Number(items.tax_planning_report.august).toFixed(1),
Number(items.tax_planning_report.september).toFixed(1),
Number(items.tax_planning_report.october).toFixed(1),
Number(items.tax_planning_report.november).toFixed(1),
Number(items.tax_planning_report.december).toFixed(1),
Number(items.tax_planning_report.total_actual_before).toFixed(1),
])
}
if (items.children !== null) {
if (items.children.length > 0) {
items.children.map((itemss, indexss) => {
handlePushChild(itemss)
})
}
}
}
dataTable2.push([...dataTable[indexID],
Number(item.tax_planning_report.january).toFixed(1),
Number(item.tax_planning_report.february).toFixed(1),
Number(item.tax_planning_report.march).toFixed(1),
Number(item.tax_planning_report.april).toFixed(1),
Number(item.tax_planning_report.may).toFixed(1),
Number(item.tax_planning_report.june).toFixed(1),
Number(item.tax_planning_report.july).toFixed(1),
Number(item.tax_planning_report.august).toFixed(1),
Number(item.tax_planning_report.september).toFixed(1),
Number(item.tax_planning_report.october).toFixed(1),
Number(item.tax_planning_report.november).toFixed(1),
Number(item.tax_planning_report.december).toFixed(1),
Number(item.tax_planning_report.total_actual_before).toFixed(1),
])
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
}
}
})
console.log(dataTable2)
this.setState({ dataTable: dataTable2, previewTable: true, loading: false, previewDownload: true })
// this.setState({ dataTable2 }, () => {
// // console.log(this.state.dataTable2)
// this.getTaxPlanLastMR(payloadLast)
// })
} else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
}
})
}
getReportPLMR(payload) { getReportPLMR(payload) {
let payloadLast = { let payloadLast = {
"report_id": this.state.report.value, "report_id": this.state.report.value,
...@@ -2340,6 +2260,19 @@ export default class SubHolding extends Component { ...@@ -2340,6 +2260,19 @@ export default class SubHolding extends Component {
a.download = 'Report DB Financial Ratio.xlsx'; a.download = 'Report DB Financial Ratio.xlsx';
a.click(); a.click();
} }
} else if (this.state.report.value === 5) {
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_tax_planning/export_report?submission_id=${this.state.submissionID === null ? "" : this.state.submissionID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}`
)
res = await res.blob()
this.setState({ loading: false })
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'Report DB Tax Planning.xlsx';
a.click();
}
} else if (this.state.report.value === 21) { } else if (this.state.report.value === 21) {
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_operating_indicator/export_report?operating_indicator_id=${this.state.OPID === null ? "" : this.state.OPID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}` let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_operating_indicator/export_report?operating_indicator_id=${this.state.OPID === null ? "" : this.state.OPID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}`
console.log(url); console.log(url);
......
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