Commit 716e5e41 authored by rifkaki's avatar rifkaki

tp api baru

parent 0b4a2308
...@@ -244,6 +244,7 @@ const create = (type = "") => { ...@@ -244,6 +244,7 @@ const create = (type = "") => {
const getReportPLMR = (body) => api.post('/transaction/db_profit_loss/monthly_report/get_report_hierarki', body) const getReportPLMR = (body) => api.post('/transaction/db_profit_loss/monthly_report/get_report_hierarki', body)
const getReportTPMB = (body) => api.post('/transaction/db_tax_planning/master_budget/get_report_hierarki', body) const getReportTPMB = (body) => api.post('/transaction/db_tax_planning/master_budget/get_report_hierarki', body)
const getReportTPMR = (body) => api.post('/transaction/db_tax_planning/monthly_report/get_report_hierarki', body) const getReportTPMR = (body) => api.post('/transaction/db_tax_planning/monthly_report/get_report_hierarki', body)
const getReportTP = (body) => api.post('/transaction/db_tax_planning/get_report_hierarki', body)
const getAllReportOI = (body) => api.post('/transaction/db_operating_indicator/get_report_hierarki', body) const getAllReportOI = (body) => api.post('/transaction/db_operating_indicator/get_report_hierarki', body)
const getReportOIMB = (body) => api.post('/transaction/db_operating_indicator/master_budget/get_report_hierarki', body) const getReportOIMB = (body) => api.post('/transaction/db_operating_indicator/master_budget/get_report_hierarki', body)
const getReportOIMR = (body) => api.post('/transaction/db_operating_indicator/monthly_report/get_report_hierarki', body) const getReportOIMR = (body) => api.post('/transaction/db_operating_indicator/monthly_report/get_report_hierarki', body)
...@@ -606,6 +607,7 @@ const create = (type = "") => { ...@@ -606,6 +607,7 @@ const create = (type = "") => {
getReportPLMR, getReportPLMR,
getReportTPMB, getReportTPMB,
getReportTPMR, getReportTPMR,
getReportTP,
getReportOIMB, getReportOIMB,
getReportOIMR, getReportOIMR,
getReportCFSumaMB, getReportCFSumaMB,
......
...@@ -836,39 +836,55 @@ export default class SubHolding extends Component { ...@@ -836,39 +836,55 @@ export default class SubHolding extends Component {
} }
}) })
} else if (this.state.report.value === 5) { } else if (this.state.report.value === 5) {
api.create().getReportTPMB(payload).then(response => { api.create().getReportTP(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) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
let res = response.data.data let res = response.data.data
console.log(res)
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.type_report_tax.value_tbc.type_report_id, // item.type_report_tax.value_tbc.type_report_id,
item.type_report_tax.value_fc.type_report_id, // item.type_report_tax.value_fc.type_report_id,
item.type_report_tax.value_tbf.type_report_id, // item.type_report_tax.value_tbf.type_report_id,
0,
0,
0,
item.id, item.id,
item.parent, item.parent,
{ tbc: item.formula_tax.value_tbc, fcp: item.formula_tax.value_fc, tbf: item.formula_tax.value_tbf }, { tbc: item.formula_tax.value_tbc, fcp: item.formula_tax.value_fc, tbf: item.formula_tax.value_tbf },
item.level, item.level,
item.description, item.description,
item.tax_planning.january.tbf, item.tax_planning_report.january,
item.tax_planning.february.tbf, item.tax_planning_report.february,
item.tax_planning.march.tbf, item.tax_planning_report.march,
item.tax_planning.april.tbf, item.tax_planning_report.april,
item.tax_planning.may.tbf, item.tax_planning_report.may,
item.tax_planning.june.tbf, item.tax_planning_report.june,
item.tax_planning.july.tbf, item.tax_planning_report.july,
item.tax_planning.august.tbf, item.tax_planning_report.august,
item.tax_planning.september.tbf, item.tax_planning_report.september,
item.tax_planning.october.tbf, item.tax_planning_report.october,
item.tax_planning.november.tbf, item.tax_planning_report.november,
item.tax_planning.december.tbf, item.tax_planning_report.december,
item.order, item.order,
item.tax_planning_report.monthly_january,
item.tax_planning_report.monthly_february,
item.tax_planning_report.monthly_march,
item.tax_planning_report.monthly_april,
item.tax_planning_report.monthly_may,
item.tax_planning_report.monthly_june,
item.tax_planning_report.monthly_july,
item.tax_planning_report.monthly_august,
item.tax_planning_report.monthly_september,
item.tax_planning_report.monthly_october,
item.tax_planning_report.monthly_november,
item.tax_planning_report.monthly_december,
]) ])
} }
if (item.children !== null) { if (item.children !== null) {
...@@ -882,27 +898,42 @@ export default class SubHolding extends Component { ...@@ -882,27 +898,42 @@ export default class SubHolding extends Component {
res.map((item, index) => { res.map((item, index) => {
dataTable.push([ dataTable.push([
item.type_report_id, item.type_report_id,
item.type_report_tax.value_tbc.type_report_id, // item.type_report_tax.value_tbc.type_report_id,
item.type_report_tax.value_fc.type_report_id, // item.type_report_tax.value_fc.type_report_id,
item.type_report_tax.value_tbf.type_report_id, // item.type_report_tax.value_tbf.type_report_id,
0,
0,
0,
item.id, item.id,
item.parent, item.parent,
{ tbc: item.formula_tax.value_tbc, fcp: item.formula_tax.value_fc, tbf: item.formula_tax.value_tbf }, { tbc: item.formula_tax.value_tbc, fcp: item.formula_tax.value_fc, tbf: item.formula_tax.value_tbf },
item.level, item.level,
item.description, item.description,
item.tax_planning.january.tbf, item.tax_planning_report.january,
item.tax_planning.february.tbf, item.tax_planning_report.february,
item.tax_planning.march.tbf, item.tax_planning_report.march,
item.tax_planning.april.tbf, item.tax_planning_report.april,
item.tax_planning.may.tbf, item.tax_planning_report.may,
item.tax_planning.june.tbf, item.tax_planning_report.june,
item.tax_planning.july.tbf, item.tax_planning_report.july,
item.tax_planning.august.tbf, item.tax_planning_report.august,
item.tax_planning.september.tbf, item.tax_planning_report.september,
item.tax_planning.october.tbf, item.tax_planning_report.october,
item.tax_planning.november.tbf, item.tax_planning_report.november,
item.tax_planning.december.tbf, item.tax_planning_report.december,
item.order, item.order,
item.tax_planning_report.monthly_january,
item.tax_planning_report.monthly_february,
item.tax_planning_report.monthly_march,
item.tax_planning_report.monthly_april,
item.tax_planning_report.monthly_may,
item.tax_planning_report.monthly_june,
item.tax_planning_report.monthly_july,
item.tax_planning_report.monthly_august,
item.tax_planning_report.monthly_september,
item.tax_planning_report.monthly_october,
item.tax_planning_report.monthly_november,
item.tax_planning_report.monthly_december,
]) ])
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
...@@ -913,10 +944,10 @@ export default class SubHolding extends Component { ...@@ -913,10 +944,10 @@ export default class SubHolding extends Component {
} }
}) })
console.log(dataTable) console.log(dataTable)
// this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true }) this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
this.setState({ dataTable }, () => { // this.setState({ dataTable }, () => {
this.getTaxPlanMR(payload) // 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 }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
...@@ -1804,7 +1835,6 @@ export default class SubHolding extends Component { ...@@ -1804,7 +1835,6 @@ export default class SubHolding extends Component {
let res = response.data.data let res = response.data.data
res.map((item, index) => { res.map((item, index) => {
let indexID = dataTable.findIndex((val) => val[4] == item.id) let indexID = dataTable.findIndex((val) => val[4] == item.id)
console.log(indexID)
if (indexID != -1) { if (indexID != -1) {
const handlePushChild = (items) => { const handlePushChild = (items) => {
let indexIDzz = dataTable.findIndex((val) => val[4] === items.id) let indexIDzz = dataTable.findIndex((val) => val[4] === items.id)
......
...@@ -9442,7 +9442,8 @@ export default class TableSubHolding extends Component { ...@@ -9442,7 +9442,8 @@ export default class TableSubHolding extends Component {
options: { options: {
display: false display: false
} }
}, { },
{
name: "", name: "",
options: { options: {
display: false display: false
...@@ -9457,7 +9458,8 @@ export default class TableSubHolding extends Component { ...@@ -9457,7 +9458,8 @@ export default class TableSubHolding extends Component {
options: { options: {
display: false display: false
} }
}, { },
{
name: "", name: "",
options: { options: {
display: false display: false
...@@ -9567,9 +9569,9 @@ export default class TableSubHolding extends Component { ...@@ -9567,9 +9569,9 @@ export default class TableSubHolding extends Component {
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
<div className="grid grid-4x content-center"> <div className="grid grid-4x content-center">
<div className="col-1"> <div className="col-1">
{tableMeta.rowData[3] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[3] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -9591,9 +9593,9 @@ export default class TableSubHolding extends Component { ...@@ -9591,9 +9593,9 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-2"> <div className="col-2">
{tableMeta.rowData[3] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[3] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -9614,9 +9616,9 @@ export default class TableSubHolding extends Component { ...@@ -9614,9 +9616,9 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-3"> <div className="col-3">
{tableMeta.rowData[3] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[3] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -9637,9 +9639,9 @@ export default class TableSubHolding extends Component { ...@@ -9637,9 +9639,9 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-4"> <div className="col-4">
{tableMeta.rowData[3] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[3] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -9662,9 +9664,9 @@ export default class TableSubHolding extends Component { ...@@ -9662,9 +9664,9 @@ export default class TableSubHolding extends Component {
</div> </div>
<div className="grid grid-4x content-center"> <div className="grid grid-4x content-center">
<div className="col-1"> <div className="col-1">
{tableMeta.rowData[3] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[3] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -9685,9 +9687,9 @@ export default class TableSubHolding extends Component { ...@@ -9685,9 +9687,9 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-2"> <div className="col-2">
{tableMeta.rowData[3] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[3] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -9708,9 +9710,9 @@ export default class TableSubHolding extends Component { ...@@ -9708,9 +9710,9 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-3"> <div className="col-3">
{tableMeta.rowData[3] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[3] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -9731,9 +9733,9 @@ export default class TableSubHolding extends Component { ...@@ -9731,9 +9733,9 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-4"> <div className="col-4">
{tableMeta.rowData[3] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[3] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -9756,9 +9758,9 @@ export default class TableSubHolding extends Component { ...@@ -9756,9 +9758,9 @@ export default class TableSubHolding extends Component {
</div> </div>
<div className="grid grid-4x content-center"> <div className="grid grid-4x content-center">
<div className="col-1"> <div className="col-1">
{tableMeta.rowData[3] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[3] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -9779,9 +9781,9 @@ export default class TableSubHolding extends Component { ...@@ -9779,9 +9781,9 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-2"> <div className="col-2">
{tableMeta.rowData[3] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[3] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -9802,9 +9804,9 @@ export default class TableSubHolding extends Component { ...@@ -9802,9 +9804,9 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-3"> <div className="col-3">
{tableMeta.rowData[3] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[3] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -9825,9 +9827,9 @@ export default class TableSubHolding extends Component { ...@@ -9825,9 +9827,9 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-4"> <div className="col-4">
{tableMeta.rowData[3] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: tableMeta.rowData[3] === 1 ? : tableMeta.rowData[3] === 1 || tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date" ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
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