Commit b3763a9c authored by Rifka Kurnia's avatar Rifka Kurnia

Merge branch 'rifka' into 'master'

tp get mr

See merge request !1027
parents a0cb23e1 c23598d9
...@@ -733,9 +733,10 @@ export default class SubHolding extends Component { ...@@ -733,9 +733,10 @@ export default class SubHolding extends Component {
} }
} }
}) })
this.setState({ dataTable, loading: false, previewTable: true, previewDownload: true }, () => { console.log(dataTable)
console.log(this.state.dataTable) // this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
// this.getTaxPlanMR(payload) this.setState({ dataTable }, () => {
this.getTaxPlanMR(payload)
}) })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
...@@ -1643,86 +1644,83 @@ export default class SubHolding extends Component { ...@@ -1643,86 +1644,83 @@ export default class SubHolding extends Component {
} }
getTaxPlanMR(payload) { getTaxPlanMR(payload) {
let payloadLast = {
"report_id": this.state.report.value,
"revision": this.state.revisionType,
"periode": Number(this.state.periode.periode) - 1,
"company_id": this.state.company.company_id,
"submission_id": this.state.submissionID
}
api.create().getReportTPMR(payload).then(response => { api.create().getReportTPMR(payload).then(response => {
console.log(payload); console.log(payload);
console.log(response); console.log(response);
let dataTable = this.state.dataTable let dataTable = this.state.dataTable
// let dataTable2 = [] console.log(dataTable)
// if (response.data) { let dataTable2 = []
// let res = response.data.data if (response.data) {
// res.map((item,index) => { let res = response.data.data
// let indexID = dataTable.findIndex((val) => val[1] == item.id) res.map((item,index) => {
// if (indexID != -1) { let indexID = dataTable.findIndex((val) => val[4] == item.id)
// const handlePushChild = (items) => { console.log(indexID)
// let indexIDzz = dataTable.findIndex((val) => val[1] === items.id) if (indexID != -1) {
// // console.log(indexIDzz) const handlePushChild = (items) => {
// if (indexIDzz != -1) { let indexIDzz = dataTable.findIndex((val) => val[4] === items.id)
// dataTable2.push([...dataTable[indexIDzz], // console.log(indexIDzz)
// Number(items.balance_sheet.january).toFixed(1), if (indexIDzz != -1) {
// Number(items.balance_sheet.february).toFixed(1), dataTable2.push([...dataTable[indexIDzz],
// Number(items.balance_sheet.march).toFixed(1), Number(items.tax_planning_report.january).toFixed(1),
// Number(items.balance_sheet.april).toFixed(1), Number(items.tax_planning_report.february).toFixed(1),
// Number(items.balance_sheet.may).toFixed(1), Number(items.tax_planning_report.march).toFixed(1),
// Number(items.balance_sheet.june).toFixed(1), Number(items.tax_planning_report.april).toFixed(1),
// Number(items.balance_sheet.july).toFixed(1), Number(items.tax_planning_report.may).toFixed(1),
// Number(items.balance_sheet.august).toFixed(1), Number(items.tax_planning_report.june).toFixed(1),
// Number(items.balance_sheet.september).toFixed(1), Number(items.tax_planning_report.july).toFixed(1),
// Number(items.balance_sheet.october).toFixed(1), Number(items.tax_planning_report.august).toFixed(1),
// Number(items.balance_sheet.november).toFixed(1), Number(items.tax_planning_report.september).toFixed(1),
// Number(items.balance_sheet.december).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),
// if (items.children !== null) { Number(items.tax_planning_report.total_actual_before).toFixed(1),
// if (items.children.length > 0) { ])
// items.children.map((itemss, indexss) => { }
// handlePushChild(itemss) if (items.children !== null) {
// }) if (items.children.length > 0) {
// } items.children.map((itemss, indexss) => {
// } handlePushChild(itemss)
// } })
}
}
}
// dataTable2.push([...dataTable[indexID], dataTable2.push([...dataTable[indexID],
// Number(item.balance_sheet.january).toFixed(1), Number(item.tax_planning_report.january).toFixed(1),
// Number(item.balance_sheet.february).toFixed(1), Number(item.tax_planning_report.february).toFixed(1),
// Number(item.balance_sheet.march).toFixed(1), Number(item.tax_planning_report.march).toFixed(1),
// Number(item.balance_sheet.april).toFixed(1), Number(item.tax_planning_report.april).toFixed(1),
// Number(item.balance_sheet.may).toFixed(1), Number(item.tax_planning_report.may).toFixed(1),
// Number(item.balance_sheet.june).toFixed(1), Number(item.tax_planning_report.june).toFixed(1),
// Number(item.balance_sheet.july).toFixed(1), Number(item.tax_planning_report.july).toFixed(1),
// Number(item.balance_sheet.august).toFixed(1), Number(item.tax_planning_report.august).toFixed(1),
// Number(item.balance_sheet.september).toFixed(1), Number(item.tax_planning_report.september).toFixed(1),
// Number(item.balance_sheet.october).toFixed(1), Number(item.tax_planning_report.october).toFixed(1),
// Number(item.balance_sheet.november).toFixed(1), Number(item.tax_planning_report.november).toFixed(1),
// Number(item.balance_sheet.december).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 !== 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)
// }) })
// } }
// } }
// } }
// }) })
// console.log(dataTable2) console.log(dataTable2)
// // this.setState({ dataTable: dataTable2, previewTable: true, loading: false, previewDownload: true }) this.setState({ dataTable: dataTable2, previewTable: true, loading: false, previewDownload: true })
// this.setState({ dataTable2 }, () => { // this.setState({ dataTable2 }, () => {
// // console.log(this.state.dataTable2) // // console.log(this.state.dataTable2)
// this.getTaxPlanLastMR(payloadLast) // this.getTaxPlanLastMR(payloadLast)
// }) // })
// } else { } else {
// this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false }) this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
// } }
}) })
} }
......
This diff is collapsed.
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