Commit c23598d9 authored by rifkaki's avatar rifkaki

tp get mr

parent a0cb23e1
......@@ -733,9 +733,10 @@ export default class SubHolding extends Component {
}
}
})
this.setState({ dataTable, loading: false, previewTable: true, previewDownload: true }, () => {
console.log(this.state.dataTable)
// this.getTaxPlanMR(payload)
console.log(dataTable)
// this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
this.setState({ dataTable }, () => {
this.getTaxPlanMR(payload)
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
......@@ -1643,86 +1644,83 @@ export default class SubHolding extends Component {
}
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 => {
console.log(payload);
console.log(response);
let dataTable = this.state.dataTable
// let dataTable2 = []
// if (response.data) {
// let res = response.data.data
// res.map((item,index) => {
// let indexID = dataTable.findIndex((val) => val[1] == item.id)
// if (indexID != -1) {
// const handlePushChild = (items) => {
// let indexIDzz = dataTable.findIndex((val) => val[1] === items.id)
// // console.log(indexIDzz)
// if (indexIDzz != -1) {
// dataTable2.push([...dataTable[indexIDzz],
// Number(items.balance_sheet.january).toFixed(1),
// Number(items.balance_sheet.february).toFixed(1),
// Number(items.balance_sheet.march).toFixed(1),
// Number(items.balance_sheet.april).toFixed(1),
// Number(items.balance_sheet.may).toFixed(1),
// Number(items.balance_sheet.june).toFixed(1),
// Number(items.balance_sheet.july).toFixed(1),
// Number(items.balance_sheet.august).toFixed(1),
// Number(items.balance_sheet.september).toFixed(1),
// Number(items.balance_sheet.october).toFixed(1),
// Number(items.balance_sheet.november).toFixed(1),
// Number(items.balance_sheet.december).toFixed(1),
// ])
// }
// if (items.children !== null) {
// if (items.children.length > 0) {
// items.children.map((itemss, indexss) => {
// handlePushChild(itemss)
// })
// }
// }
// }
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)
console.log(indexID)
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.balance_sheet.january).toFixed(1),
// Number(item.balance_sheet.february).toFixed(1),
// Number(item.balance_sheet.march).toFixed(1),
// Number(item.balance_sheet.april).toFixed(1),
// Number(item.balance_sheet.may).toFixed(1),
// Number(item.balance_sheet.june).toFixed(1),
// Number(item.balance_sheet.july).toFixed(1),
// Number(item.balance_sheet.august).toFixed(1),
// Number(item.balance_sheet.september).toFixed(1),
// Number(item.balance_sheet.october).toFixed(1),
// Number(item.balance_sheet.november).toFixed(1),
// Number(item.balance_sheet.december).toFixed(1),
// ])
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)
// })
// }
// }
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 })
})
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 })
// }
} else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
}
})
}
......
......@@ -9991,7 +9991,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(1).toFixed(1)}
value={Number(tableMeta.rowData[22]).toFixed(1)}
/>
}
/>
......@@ -10014,7 +10014,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(2).toFixed(1)}
value={Number(tableMeta.rowData[23]).toFixed(1)}
/>
}
/>
......@@ -10037,7 +10037,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(3).toFixed(1)}
value={Number(tableMeta.rowData[24]).toFixed(1)}
/>
}
/>
......@@ -10060,7 +10060,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(4).toFixed(1)}
value={Number(tableMeta.rowData[25]).toFixed(1)}
/>
}
/>
......@@ -10085,7 +10085,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(5).toFixed(1)}
value={Number(tableMeta.rowData[26]).toFixed(1)}
/>
}
/>
......@@ -10108,7 +10108,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(6).toFixed(1)}
value={Number(tableMeta.rowData[27]).toFixed(1)}
/>
}
/>
......@@ -10131,7 +10131,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(7).toFixed(1)}
value={Number(tableMeta.rowData[28]).toFixed(1)}
/>
}
/>
......@@ -10154,7 +10154,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(8).toFixed(1)}
value={Number(tableMeta.rowData[29]).toFixed(1)}
/>
}
/>
......@@ -10179,7 +10179,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(9).toFixed(1)}
value={Number(tableMeta.rowData[30]).toFixed(1)}
/>
}
/>
......@@ -10202,7 +10202,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(10).toFixed(1)}
value={Number(tableMeta.rowData[31]).toFixed(1)}
/>
}
/>
......@@ -10225,7 +10225,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(11).toFixed(1)}
value={Number(tableMeta.rowData[32]).toFixed(1)}
/>
}
/>
......@@ -10248,7 +10248,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(12).toFixed(1)}
value={Number(tableMeta.rowData[33]).toFixed(1)}
/>
}
/>
......@@ -10271,7 +10271,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(13).toFixed(1)}
value={Number(tableMeta.rowData[34]).toFixed(1)}
/>
}
/>
......@@ -10284,7 +10284,72 @@ export default class TableSubHolding extends Component {
)
}
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},
]
const columnDBOI = [
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