Commit 5027733c authored by d.arizona's avatar d.arizona

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

parents 70c7ed28 fe409346
......@@ -75,7 +75,18 @@ export default class SubHolding extends Component {
this.setState({ userCompany: response.data.data.company }, () => {
this.getCompanyActive()
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error'})
}
}
})
......@@ -1084,7 +1095,77 @@ export default class SubHolding extends Component {
item.profit_loss.monthly_last_year_october,
item.profit_loss.monthly_last_year_november,
item.profit_loss.monthly_last_year_december,
item.profit_loss.notes
item.profit_loss.notes,
item.profit_loss.ro_full_year_january,
item.profit_loss.ro_full_year_february,
item.profit_loss.ro_full_year_march,
item.profit_loss.ro_full_year_april,
item.profit_loss.ro_full_year_may,
item.profit_loss.ro_full_year_june,
item.profit_loss.ro_full_year_july,
item.profit_loss.ro_full_year_august,
item.profit_loss.ro_full_year_september,
item.profit_loss.ro_full_year_october,
item.profit_loss.ro_full_year_november,
item.profit_loss.ro_full_year_december,
item.profit_loss.ol_q1_january,
item.profit_loss.ol_q1_february,
item.profit_loss.ol_q1_march,
item.profit_loss.ol_q1_april,
item.profit_loss.ol_q1_may,
item.profit_loss.ol_q1_june,
item.profit_loss.ol_q1_july,
item.profit_loss.ol_q1_august,
item.profit_loss.ol_q1_september,
item.profit_loss.ol_q1_october,
item.profit_loss.ol_q1_november,
item.profit_loss.ol_q1_december,
item.profit_loss.ol_q2_january,
item.profit_loss.ol_q2_february,
item.profit_loss.ol_q2_march,
item.profit_loss.ol_q2_april,
item.profit_loss.ol_q2_may,
item.profit_loss.ol_q2_june,
item.profit_loss.ol_q2_july,
item.profit_loss.ol_q2_august,
item.profit_loss.ol_q2_september,
item.profit_loss.ol_q2_october,
item.profit_loss.ol_q2_november,
item.profit_loss.ol_q2_december,
item.profit_loss.ol_q3_january,
item.profit_loss.ol_q3_february,
item.profit_loss.ol_q3_march,
item.profit_loss.ol_q3_april,
item.profit_loss.ol_q3_may,
item.profit_loss.ol_q3_june,
item.profit_loss.ol_q3_july,
item.profit_loss.ol_q3_august,
item.profit_loss.ol_q3_september,
item.profit_loss.ol_q3_october,
item.profit_loss.ol_q3_november,
item.profit_loss.ol_q3_december,
item.profit_loss.ol_pa_january,
item.profit_loss.ol_pa_february,
item.profit_loss.ol_pa_march,
item.profit_loss.ol_pa_april,
item.profit_loss.ol_pa_may,
item.profit_loss.ol_pa_june,
item.profit_loss.ol_pa_july,
item.profit_loss.ol_pa_august,
item.profit_loss.ol_pa_september,
item.profit_loss.ol_pa_october,
item.profit_loss.ol_pa_november,
item.profit_loss.ol_pa_december,
item.profit_loss.history_current_year,
item.profit_loss.history_last_year,
item.profit_loss.history_last_two_year,
item.profit_loss.history_last_three_year,
item.profit_loss.history_last_four_year,
item.profit_loss.history_last_five_year,
item.profit_loss.history_last_six_year,
item.profit_loss.history_last_seven_year,
item.profit_loss.history_last_eight_year,
item.profit_loss.history_last_nine_year
])
if (item.children !== null) {
......@@ -1148,7 +1229,77 @@ export default class SubHolding extends Component {
item.profit_loss.monthly_last_year_october,
item.profit_loss.monthly_last_year_november,
item.profit_loss.monthly_last_year_december,
item.profit_loss.notes
item.profit_loss.notes,
item.profit_loss.ro_full_year_january,
item.profit_loss.ro_full_year_february,
item.profit_loss.ro_full_year_march,
item.profit_loss.ro_full_year_april,
item.profit_loss.ro_full_year_may,
item.profit_loss.ro_full_year_june,
item.profit_loss.ro_full_year_july,
item.profit_loss.ro_full_year_august,
item.profit_loss.ro_full_year_september,
item.profit_loss.ro_full_year_october,
item.profit_loss.ro_full_year_november,
item.profit_loss.ro_full_year_december,
item.profit_loss.ol_q1_january,
item.profit_loss.ol_q1_february,
item.profit_loss.ol_q1_march,
item.profit_loss.ol_q1_april,
item.profit_loss.ol_q1_may,
item.profit_loss.ol_q1_june,
item.profit_loss.ol_q1_july,
item.profit_loss.ol_q1_august,
item.profit_loss.ol_q1_september,
item.profit_loss.ol_q1_october,
item.profit_loss.ol_q1_november,
item.profit_loss.ol_q1_december,
item.profit_loss.ol_q2_january,
item.profit_loss.ol_q2_february,
item.profit_loss.ol_q2_march,
item.profit_loss.ol_q2_april,
item.profit_loss.ol_q2_may,
item.profit_loss.ol_q2_june,
item.profit_loss.ol_q2_july,
item.profit_loss.ol_q2_august,
item.profit_loss.ol_q2_september,
item.profit_loss.ol_q2_october,
item.profit_loss.ol_q2_november,
item.profit_loss.ol_q2_december,
item.profit_loss.ol_q3_january,
item.profit_loss.ol_q3_february,
item.profit_loss.ol_q3_march,
item.profit_loss.ol_q3_april,
item.profit_loss.ol_q3_may,
item.profit_loss.ol_q3_june,
item.profit_loss.ol_q3_july,
item.profit_loss.ol_q3_august,
item.profit_loss.ol_q3_september,
item.profit_loss.ol_q3_october,
item.profit_loss.ol_q3_november,
item.profit_loss.ol_q3_december,
item.profit_loss.ol_pa_january,
item.profit_loss.ol_pa_february,
item.profit_loss.ol_pa_march,
item.profit_loss.ol_pa_april,
item.profit_loss.ol_pa_may,
item.profit_loss.ol_pa_june,
item.profit_loss.ol_pa_july,
item.profit_loss.ol_pa_august,
item.profit_loss.ol_pa_september,
item.profit_loss.ol_pa_october,
item.profit_loss.ol_pa_november,
item.profit_loss.ol_pa_december,
item.profit_loss.history_current_year,
item.profit_loss.history_last_year,
item.profit_loss.history_last_two_year,
item.profit_loss.history_last_three_year,
item.profit_loss.history_last_four_year,
item.profit_loss.history_last_five_year,
item.profit_loss.history_last_six_year,
item.profit_loss.history_last_seven_year,
item.profit_loss.history_last_eight_year,
item.profit_loss.history_last_nine_year
])
if (item.children !== null) {
if (item.children.length > 0) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -851,8 +851,14 @@ export default class ProfitLossMR extends Component {
}
})
dataTable2[tableMeta.rowIndex][11] = Number(total).toFixed(1)
return total
if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "sales price") {
let value = Number(dataTable2[tableMeta.rowIndex - 2][11]) / Number(dataTable2[tableMeta.rowIndex - 1][11])
dataTable2[tableMeta.rowIndex][11] = R.equals(value, NaN) ? "0.0" : (R.equals(value, Infinity) ? "0.0" : (value == "-Infinity" ? "0.0" : value))
return R.equals(value, NaN) ? "0.0" : (R.equals(value, Infinity) ? "0.0" : (value == "-Infinity" ? "0.0" : value))
} else {
dataTable2[tableMeta.rowIndex][11] = Number(total).toFixed(1)
return total
}
}
let columns = [
......
......@@ -206,8 +206,8 @@ export default class TaxPlanningOLPA extends Component {
fcp: item.tax_planning.august.fcp, tbf: item.tax_planning.august.tbf},
{tbc : item.tax_planning.september.tbc, fcp: item.tax_planning.september.fcp, tbf: item.tax_planning.september.tbf},
{tbc : item.tax_planning.october.tbc, fcp: item.tax_planning.october.fcp, tbf: item.tax_planning.october.tbf},
{tbc : item.tax_planning.november.tbc, fcp: item.tax_planning.november.fcp, tbf: item.tax_planning.november.tbf},
{tbc : item.tax_planning.december.tbc, fcp: item.tax_planning.december.fcp, tbf: item.tax_planning.december.tbf},
{ tbc: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.tbc).toFixed(1) : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.november.tbc, formula: item.tax_planning.november_formula } : item.tax_planning.november.tbc, fcp: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.fcp).toFixed(1) : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.november.fcp, formula: item.tax_planning.november_formula } : item.tax_planning.november.fcp, tbf: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.tbf).toFixed(1) : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.november.tbf, formula: item.tax_planning.november_formula } : item.tax_planning.november.tbf },
{ tbc: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.tbc).toFixed(1) : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.december.tbc, formula: item.tax_planning.december_formula } : item.tax_planning.december.tbc, fcp: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.fcp).toFixed(1) : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.december.fcp, formula: item.tax_planning.december_formula } : item.tax_planning.december.fcp, tbf: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.tbf).toFixed(1) : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.december.tbf, formula: item.tax_planning.december_formula } : item.tax_planning.december.tbf },
item.tax_planning.total_current_year,
0,
0,
......@@ -247,8 +247,8 @@ export default class TaxPlanningOLPA extends Component {
fcp: item.tax_planning.august.fcp, tbf: item.tax_planning.august.tbf},
{tbc : item.tax_planning.september.tbc, fcp: item.tax_planning.september.fcp, tbf: item.tax_planning.september.tbf},
{tbc : item.tax_planning.october.tbc, fcp: item.tax_planning.october.fcp, tbf: item.tax_planning.october.tbf},
{tbc : item.tax_planning.november.tbc, fcp: item.tax_planning.november.fcp, tbf: item.tax_planning.november.tbf},
{tbc : item.tax_planning.december.tbc, fcp: item.tax_planning.december.fcp, tbf: item.tax_planning.december.tbf},
{ tbc: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.tbc).toFixed(1) : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.november.tbc, formula: item.tax_planning.november_formula } : item.tax_planning.november.tbc, fcp: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.fcp).toFixed(1) : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.november.fcp, formula: item.tax_planning.november_formula } : item.tax_planning.november.fcp, tbf: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.tbf).toFixed(1) : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.november.tbf, formula: item.tax_planning.november_formula } : item.tax_planning.november.tbf },
{ tbc: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.tbc).toFixed(1) : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.december.tbc, formula: item.tax_planning.december_formula } : item.tax_planning.december.tbc, fcp: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.fcp).toFixed(1) : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.december.fcp, formula: item.tax_planning.december_formula } : item.tax_planning.december.fcp, tbf: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.tbf).toFixed(1) : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.december.tbf, formula: item.tax_planning.december_formula } : item.tax_planning.december.tbf },
item.tax_planning.total_current_year,
0,
0,
......@@ -370,14 +370,14 @@ export default class TaxPlanningOLPA extends Component {
tbf: String(Number(i[18].tbf).toFixed(1))
},
november: {
tbc: String(Number(i[19].tbc).toFixed(1)),
fcp: String(Number(i[19].fcp).toFixed(1)),
tbf: String(Number(i[19].tbf).toFixed(1))
tbc: i[1] === 3 && i[19].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[19].tbc.value) : String(i[19].tbc),
fcp: i[2] === 3 && i[19].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[19].fcp.value) : String(i[19].fcp),
tbf: i[3] === 3 && i[19].tbf === "" ? "0" : String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(i[19].tbf) : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[19].tbf.value) : String(i[19].tbf)
},
december: {
tbc: String(Number(i[20].tbc).toFixed(1)),
fcp: String(Number(i[20].fcp).toFixed(1)),
tbf: String(Number(i[20].tbf).toFixed(1))
tbc: i[1] === 3 && i[20].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[20].tbc.value) : String(i[20].tbc),
fcp: i[2] === 3 && i[20].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[20].fcp.value) : String(i[20].fcp),
tbf: i[3] === 3 && i[20].tbf === "" ? "0" : String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(i[20].tbf) : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[20].tbf.value) : String(i[20].tbf)
},
total_current_year: String(Number(i[21]).toFixed(1)),
})
......@@ -504,7 +504,7 @@ export default class TaxPlanningOLPA extends Component {
checkUpload() {
api.create().checkUploadOLPA(this.state.payload).then(response => {
// console.log(JSON.stringify(this.state.payload));
// console.log(response)
console.log(response)
if (response.data) {
if (response.data.status === 'success') {
this.setState({ visibleUpload: false, visibleTP: false, loading: true })
......@@ -759,26 +759,26 @@ export default class TaxPlanningOLPA extends Component {
tbf: i[3] === 3 && i[18].tbf === "" ? "0" : String(i[18].tbf)
},
november: {
tbc: i[1] === 3 && i[19].tbc === "" ? "0" : String(i[19].tbc),
fcp: i[2] === 3 && i[19].fcp === "" ? "0" : String(i[19].fcp),
tbf: i[3] === 3 && i[19].tbf === "" ? "0" : String(i[19].tbf)
tbc: i[1] === 3 && i[19].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[19].tbc.value) : String(i[19].tbc),
fcp: i[2] === 3 && i[19].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[19].fcp.value) : String(i[19].fcp),
tbf: i[3] === 3 && i[19].tbf === "" ? "0" : String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(i[19].tbf) : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[19].tbf.value) : String(i[19].tbf)
},
december: {
tbc: i[1] === 3 && i[20].tbc === "" ? "0" : String(i[20].tbc),
fcp: i[2] === 3 && i[20].fcp === "" ? "0" : String(i[20].fcp),
tbf: i[3] === 3 && i[20].tbf === "" ? "0" : String(i[20].tbf)
tbc: i[1] === 3 && i[20].tbc === "" ? "0" : i[1] === 5 || i[1] === 6 || i[1] === 7 ? String(i[20].tbc.value) : String(i[20].tbc),
fcp: i[2] === 3 && i[20].fcp === "" ? "0" : i[2] === 5 || i[2] === 6 || i[2] === 7 ? String(i[20].fcp.value) : String(i[20].fcp),
tbf: i[3] === 3 && i[20].tbf === "" ? "0" : String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(i[20].tbf) : i[3] === 5 || i[3] === 6 || i[3] === 7 ? String(i[20].tbf.value) : String(i[20].tbf)
},
total_current_year: i[2] === 3 && i[21] === "" ? "0" : String(i[21]),
total_next_year: {
tbc: i[1] === 3 && i[22].tbc === "" ? "0" : String(i[22].tbc),
fcp: i[2] === 3 && i[22].fcp === "" ? "0" : String(i[22].fcp),
tbf: i[3] === 3 && i[22].tbf === "" ? "0" : String(i[22].tbf)
},
total_more_year: {
tbc: i[1] === 3 && i[23].tbc === "" ? "0" : String(i[23].tbc),
fcp: i[2] === 3 && i[23].fcp === "" ? "0" : String(i[23].fcp),
tbf: i[3] === 3 && i[23].tbf === "" ? "0" : String(i[23].tbf)
}
// total_next_year: {
// tbc: i[1] === 3 && i[22].tbc === "" ? "0" : String(i[22].tbc),
// fcp: i[2] === 3 && i[22].fcp === "" ? "0" : String(i[22].fcp),
// tbf: i[3] === 3 && i[22].tbf === "" ? "0" : String(i[22].tbf)
// },
// total_more_year: {
// tbc: i[1] === 3 && i[23].tbc === "" ? "0" : String(i[23].tbc),
// fcp: i[2] === 3 && i[23].fcp === "" ? "0" : String(i[23].fcp),
// tbf: i[3] === 3 && i[23].tbf === "" ? "0" : String(i[23].tbf)
// }
})
......@@ -795,37 +795,39 @@ export default class TaxPlanningOLPA extends Component {
}
})
// console.log(JSON.stringify(data))
let payload = {
"outlook_pa_id": this.props.outlook_pa_id,
"company_id": this.props.company.company_id,
"periode": this.props.periode,
"report_id": this.props.report_id,
"tax_planning": data,
"status": "submitted"
}
api.create().validateSubmitReportOLPA(payload).then((response) => {
console.log(response)
if (response.data) {
if (response.data.status === "success") {
if (response.data.data.result && errorContrl === false && editAble === false ) {
// let payload = {
// "outlook_pa_id": this.props.outlook_pa_id,
// "company_id": this.props.company.company_id,
// "periode": this.props.periode,
// "report_id": this.props.report_id,
// "tax_planning": data,
// "status": "submitted"
// }
// api.create().validateSubmitReportOLPA(payload).then((response) => {
// console.log(payload)
// console.log(response)
// if (response.data) {
// if (response.data.status === "success") {
// if (response.data.data.result && errorContrl === false && editAble === false ) {
if (errorContrl === false && editAble === false ) {
this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false })
} else {
this.setState({ loading: false, buttonError: true, editable: true, saveDraft: false })
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
}
})
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
// if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
// setTimeout(() => {
// localStorage.removeItem(Constant.TOKEN)
// window.location.reload();
// }, 1000);
// }
// })
// }
// } else {
// this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
// }
// })
}
downloadTemplate = async () => {
......@@ -870,11 +872,11 @@ export default class TaxPlanningOLPA extends Component {
let dataFormula = []
let id = 0
let double = false
const handleValueFormula = (value, tableMeta, dex, xntd, forecast, periode) => {
// console.log(xntd)
let form = dex === 1 ? tableMeta.rowData[6].tbc : dex === 2 ? tableMeta.rowData[6].fcp : tableMeta.rowData[6].tbf
let splitFormula = String(form).split('@')
// console.log(form)
// console.log(splitFormula)
let baru = []
let anjay = []
splitFormula.map((item, index) => {
......@@ -882,20 +884,24 @@ export default class TaxPlanningOLPA extends Component {
let re = /^[a-zA-Z0-9_]+$/;
let asd = ''
if (item !== "") {
// console.log(item)
// console.log(items)
// re.test(items) ngecek angka
if (!re.test(items)) {
baru.push(String(item).substr(0, Number(String(item).length) - 1))
baru.push(String(item).substr(Number(String(item).length) - 1, 1))
} else {
baru.push(String(item))
}
// console.log(baru)
}
})
// console.log(baru);
// if (forecast !== undefined) {
// console.log(splitFormula)
// }
if (tableMeta.rowData[8] == "Under payment /(Over Payment ) Income Tax Art. 29" || forecast !== undefined) {
// form.replace("(", "")
// form.replace(")", "")
let opgab = []
baru.map((item, index) => {
if (item.length > 1 && (item.includes("+") || item.includes("-") || item.includes("*") || item.includes("/"))) {
......@@ -915,14 +921,17 @@ export default class TaxPlanningOLPA extends Component {
if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') {
anjay.push(item)
} else {
// console.log(item)
if (String(item).includes('#')) {
let splitform = String(item).split('#')
if (splitform[1] == 'TP1' || splitform[1] == 'TP2' || splitform[1] == 'TP3') {
// console.log(dataTable2)
let indexID = dataTable2.findIndex((val) => val[24] == splitform[0])
if (indexID !== -1) {
// console.log(splitform)
let data = splitform[1] == 'TP1' ? dataTable2[indexID][tableMeta.columnIndex].tbc : splitform[1] == 'TP2' ? dataTable2[indexID][tableMeta.columnIndex].fcp : dataTable2[indexID][tableMeta.columnIndex].tbf
// console.log(data)
// if(value == null){
// console.log(tableMeta);
// }
let valuezz = data.value == undefined ? data : data.value
anjay.push(valuezz == "" ? 0 : valuezz)
}
......@@ -944,17 +953,19 @@ export default class TaxPlanningOLPA extends Component {
let valuezz = tableMeta.rowData[data].formula[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz)
}
}
// else {
// let data = dex == 1 ? value.tbc : dex == 2 ? value.fcp : value.tbf
// // let data = dex == 1 ? tableMeta.rowData[data].tbc : dex == 2 ? tableMeta.rowData[data].fcp : tableMeta.rowData[data].tbf
// console.log(data);
// let indexID = data.formula.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode))
// if (indexID !== -1) {
// let valuezz = data.formula[indexID].value
// anjay.push(valuezz == "" ? 0 : valuezz)
// }
// }
} else {
// console.log(value);
// if(value == null){
// console.log(tableMeta);
// }
let data = dex == 1 ? value.tbc : dex == 2 ? value.fcp : value.tbf
// console.log(data);
let indexID = data.formula.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode))
if (indexID !== -1) {
let valuezz = data.formula[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz)
}
}
}
} else {
let indexID = dataTable2.findIndex((val) => val[24] == item)
......@@ -962,7 +973,7 @@ export default class TaxPlanningOLPA extends Component {
if (dataTable2[indexID][24] == tableMeta.rowData[24]) {
anjay.push(0)
} else {
let data = dex == 1 ? dataTable2[indexID][tableMeta.columnIndex].tbc : dex == 2 ? dataTable2[indexID][tableMeta.columnIndex].fcp : dex == 3 ? dataTable2[indexID][tableMeta.columnIndex].tbf : dataTable2[indexID][tableMeta.columnIndex]
let data = dex == 1 ? dataTable2[indexID][tableMeta.columnIndex].tbc : dex == 2 ? dataTable2[indexID][tableMeta.columnIndex].fcp : dataTable2[indexID][tableMeta.columnIndex].tbf
let valuezz = data.value == undefined ? data : data.value
anjay.push(valuezz == "" ? 0 : valuezz)
}
......@@ -1076,15 +1087,28 @@ export default class TaxPlanningOLPA extends Component {
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp.value = Number(total).toFixed(1)
}
} else {
if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value == undefined) {
} else if (dex == 3) {
if (tableMeta.rowData[8] == "Corporate Income Tax") {
if (total < 0) {
total = 0
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = Number(total).toFixed(2)
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = Number(total).toFixed(2)
}
} else if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value == undefined) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = Number(total).toFixed(1)
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value = Number(total).toFixed(1)
}
} else {
if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].value == undefined) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total).toFixed(1)
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].value = Number(total).toFixed(1)
}
}
return Number(total).toFixed(1)
return tableMeta.rowData[8] == "Corporate Income Tax" ? Number(total).toFixed(2) : Number(total).toFixed(1)
}
const handleChange = (value, tableMeta, indexChilds) => {
......@@ -1110,8 +1134,8 @@ export default class TaxPlanningOLPA extends Component {
}
}
}
const handleTotal = (tableMeta, dex) => {
// console.log(tableMeta)
const handleTotal = (tableMeta, dex, periode) => {
let total = 0
let totalfcp = 0
if (String(tableMeta.rowData[8]).toLowerCase() === "fiscal correction positive / (negative) year to date") {
......@@ -1129,17 +1153,21 @@ export default class TaxPlanningOLPA extends Component {
} else {
dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index >= 9 && index <= 20) {
// if (tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7) {
// let valItem = item.tbf.value == undefined || item.tbf.value == "" || item.tbf.value == "undefined" ? 0.0 : item.tbf.value
// total += Number(valItem)
// } else {
if (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX") {
let valItem = item.tbf == undefined || item.tbf == "" || item.tbf == "undefined" ? 0.0 : item.tbf
total += Number(valItem)
// }
}
else if (tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7) {
let valItem = item.tbf.value == undefined || item.tbf.value == "" || item.tbf.value == "undefined" ? 0.0 : item.tbf.value
total += Number(valItem)
} else {
let valItem = item.tbf == undefined || item.tbf == "" || item.tbf == "undefined" ? 0.0 : item.tbf
total += Number(valItem)
}
}
})
}
dataTable2[tableMeta.rowIndex][21] = Number(total)
dataTable2[tableMeta.rowIndex][21] = String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(total).toFixed(2) : Number(total).toFixed(1)
return total
}
......@@ -1971,22 +1999,40 @@ export default class TaxPlanningOLPA extends Component {
null
:
this.state.get_for == 'view'?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbc}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbc).toFixed(2) : Number(value.tbc).toFixed(1)}
/>
}
/>
</div>
tableMeta.rowData[1] === 5 || tableMeta.rowData[1] === 6 || tableMeta.rowData[1] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbc}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbc.value).toFixed(2) : Number(value.tbc.value).toFixed(1)}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbc}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbc).toFixed(2) : Number(value.tbc).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[1] === 3 ?
<div style={{ flex: 1 }}>
......@@ -2090,22 +2136,40 @@ export default class TaxPlanningOLPA extends Component {
null
:
this.state.get_for == 'view'?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.fcp}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(2) : Number(value.fcp).toFixed(1)}
/>
}
/>
</div>
tableMeta.rowData[2] === 5 || tableMeta.rowData[2] === 6 || tableMeta.rowData[2] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.fcp}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp.value).toFixed(2) : Number(value.fcp.value).toFixed(1)}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.fcp}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(2) : Number(value.fcp).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[2] === 3 ?
<div style={{ flex: 1 }}>
......@@ -2119,7 +2183,7 @@ export default class TaxPlanningOLPA extends Component {
type="text"
placeholder="input"
// disabled={this.props.isApprover == true ? true : false}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(1) : Number(value.fcp).toFixed(1)}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(2) : Number(value.fcp).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 1)
// console.log(dataTable2)
......@@ -2207,7 +2271,25 @@ export default class TaxPlanningOLPA extends Component {
null
:
this.state.get_for == 'view'?
<div style={{ flex: 1 }}>
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbf}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf.value).toFixed(2) : Number(value.tbf.value).toFixed(1)}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbf}
......@@ -2265,7 +2347,7 @@ export default class TaxPlanningOLPA extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleValueFormula(value, tableMeta, 3)).toFixed(2) : Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/>
:
tableMeta.rowData[3] === 5 ?
......@@ -2275,7 +2357,7 @@ export default class TaxPlanningOLPA extends Component {
type="text"
placeholder=""
disabled={false}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleValueFormula(value, tableMeta, 3)).toFixed(2) : Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/>
:
tableMeta.rowData[3] === 7 ?
......@@ -2358,22 +2440,40 @@ export default class TaxPlanningOLPA extends Component {
null
:
this.state.get_for == 'view'?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbc}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbc).toFixed(2) : Number(value.tbc).toFixed(1)}
/>
}
/>
</div>
tableMeta.rowData[1] === 5 || tableMeta.rowData[1] === 6 || tableMeta.rowData[1] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbc}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbc.value).toFixed(2) : Number(value.tbc.value).toFixed(1)}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbc}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbc).toFixed(2) : Number(value.tbc).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[1] === 3 ?
<div style={{ flex: 1 }}>
......@@ -2477,22 +2577,40 @@ export default class TaxPlanningOLPA extends Component {
null
:
this.state.get_for == 'view'?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.fcp}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(2) : Number(value.fcp).toFixed(1)}
/>
}
/>
</div>
tableMeta.rowData[2] === 5 || tableMeta.rowData[2] === 6 || tableMeta.rowData[2] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.fcp}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp.value).toFixed(2) : Number(value.fcp.value).toFixed(1)}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.fcp}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(2) : Number(value.fcp).toFixed(1)}
/>
}
/>
</div>
:
tableMeta.rowData[2] === 3 ?
<div style={{ flex: 1 }}>
......@@ -2506,7 +2624,7 @@ export default class TaxPlanningOLPA extends Component {
type="text"
placeholder="input"
// disabled={this.props.isApprover == true ? true : false}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(1) : Number(value.fcp).toFixed(1)}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(2) : Number(value.fcp).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 1)
// console.log(dataTable2)
......@@ -2594,7 +2712,25 @@ export default class TaxPlanningOLPA extends Component {
null
:
this.state.get_for == 'view'?
<div style={{ flex: 1 }}>
tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbf}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf.value).toFixed(2) : Number(value.tbf.value).toFixed(1)}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbf}
......@@ -2652,7 +2788,7 @@ export default class TaxPlanningOLPA extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleValueFormula(value, tableMeta, 3)).toFixed(2) : Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/>
:
tableMeta.rowData[3] === 5 ?
......@@ -2662,7 +2798,7 @@ export default class TaxPlanningOLPA extends Component {
type="text"
placeholder=""
disabled={false}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleValueFormula(value, tableMeta, 3)).toFixed(2) : Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/>
:
tableMeta.rowData[3] === 7 ?
......@@ -2736,7 +2872,7 @@ export default class TaxPlanningOLPA extends Component {
{tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -2790,7 +2926,7 @@ export default class TaxPlanningOLPA extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleTotal(tableMeta, 6)).toFixed(1)}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleTotal(tableMeta, 6)).toFixed(2) : Number(handleTotal(tableMeta, 6)).toFixed(1)}
/>
:
tableMeta.rowData[3] === 5 ?
......@@ -2800,79 +2936,69 @@ export default class TaxPlanningOLPA extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleTotal(tableMeta, 5)).toFixed(1)}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleTotal(tableMeta, 5)).toFixed(2) : Number(handleTotal(tableMeta, 5)).toFixed(1)}
/>
:
// tableMeta.rowData[3] === 1 ?
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleTotal(tableMeta, 1)).toFixed(1)}
// />
// :
tableMeta.rowData[3] === 7 ?
(Number(handleTotal(tableMeta, 1)) >= Number(this.state.minValue) && Number(handleTotal(tableMeta, 1)) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleTotal(tableMeta, 7)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be 0` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', color: 'red' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleTotal(tableMeta, 7)).toFixed(1)}
/>
</LightTooltip>
:
null
// tableMeta.rowData[3] === 7 ?
// (Number(handleValueFormula(value, tableMeta, 7)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
tableMeta.rowData[3] === 7 ? null
// (Number(handleTotal(tableMeta, 1)) >= Number(this.state.minValue) && Number(handleTotal(tableMeta, 1)) <= Number(this.state.maxValue)) ?
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleTotal(tableMeta, 7)).toFixed(1)}
// /> :
// <LightTooltip title={this.state.minValue === null ? `Value Should be 0` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
// <NumberFormat
// thousandSeparator={true}
// style={{
// fontSize: 12,
// textAlign: 'right',
// borderColor: 'transparent',
// margin: 0,
// width: 96,
// backgroundColor: 'transparent',
// color: 'black'
// }}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', color: 'red' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValueFormula(value, tableMeta, 7)).toFixed(1)}
// /> :
// <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
// <NumberFormat
// thousandSeparator={true}
// style={{
// fontSize: 12,
// textAlign: 'right',
// borderColor: 'transparent',
// margin: 0,
// width: 96,
// backgroundColor: 'transparent',
// color: 'red'
// }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValueFormula(value, tableMeta, 7)).toFixed(1)}
// />
// </LightTooltip>
// :
// null
// value={Number(handleTotal(tableMeta, 7)).toFixed(1)}
// />
// </LightTooltip>
:
null
// tableMeta.rowData[3] === 7 ?
// (Number(handleValueFormula(value, tableMeta, 7)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
// <NumberFormat
// thousandSeparator={true}
// style={{
// fontSize: 12,
// textAlign: 'right',
// borderColor: 'transparent',
// margin: 0,
// width: 96,
// backgroundColor: 'transparent',
// color: 'black'
// }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValueFormula(value, tableMeta, 7)).toFixed(1)}
// /> :
// <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
// <NumberFormat
// thousandSeparator={true}
// style={{
// fontSize: 12,
// textAlign: 'right',
// borderColor: 'transparent',
// margin: 0,
// width: 96,
// backgroundColor: 'transparent',
// color: 'red'
// }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValueFormula(value, tableMeta, 7)).toFixed(1)}
// />
// </LightTooltip>
// :
// null
}
</div>
</div>
......
......@@ -95,7 +95,18 @@ export default class SummaryOfTriputra extends Component {
// this.getRevision()
// }
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
}
})
}
......@@ -129,7 +140,18 @@ export default class SummaryOfTriputra extends Component {
this.getDataTable()
})
console.log(this.state.month)
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
}
})
}
......@@ -211,10 +233,63 @@ export default class SummaryOfTriputra extends Component {
console.log(response);
let dataTable = []
if (response.data) {
let res = [response.data.data]
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[0] === item.company_id)
if (indexIDzz === -1) {
if (response.data.status === 'success') {
let res = [response.data.data]
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[0] === item.company_id)
if (indexIDzz === -1) {
dataTable.push([
// item.company_id,
0,
item.parent,
item.level,
item.item_name,
item.revenue_act,
item.revenue_mb,
item.revenue_percent_of_mb,
item.ebitda_act,
item.ebitda_mb,
item.ebitda_percent_of_mb,
item.tpat_act,
item.tpat_mb,
item.tpat_percent_of_mb,
item.npat_act,
item.npat_mb,
item.npat_percent_of_mb,
item.cash_flow_cfo,
item.cash_flow_cfi,
item.cash_flow_cff,
item.cash_flow_cf,
item.os_bank_loan_ki,
item.os_bank_loan_wc,
item.os_bank_loan_other,
item.os_bank_loan_total,
item.os_shl,
item.balance_sheet_cash_bank,
item.balance_sheet_ca,
item.balance_sheet_cl,
item.balance_sheet_equity,
item.ratio_cr,
item.ratio_der,
item.ratio_debt_to_ebitda,
item.ratio_to_interest,
item.ratio_ar_days,
item.ratio_inv_days,
item.ratio_ap_days,
item.ratio_ccc,
item.is_approved == undefined ? true : item.is_approved,
// 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,
0,
......@@ -257,68 +332,26 @@ export default class SummaryOfTriputra extends Component {
item.is_approved == undefined ? true : item.is_approved,
// item.order,
])
}
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)
})
}
}
}
}
res.map((item, index) => {
dataTable.push([
// item.company_id,
0,
item.parent,
item.level,
item.item_name,
item.revenue_act,
item.revenue_mb,
item.revenue_percent_of_mb,
item.ebitda_act,
item.ebitda_mb,
item.ebitda_percent_of_mb,
item.tpat_act,
item.tpat_mb,
item.tpat_percent_of_mb,
item.npat_act,
item.npat_mb,
item.npat_percent_of_mb,
item.cash_flow_cfo,
item.cash_flow_cfi,
item.cash_flow_cff,
item.cash_flow_cf,
item.os_bank_loan_ki,
item.os_bank_loan_wc,
item.os_bank_loan_other,
item.os_bank_loan_total,
item.os_shl,
item.balance_sheet_cash_bank,
item.balance_sheet_ca,
item.balance_sheet_cl,
item.balance_sheet_equity,
item.ratio_cr,
item.ratio_der,
item.ratio_debt_to_ebitda,
item.ratio_to_interest,
item.ratio_ar_days,
item.ratio_inv_days,
item.ratio_ap_days,
item.ratio_ccc,
item.is_approved == undefined ? true : item.is_approved,
// item.order,
])
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
})
console.log(dataTable)
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
}
})
console.log(dataTable)
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
})
}
} else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
}
......@@ -329,10 +362,69 @@ export default class SummaryOfTriputra extends Component {
console.log(response);
let dataTable = []
if (response.data) {
let res = [response.data.data]
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[0] === item.company_id)
if (indexIDzz === -1) {
if (response.data.status === 'success') {
let res = [response.data.data]
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[0] === item.company_id)
if (indexIDzz === -1) {
dataTable.push([
0,
item.parent,
item.level,
item.item_name,
item.revenue_ytd_act,
item.revenue_ytd_mb,
item.revenue_ytd_percent_of_mb,
item.revenue_ytd_last_year,
item.revenue_ytd_percent_of_last_year,
item.revenue_fy_ol,
item.revenue_fy_mb,
item.revenue_fy_percent_of_mb,
item.revenue_fy_last_year,
item.revenue_fy_percent_of_last_year,
item.ebitda_ytd_act,
item.ebitda_ytd_mb,
item.ebitda_ytd_percent_of_mb,
item.ebitda_ytd_last_year,
item.ebitda_ytd_percent_of_last_year,
item.ebitda_fy_ol,
item.ebitda_fy_mb,
item.ebitda_fy_percent_of_mb,
item.ebitda_fy_last_year,
item.ebitda_fy_percent_of_last_year,
item.tpat_ytd_act,
item.tpat_ytd_mb,
item.tpat_ytd_percent_of_mb,
item.tpat_ytd_last_year,
item.tpat_ytd_percent_of_last_year,
item.tpat_fy_ol,
item.tpat_fy_mb,
item.tpat_fy_percent_of_mb,
item.tpat_fy_last_year,
item.tpat_fy_percent_of_last_year,
item.npat_ytd_act,
item.npat_ytd_mb,
item.npat_ytd_percent_of_mb,
item.npat_ytd_last_year,
item.npat_ytd_percent_of_last_year,
item.npat_fy_ol,
item.npat_fy_mb,
item.npat_fy_percent_of_mb,
item.npat_fy_last_year,
item.npat_fy_percent_of_last_year,
item.order,
item.is_approved == undefined ? true : item.is_approved,
])
}
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
}
}
res.map((item, index) => {
dataTable.push([
0,
item.parent,
......@@ -381,74 +473,26 @@ export default class SummaryOfTriputra extends Component {
item.order,
item.is_approved == undefined ? true : item.is_approved,
])
}
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)
})
}
}
}
}
res.map((item, index) => {
dataTable.push([
0,
item.parent,
item.level,
item.item_name,
item.revenue_ytd_act,
item.revenue_ytd_mb,
item.revenue_ytd_percent_of_mb,
item.revenue_ytd_last_year,
item.revenue_ytd_percent_of_last_year,
item.revenue_fy_ol,
item.revenue_fy_mb,
item.revenue_fy_percent_of_mb,
item.revenue_fy_last_year,
item.revenue_fy_percent_of_last_year,
item.ebitda_ytd_act,
item.ebitda_ytd_mb,
item.ebitda_ytd_percent_of_mb,
item.ebitda_ytd_last_year,
item.ebitda_ytd_percent_of_last_year,
item.ebitda_fy_ol,
item.ebitda_fy_mb,
item.ebitda_fy_percent_of_mb,
item.ebitda_fy_last_year,
item.ebitda_fy_percent_of_last_year,
item.tpat_ytd_act,
item.tpat_ytd_mb,
item.tpat_ytd_percent_of_mb,
item.tpat_ytd_last_year,
item.tpat_ytd_percent_of_last_year,
item.tpat_fy_ol,
item.tpat_fy_mb,
item.tpat_fy_percent_of_mb,
item.tpat_fy_last_year,
item.tpat_fy_percent_of_last_year,
item.npat_ytd_act,
item.npat_ytd_mb,
item.npat_ytd_percent_of_mb,
item.npat_ytd_last_year,
item.npat_ytd_percent_of_last_year,
item.npat_fy_ol,
item.npat_fy_mb,
item.npat_fy_percent_of_mb,
item.npat_fy_last_year,
item.npat_fy_percent_of_last_year,
item.order,
item.is_approved == undefined ? true : item.is_approved,
])
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
})
console.log(dataTable)
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
}
})
console.log(dataTable)
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
})
}
} else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
}
......@@ -459,10 +503,74 @@ export default class SummaryOfTriputra extends Component {
console.log(response);
let dataTable = []
if (response.data) {
let res = [response.data.data]
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[0] === item.company_id)
if (indexIDzz === -1) {
if (response.data.status === 'success') {
let res = [response.data.data]
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[0] === item.company_id)
if (indexIDzz === -1) {
dataTable.push([
0,
item.parent,
item.level,
item.item_name,
item.revenue_last_year,
item.revenue_ol,
item.revenue_mb,
item.revenue_percent_of_mb,
item.revenue_next_year,
item.revenue_next_two_year,
item.ebitda_last_year,
item.ebitda_ol,
item.ebitda_mb,
item.ebitda_percent_of_mb,
item.ebitda_next_year,
item.ebitda_next_two_year,
item.tpat_last_year,
item.tpat_ol,
item.tpat_mb,
item.tpat_percent_of_mb,
item.tpat_next_year,
item.tpat_next_two_year,
item.npat_last_year,
item.npat_ol,
item.npat_mb,
item.npat_percent_of_mb,
item.npat_next_year,
item.npat_next_two_year,
item.roic_ol,
item.roic_next_year,
item.roic_next_two_year,
item.ebitda_margin_ol,
item.ebitda_margin_next_year,
item.ebitda_margin_next_two_year,
item.tpat_margin_ol,
item.tpat_margin_next_year,
item.tpat_margin_next_two_year,
item.percent_revenue_yoy_ol,
item.percent_revenue_yoy_next_year,
item.percent_revenue_yoy_next_two_year,
item.percent_ebitda_yoy_ol,
item.percent_ebitda_yoy_next_year,
item.percent_ebitda_yoy_next_two_year,
item.percent_tpat_yoy_ol,
item.percent_tpat_yoy_next_year,
item.percent_tpat_yoy_next_two_year,
item.percent_npat_yoy_ol,
item.percent_npat_yoy_next_year,
item.percent_npat_yoy_next_two_year,
item.is_approved == undefined ? true : item.is_approved,
// item.order,
])
}
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
}
}
res.map((item, index) => {
dataTable.push([
0,
item.parent,
......@@ -516,79 +624,26 @@ export default class SummaryOfTriputra extends Component {
item.is_approved == undefined ? true : item.is_approved,
// item.order,
])
}
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)
})
}
}
}
}
res.map((item, index) => {
dataTable.push([
0,
item.parent,
item.level,
item.item_name,
item.revenue_last_year,
item.revenue_ol,
item.revenue_mb,
item.revenue_percent_of_mb,
item.revenue_next_year,
item.revenue_next_two_year,
item.ebitda_last_year,
item.ebitda_ol,
item.ebitda_mb,
item.ebitda_percent_of_mb,
item.ebitda_next_year,
item.ebitda_next_two_year,
item.tpat_last_year,
item.tpat_ol,
item.tpat_mb,
item.tpat_percent_of_mb,
item.tpat_next_year,
item.tpat_next_two_year,
item.npat_last_year,
item.npat_ol,
item.npat_mb,
item.npat_percent_of_mb,
item.npat_next_year,
item.npat_next_two_year,
item.roic_ol,
item.roic_next_year,
item.roic_next_two_year,
item.ebitda_margin_ol,
item.ebitda_margin_next_year,
item.ebitda_margin_next_two_year,
item.tpat_margin_ol,
item.tpat_margin_next_year,
item.tpat_margin_next_two_year,
item.percent_revenue_yoy_ol,
item.percent_revenue_yoy_next_year,
item.percent_revenue_yoy_next_two_year,
item.percent_ebitda_yoy_ol,
item.percent_ebitda_yoy_next_year,
item.percent_ebitda_yoy_next_two_year,
item.percent_tpat_yoy_ol,
item.percent_tpat_yoy_next_year,
item.percent_tpat_yoy_next_two_year,
item.percent_npat_yoy_ol,
item.percent_npat_yoy_next_year,
item.percent_npat_yoy_next_two_year,
item.is_approved == undefined ? true : item.is_approved,
// item.order,
])
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
})
console.log(dataTable);
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
}
})
console.log(dataTable);
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
})
}
} else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
}
......@@ -599,11 +654,101 @@ export default class SummaryOfTriputra extends Component {
console.log(response);
let dataTable = []
if (response.data) {
let res = [response.data.data]
console.log(res)
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[0] === item.company_id)
if (indexIDzz === -1) {
if (response.data.status === 'success') {
let res = [response.data.data]
console.log(res)
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[0] === item.company_id)
if (indexIDzz === -1) {
dataTable.push([
0,
item.parent,
item.level,
item.item_name,
item.revenue_last_ten_year,
item.revenue_last_nine_year,
item.revenue_last_eight_year,
item.revenue_last_seven_year,
item.revenue_last_six_year,
item.revenue_last_five_year,
item.revenue_last_four_year,
item.revenue_last_three_year,
item.revenue_last_two_year,
item.revenue_last_year,
// item.revenue,
0,
item.ebitda_last_ten_year,
item.ebitda_last_nine_year,
item.ebitda_last_eight_year,
item.ebitda_last_seven_year,
item.ebitda_last_six_year,
item.ebitda_last_five_year,
item.ebitda_last_four_year,
item.ebitda_last_three_year,
item.ebitda_last_two_year,
item.ebitda_last_year,
// item.ebitda,
0,
item.tpat_last_ten_year,
item.tpat_last_nine_year,
item.tpat_last_eight_year,
item.tpat_last_seven_year,
item.tpat_last_six_year,
item.tpat_last_five_year,
item.tpat_last_four_year,
item.tpat_last_three_year,
item.tpat_last_two_year,
item.tpat_last_year,
// item.tpat,
0,
item.npat_last_ten_year,
item.npat_last_nine_year,
item.npat_last_eight_year,
item.npat_last_seven_year,
item.npat_last_six_year,
item.npat_last_five_year,
item.npat_last_four_year,
item.npat_last_three_year,
item.npat_last_two_year,
item.npat_last_year,
// item.npat,
0,
item.total_asset_last_ten_year,
item.total_asset_last_nine_year,
item.total_asset_last_eight_year,
item.total_asset_last_seven_year,
item.total_asset_last_six_year,
item.total_asset_last_five_year,
item.total_asset_last_four_year,
item.total_asset_last_three_year,
item.total_asset_last_two_year,
item.total_asset_last_year,
// item.total_asset,
0,
item.total_equity_last_ten_year,
item.total_equity_last_nine_year,
item.total_equity_last_eight_year,
item.total_equity_last_seven_year,
item.total_equity_last_six_year,
item.total_equity_last_five_year,
item.total_equity_last_four_year,
item.total_equity_last_three_year,
item.total_equity_last_two_year,
item.total_equity_last_year,
// item.total_equity,
0,
item.order,
])
}
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
}
}
res.map((item, index) => {
dataTable.push([
0,
item.parent,
......@@ -619,8 +764,7 @@ export default class SummaryOfTriputra extends Component {
item.revenue_last_three_year,
item.revenue_last_two_year,
item.revenue_last_year,
// item.revenue,
0,
item.revenue,
item.ebitda_last_ten_year,
item.ebitda_last_nine_year,
item.ebitda_last_eight_year,
......@@ -631,8 +775,7 @@ export default class SummaryOfTriputra extends Component {
item.ebitda_last_three_year,
item.ebitda_last_two_year,
item.ebitda_last_year,
// item.ebitda,
0,
item.ebitda,
item.tpat_last_ten_year,
item.tpat_last_nine_year,
item.tpat_last_eight_year,
......@@ -643,8 +786,7 @@ export default class SummaryOfTriputra extends Component {
item.tpat_last_three_year,
item.tpat_last_two_year,
item.tpat_last_year,
// item.tpat,
0,
item.tpat,
item.npat_last_ten_year,
item.npat_last_nine_year,
item.npat_last_eight_year,
......@@ -655,8 +797,7 @@ export default class SummaryOfTriputra extends Component {
item.npat_last_three_year,
item.npat_last_two_year,
item.npat_last_year,
// item.npat,
0,
item.npat,
item.total_asset_last_ten_year,
item.total_asset_last_nine_year,
item.total_asset_last_eight_year,
......@@ -667,8 +808,7 @@ export default class SummaryOfTriputra extends Component {
item.total_asset_last_three_year,
item.total_asset_last_two_year,
item.total_asset_last_year,
// item.total_asset,
0,
item.total_asset,
item.total_equity_last_ten_year,
item.total_equity_last_nine_year,
item.total_equity_last_eight_year,
......@@ -679,103 +819,29 @@ export default class SummaryOfTriputra extends Component {
item.total_equity_last_three_year,
item.total_equity_last_two_year,
item.total_equity_last_year,
// item.total_equity,
0,
item.total_equity,
item.order,
])
}
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)
})
}
}
}
}
res.map((item, index) => {
dataTable.push([
0,
item.parent,
item.level,
item.item_name,
item.revenue_last_ten_year,
item.revenue_last_nine_year,
item.revenue_last_eight_year,
item.revenue_last_seven_year,
item.revenue_last_six_year,
item.revenue_last_five_year,
item.revenue_last_four_year,
item.revenue_last_three_year,
item.revenue_last_two_year,
item.revenue_last_year,
item.revenue,
item.ebitda_last_ten_year,
item.ebitda_last_nine_year,
item.ebitda_last_eight_year,
item.ebitda_last_seven_year,
item.ebitda_last_six_year,
item.ebitda_last_five_year,
item.ebitda_last_four_year,
item.ebitda_last_three_year,
item.ebitda_last_two_year,
item.ebitda_last_year,
item.ebitda,
item.tpat_last_ten_year,
item.tpat_last_nine_year,
item.tpat_last_eight_year,
item.tpat_last_seven_year,
item.tpat_last_six_year,
item.tpat_last_five_year,
item.tpat_last_four_year,
item.tpat_last_three_year,
item.tpat_last_two_year,
item.tpat_last_year,
item.tpat,
item.npat_last_ten_year,
item.npat_last_nine_year,
item.npat_last_eight_year,
item.npat_last_seven_year,
item.npat_last_six_year,
item.npat_last_five_year,
item.npat_last_four_year,
item.npat_last_three_year,
item.npat_last_two_year,
item.npat_last_year,
item.npat,
item.total_asset_last_ten_year,
item.total_asset_last_nine_year,
item.total_asset_last_eight_year,
item.total_asset_last_seven_year,
item.total_asset_last_six_year,
item.total_asset_last_five_year,
item.total_asset_last_four_year,
item.total_asset_last_three_year,
item.total_asset_last_two_year,
item.total_asset_last_year,
item.total_asset,
item.total_equity_last_ten_year,
item.total_equity_last_nine_year,
item.total_equity_last_eight_year,
item.total_equity_last_seven_year,
item.total_equity_last_six_year,
item.total_equity_last_five_year,
item.total_equity_last_four_year,
item.total_equity_last_three_year,
item.total_equity_last_two_year,
item.total_equity_last_year,
item.total_equity,
item.order,
])
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
})
console.log()
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
}
})
console.log()
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
})
}
} else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
}
......
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