Commit 92380485 authored by Faisal Hamdi's avatar Faisal Hamdi

Merge branch 'faisal' into 'master'

#issue login

See merge request !1197
parents dc06a583 50dbff9a
...@@ -424,10 +424,71 @@ export default class SubHolding extends Component { ...@@ -424,10 +424,71 @@ export default class SubHolding extends Component {
console.log(response); console.log(response);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
let res = response.data.data if (response.data.status === 'success') {
const handlePushChild = (item) => { let res = response.data.data
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) const handlePushChild = (item) => {
if (indexIDzz === -1) { let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) {
dataTable.push([
item.type_report_id,
item.id,
item.parent,
item.formula,
item.level,
item.description,
item.profit_loss.total_actual_before === null ? "0" : item.profit_loss.total_actual_before === "" ? "0" : item.profit_loss.total_actual_before,
item.profit_loss.january,
item.profit_loss.february,
item.profit_loss.march,
item.profit_loss.april,
item.profit_loss.may,
item.profit_loss.june,
item.profit_loss.july,
item.profit_loss.august,
item.profit_loss.september,
item.profit_loss.october,
item.profit_loss.november,
item.profit_loss.december,
item.profit_loss.total_current_year,
item.profit_loss.total_next_year,
item.profit_loss.total_more_year,
item.order,
item.profit_loss.monthly_january,
item.profit_loss.monthly_february,
item.profit_loss.monthly_march,
item.profit_loss.monthly_april,
item.profit_loss.monthly_may,
item.profit_loss.monthly_june,
item.profit_loss.monthly_july,
item.profit_loss.monthly_august,
item.profit_loss.monthly_september,
item.profit_loss.monthly_october,
item.profit_loss.monthly_november,
item.profit_loss.monthly_december,
item.profit_loss.monthly_last_year_january,
item.profit_loss.monthly_last_year_february,
item.profit_loss.monthly_last_year_march,
item.profit_loss.monthly_last_year_april,
item.profit_loss.monthly_last_year_may,
item.profit_loss.monthly_last_year_june,
item.profit_loss.monthly_last_year_july,
item.profit_loss.monthly_last_year_august,
item.profit_loss.monthly_last_year_september,
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
])
}
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
}
}
res.map((item, index) => {
dataTable.push([ dataTable.push([
item.type_report_id, item.type_report_id,
item.id, item.id,
...@@ -478,82 +539,32 @@ export default class SubHolding extends Component { ...@@ -478,82 +539,32 @@ export default class SubHolding extends Component {
item.profit_loss.monthly_last_year_december, item.profit_loss.monthly_last_year_december,
item.profit_loss.notes item.profit_loss.notes
]) ])
} 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) })
}) }
}
}
}
res.map((item, index) => {
dataTable.push([
item.type_report_id,
item.id,
item.parent,
item.formula,
item.level,
item.description,
item.profit_loss.total_actual_before === null ? "0" : item.profit_loss.total_actual_before === "" ? "0" : item.profit_loss.total_actual_before,
item.profit_loss.january,
item.profit_loss.february,
item.profit_loss.march,
item.profit_loss.april,
item.profit_loss.may,
item.profit_loss.june,
item.profit_loss.july,
item.profit_loss.august,
item.profit_loss.september,
item.profit_loss.october,
item.profit_loss.november,
item.profit_loss.december,
item.profit_loss.total_current_year,
item.profit_loss.total_next_year,
item.profit_loss.total_more_year,
item.order,
item.profit_loss.monthly_january,
item.profit_loss.monthly_february,
item.profit_loss.monthly_march,
item.profit_loss.monthly_april,
item.profit_loss.monthly_may,
item.profit_loss.monthly_june,
item.profit_loss.monthly_july,
item.profit_loss.monthly_august,
item.profit_loss.monthly_september,
item.profit_loss.monthly_october,
item.profit_loss.monthly_november,
item.profit_loss.monthly_december,
item.profit_loss.monthly_last_year_january,
item.profit_loss.monthly_last_year_february,
item.profit_loss.monthly_last_year_march,
item.profit_loss.monthly_last_year_april,
item.profit_loss.monthly_last_year_may,
item.profit_loss.monthly_last_year_june,
item.profit_loss.monthly_last_year_july,
item.profit_loss.monthly_last_year_august,
item.profit_loss.monthly_last_year_september,
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
])
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
} }
} })
}) // 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, previewTable: true, loading: false, previewDownload: true })
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
// this.setState({ dataTable }, () => { // this.setState({ dataTable }, () => {
// console.log(this.state.dataTable) // console.log(this.state.dataTable)
// this.getPLDetailMR(payload) // this.getPLDetailMR(payload)
// }) // })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else { } else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false }) this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
} }
...@@ -564,10 +575,72 @@ export default class SubHolding extends Component { ...@@ -564,10 +575,72 @@ export default class SubHolding extends Component {
console.log(response); console.log(response);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
let res = response.data.data if (response.data.status === 'success') {
const handlePushChild = (item) => { let res = response.data.data
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) const handlePushChild = (item) => {
if (indexIDzz === -1) { let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) {
dataTable.push([
item.type_report_id,
item.id,
item.parent,
item.formula,
item.level,
item.description,
item.balance_sheet.total_actual_before === null ? "0.0" : item.balance_sheet.total_actual_before === "" ? "0.0" : item.balance_sheet.total_actual_before,
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),
Number(item.balance_sheet.total_current_year).toFixed(1),
Number(item.balance_sheet.total_next_year).toFixed(1),
Number(item.balance_sheet.total_more_year).toFixed(1),
item.order,
item.condition_it_should_be,
item.condition_if_wrong,
item.balance_sheet.monthly_january,
item.balance_sheet.monthly_february,
item.balance_sheet.monthly_march,
item.balance_sheet.monthly_april,
item.balance_sheet.monthly_may,
item.balance_sheet.monthly_june,
item.balance_sheet.monthly_july,
item.balance_sheet.monthly_august,
item.balance_sheet.monthly_september,
item.balance_sheet.monthly_october,
item.balance_sheet.monthly_november,
item.balance_sheet.monthly_december,
item.balance_sheet.monthly_last_year_january,
item.balance_sheet.monthly_last_year_february,
item.balance_sheet.monthly_last_year_march,
item.balance_sheet.monthly_last_year_april,
item.balance_sheet.monthly_last_year_may,
item.balance_sheet.monthly_last_year_june,
item.balance_sheet.monthly_last_year_july,
item.balance_sheet.monthly_last_year_august,
item.balance_sheet.monthly_last_year_september,
item.balance_sheet.monthly_last_year_october,
item.balance_sheet.monthly_last_year_november,
item.balance_sheet.monthly_last_year_december
])
}
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
}
}
res.map((item, index) => {
dataTable.push([ dataTable.push([
item.type_report_id, item.type_report_id,
item.id, item.id,
...@@ -619,80 +692,29 @@ export default class SubHolding extends Component { ...@@ -619,80 +692,29 @@ export default class SubHolding extends Component {
item.balance_sheet.monthly_last_year_november, item.balance_sheet.monthly_last_year_november,
item.balance_sheet.monthly_last_year_december item.balance_sheet.monthly_last_year_december
]) ])
} 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) })
}) }
} }
} })
} this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
res.map((item, index) => { // this.setState({ dataTable }, () => {
dataTable.push([ // console.log(this.state.dataTable)
item.type_report_id, // this.getBalanceSheetMR(payload)
item.id, // })
item.parent, } else {
item.formula, this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
item.level, if (response.data.message.includes("Someone Logged In")) {
item.description, setTimeout(() => {
item.balance_sheet.total_actual_before === null ? "0.0" : item.balance_sheet.total_actual_before === "" ? "0.0" : item.balance_sheet.total_actual_before, localStorage.removeItem(Constant.TOKEN)
Number(item.balance_sheet.january).toFixed(1), window.location.reload();
Number(item.balance_sheet.february).toFixed(1), }, 1000);
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),
Number(item.balance_sheet.total_current_year).toFixed(1),
Number(item.balance_sheet.total_next_year).toFixed(1),
Number(item.balance_sheet.total_more_year).toFixed(1),
item.order,
item.condition_it_should_be,
item.condition_if_wrong,
item.balance_sheet.monthly_january,
item.balance_sheet.monthly_february,
item.balance_sheet.monthly_march,
item.balance_sheet.monthly_april,
item.balance_sheet.monthly_may,
item.balance_sheet.monthly_june,
item.balance_sheet.monthly_july,
item.balance_sheet.monthly_august,
item.balance_sheet.monthly_september,
item.balance_sheet.monthly_october,
item.balance_sheet.monthly_november,
item.balance_sheet.monthly_december,
item.balance_sheet.monthly_last_year_january,
item.balance_sheet.monthly_last_year_february,
item.balance_sheet.monthly_last_year_march,
item.balance_sheet.monthly_last_year_april,
item.balance_sheet.monthly_last_year_may,
item.balance_sheet.monthly_last_year_june,
item.balance_sheet.monthly_last_year_july,
item.balance_sheet.monthly_last_year_august,
item.balance_sheet.monthly_last_year_september,
item.balance_sheet.monthly_last_year_october,
item.balance_sheet.monthly_last_year_november,
item.balance_sheet.monthly_last_year_december
])
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
} }
} })
}) }
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
// this.setState({ dataTable }, () => {
// console.log(this.state.dataTable)
// this.getBalanceSheetMR(payload)
// })
} else { } else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false }) this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
} }
...@@ -718,173 +740,184 @@ export default class SubHolding extends Component { ...@@ -718,173 +740,184 @@ export default class SubHolding extends Component {
api.create().getReportPL(payloads).then(response => { api.create().getReportPL(payloads).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
let dataTable = [] if (response.data.status === 'success') {
console.log(response) let dataTable = []
let res = response.data.data console.log(response)
const handlePushChild = (item) => { let res = response.data.data
dataTable.push([ const handlePushChild = (item) => {
item.type_report_id, dataTable.push([
item.id, item.type_report_id,
item.parent, item.id,
item.formula, item.parent,
item.level, item.formula,
item.description, item.level,
item.profit_loss.total_actual_before === null ? "0" : item.profit_loss.total_actual_before === "" ? "0" : item.profit_loss.total_actual_before, item.description,
item.profit_loss.january, item.profit_loss.total_actual_before === null ? "0" : item.profit_loss.total_actual_before === "" ? "0" : item.profit_loss.total_actual_before,
item.profit_loss.february, item.profit_loss.january,
item.profit_loss.march, item.profit_loss.february,
item.profit_loss.april, item.profit_loss.march,
item.profit_loss.may, item.profit_loss.april,
item.profit_loss.june, item.profit_loss.may,
item.profit_loss.july, item.profit_loss.june,
item.profit_loss.august, item.profit_loss.july,
item.profit_loss.september, item.profit_loss.august,
item.profit_loss.october, item.profit_loss.september,
item.profit_loss.november, item.profit_loss.october,
item.profit_loss.december, item.profit_loss.november,
item.profit_loss.total_current_year, item.profit_loss.december,
item.profit_loss.total_next_year, item.profit_loss.total_current_year,
item.profit_loss.total_more_year, item.profit_loss.total_next_year,
// item.profit_detail.total_actual_before === null ? "0" : item.profit_detail.total_actual_before === "" ? "0" : item.profit_detail.total_actual_before, item.profit_loss.total_more_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.january, formula: item.profit_detail.january_formula } : item.profit_detail.january, // item.profit_detail.total_actual_before === null ? "0" : item.profit_detail.total_actual_before === "" ? "0" : item.profit_detail.total_actual_before,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.february, formula: item.profit_detail.february_formula } : item.profit_detail.february, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.january, formula: item.profit_detail.january_formula } : item.profit_detail.january,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.march, formula: item.profit_detail.march_formula } : item.profit_detail.march, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.february, formula: item.profit_detail.february_formula } : item.profit_detail.february,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.april, formula: item.profit_detail.april_formula } : item.profit_detail.april, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.march, formula: item.profit_detail.march_formula } : item.profit_detail.march,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.may, formula: item.profit_detail.may_formula } : item.profit_detail.may, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.april, formula: item.profit_detail.april_formula } : item.profit_detail.april,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.june, formula: item.profit_detail.june_formula } : item.profit_detail.june, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.may, formula: item.profit_detail.may_formula } : item.profit_detail.may,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.july, formula: item.profit_detail.july_formula } : item.profit_detail.july, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.june, formula: item.profit_detail.june_formula } : item.profit_detail.june,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.august, formula: item.profit_detail.august_formula } : item.profit_detail.august, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.july, formula: item.profit_detail.july_formula } : item.profit_detail.july,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.september, formula: item.profit_detail.september_formula } : item.profit_detail.september, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.august, formula: item.profit_detail.august_formula } : item.profit_detail.august,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.october, formula: item.profit_detail.october_formula } : item.profit_detail.october, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.september, formula: item.profit_detail.september_formula } : item.profit_detail.september,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.november, formula: item.profit_detail.november_formula } : item.profit_detail.november, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.october, formula: item.profit_detail.october_formula } : item.profit_detail.october,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.december, formula: item.profit_detail.december_formula } : item.profit_detail.december, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.november, formula: item.profit_detail.november_formula } : item.profit_detail.november,
// item.profit_detail.total_current_year, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.december, formula: item.profit_detail.december_formula } : item.profit_detail.december,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_next_year, // item.profit_detail.total_current_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_more_year, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_next_year,
item.order, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_more_year,
item.condition_it_should_be, item.order,
item.condition_if_wrong, item.condition_it_should_be,
[], item.condition_if_wrong,
"", [],
item.profit_loss.monthly_january, "",
item.profit_loss.monthly_february, item.profit_loss.monthly_january,
item.profit_loss.monthly_march, item.profit_loss.monthly_february,
item.profit_loss.monthly_april, item.profit_loss.monthly_march,
item.profit_loss.monthly_may, item.profit_loss.monthly_april,
item.profit_loss.monthly_june, item.profit_loss.monthly_may,
item.profit_loss.monthly_july, item.profit_loss.monthly_june,
item.profit_loss.monthly_august, item.profit_loss.monthly_july,
item.profit_loss.monthly_september, item.profit_loss.monthly_august,
item.profit_loss.monthly_october, item.profit_loss.monthly_september,
item.profit_loss.monthly_november, item.profit_loss.monthly_october,
item.profit_loss.monthly_december, item.profit_loss.monthly_november,
item.profit_loss.monthly_last_year_january, item.profit_loss.monthly_december,
item.profit_loss.monthly_last_year_february, item.profit_loss.monthly_last_year_january,
item.profit_loss.monthly_last_year_march, item.profit_loss.monthly_last_year_february,
item.profit_loss.monthly_last_year_april, item.profit_loss.monthly_last_year_march,
item.profit_loss.monthly_last_year_may, item.profit_loss.monthly_last_year_april,
item.profit_loss.monthly_last_year_june, item.profit_loss.monthly_last_year_may,
item.profit_loss.monthly_last_year_july, item.profit_loss.monthly_last_year_june,
item.profit_loss.monthly_last_year_august, item.profit_loss.monthly_last_year_july,
item.profit_loss.monthly_last_year_september, item.profit_loss.monthly_last_year_august,
item.profit_loss.monthly_last_year_october, item.profit_loss.monthly_last_year_september,
item.profit_loss.monthly_last_year_november, item.profit_loss.monthly_last_year_october,
item.profit_loss.monthly_last_year_december, item.profit_loss.monthly_last_year_november,
item.profit_loss.notes item.profit_loss.monthly_last_year_december,
]) item.profit_loss.notes
])
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)
}) })
}
} }
} }
} res.map((item, index) => {
res.map((item, index) => { dataTable.push([
dataTable.push([ item.type_report_id,
item.type_report_id, item.id,
item.id, item.parent,
item.parent, item.formula,
item.formula, item.level,
item.level, item.description,
item.description, item.profit_loss.total_actual_before === null ? "0" : item.profit_loss.total_actual_before === "" ? "0" : item.profit_loss.total_actual_before,
item.profit_loss.total_actual_before === null ? "0" : item.profit_loss.total_actual_before === "" ? "0" : item.profit_loss.total_actual_before, item.profit_loss.january,
item.profit_loss.january, item.profit_loss.february,
item.profit_loss.february, item.profit_loss.march,
item.profit_loss.march, item.profit_loss.april,
item.profit_loss.april, item.profit_loss.may,
item.profit_loss.may, item.profit_loss.june,
item.profit_loss.june, item.profit_loss.july,
item.profit_loss.july, item.profit_loss.august,
item.profit_loss.august, item.profit_loss.september,
item.profit_loss.september, item.profit_loss.october,
item.profit_loss.october, item.profit_loss.november,
item.profit_loss.november, item.profit_loss.december,
item.profit_loss.december, item.profit_loss.total_current_year,
item.profit_loss.total_current_year, item.profit_loss.total_next_year,
item.profit_loss.total_next_year, item.profit_loss.total_more_year,
item.profit_loss.total_more_year, // item.profit_detail.total_actual_before === null ? "0" : item.profit_detail.total_actual_before === "" ? "0" : item.profit_detail.total_actual_before,
// item.profit_detail.total_actual_before === null ? "0" : item.profit_detail.total_actual_before === "" ? "0" : item.profit_detail.total_actual_before, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.january, formula: item.profit_detail.january_formula } : item.profit_detail.january,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.january, formula: item.profit_detail.january_formula } : item.profit_detail.january, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.february, formula: item.profit_detail.february_formula } : item.profit_detail.february,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.february, formula: item.profit_detail.february_formula } : item.profit_detail.february, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.march, formula: item.profit_detail.march_formula } : item.profit_detail.march,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.march, formula: item.profit_detail.march_formula } : item.profit_detail.march, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.april, formula: item.profit_detail.april_formula } : item.profit_detail.april,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.april, formula: item.profit_detail.april_formula } : item.profit_detail.april, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.may, formula: item.profit_detail.may_formula } : item.profit_detail.may,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.may, formula: item.profit_detail.may_formula } : item.profit_detail.may, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.june, formula: item.profit_detail.june_formula } : item.profit_detail.june,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.june, formula: item.profit_detail.june_formula } : item.profit_detail.june, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.july, formula: item.profit_detail.july_formula } : item.profit_detail.july,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.july, formula: item.profit_detail.july_formula } : item.profit_detail.july, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.august, formula: item.profit_detail.august_formula } : item.profit_detail.august,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.august, formula: item.profit_detail.august_formula } : item.profit_detail.august, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.september, formula: item.profit_detail.september_formula } : item.profit_detail.september,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.september, formula: item.profit_detail.september_formula } : item.profit_detail.september, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.october, formula: item.profit_detail.october_formula } : item.profit_detail.october,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.october, formula: item.profit_detail.october_formula } : item.profit_detail.october, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.november, formula: item.profit_detail.november_formula } : item.profit_detail.november,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.november, formula: item.profit_detail.november_formula } : item.profit_detail.november, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.december, formula: item.profit_detail.december_formula } : item.profit_detail.december,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.december, formula: item.profit_detail.december_formula } : item.profit_detail.december, // item.profit_detail.total_current_year,
// item.profit_detail.total_current_year, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_next_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_next_year, // item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_more_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_more_year, item.order,
item.order, item.condition_it_should_be,
item.condition_it_should_be, item.condition_if_wrong,
item.condition_if_wrong, [],
[], "",
"", item.profit_loss.monthly_january,
item.profit_loss.monthly_january, item.profit_loss.monthly_february,
item.profit_loss.monthly_february, item.profit_loss.monthly_march,
item.profit_loss.monthly_march, item.profit_loss.monthly_april,
item.profit_loss.monthly_april, item.profit_loss.monthly_may,
item.profit_loss.monthly_may, item.profit_loss.monthly_june,
item.profit_loss.monthly_june, item.profit_loss.monthly_july,
item.profit_loss.monthly_july, item.profit_loss.monthly_august,
item.profit_loss.monthly_august, item.profit_loss.monthly_september,
item.profit_loss.monthly_september, item.profit_loss.monthly_october,
item.profit_loss.monthly_october, item.profit_loss.monthly_november,
item.profit_loss.monthly_november, item.profit_loss.monthly_december,
item.profit_loss.monthly_december, item.profit_loss.monthly_last_year_january,
item.profit_loss.monthly_last_year_january, item.profit_loss.monthly_last_year_february,
item.profit_loss.monthly_last_year_february, item.profit_loss.monthly_last_year_march,
item.profit_loss.monthly_last_year_march, item.profit_loss.monthly_last_year_april,
item.profit_loss.monthly_last_year_april, item.profit_loss.monthly_last_year_may,
item.profit_loss.monthly_last_year_may, item.profit_loss.monthly_last_year_june,
item.profit_loss.monthly_last_year_june, item.profit_loss.monthly_last_year_july,
item.profit_loss.monthly_last_year_july, item.profit_loss.monthly_last_year_august,
item.profit_loss.monthly_last_year_august, item.profit_loss.monthly_last_year_september,
item.profit_loss.monthly_last_year_september, item.profit_loss.monthly_last_year_october,
item.profit_loss.monthly_last_year_october, item.profit_loss.monthly_last_year_november,
item.profit_loss.monthly_last_year_november, item.profit_loss.monthly_last_year_december,
item.profit_loss.monthly_last_year_december, item.profit_loss.notes
item.profit_loss.notes ])
]) 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) })
}) }
} }
} })
}) this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true }) // this.setState({ dataTable , loading: false}, () => {
// this.setState({ dataTable , loading: false}, () => { console.log(this.state.dataTable)
console.log(this.state.dataTable) // this.getReportPLMR(payload)
// this.getReportPLMR(payload) // })
// }) } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else { } else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false }) 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