Commit c1098d4d authored by d.arizona's avatar d.arizona

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

parents 539a54b3 d56b1ea3
...@@ -874,18 +874,18 @@ export default class SubHolding extends Component { ...@@ -874,18 +874,18 @@ export default class SubHolding extends Component {
item.ratio.monthly_october, item.ratio.monthly_october,
item.ratio.monthly_november, item.ratio.monthly_november,
item.ratio.monthly_december, item.ratio.monthly_december,
item.ratio.monthly_january_last_year, item.ratio.monthly_last_year_january,
item.ratio.monthly_february_last_year, item.ratio.monthly_last_year_february,
item.ratio.monthly_march_last_year, item.ratio.monthly_last_year_march,
item.ratio.monthly_april_last_year, item.ratio.monthly_last_year_april,
item.ratio.monthly_may_last_year, item.ratio.monthly_last_year_may,
item.ratio.monthly_june_last_year, item.ratio.monthly_last_year_june,
item.ratio.monthly_july_last_year, item.ratio.monthly_last_year_july,
item.ratio.monthly_august_last_year, item.ratio.monthly_last_year_august,
item.ratio.monthly_september_last_year, item.ratio.monthly_last_year_september,
item.ratio.monthly_october_last_year, item.ratio.monthly_last_year_october,
item.ratio.monthly_november_last_year, item.ratio.monthly_last_year_november,
item.ratio.monthly_december_last_year, item.ratio.monthly_last_year_december,
]) ])
} }
if (item.children !== null) { if (item.children !== null) {
...@@ -932,18 +932,18 @@ export default class SubHolding extends Component { ...@@ -932,18 +932,18 @@ export default class SubHolding extends Component {
item.ratio.monthly_october, item.ratio.monthly_october,
item.ratio.monthly_november, item.ratio.monthly_november,
item.ratio.monthly_december, item.ratio.monthly_december,
item.ratio.monthly_january_last_year, item.ratio.monthly_last_year_january,
item.ratio.monthly_february_last_year, item.ratio.monthly_last_year_february,
item.ratio.monthly_march_last_year, item.ratio.monthly_last_year_march,
item.ratio.monthly_april_last_year, item.ratio.monthly_last_year_april,
item.ratio.monthly_may_last_year, item.ratio.monthly_last_year_may,
item.ratio.monthly_june_last_year, item.ratio.monthly_last_year_june,
item.ratio.monthly_july_last_year, item.ratio.monthly_last_year_july,
item.ratio.monthly_august_last_year, item.ratio.monthly_last_year_august,
item.ratio.monthly_september_last_year, item.ratio.monthly_last_year_september,
item.ratio.monthly_october_last_year, item.ratio.monthly_last_year_october,
item.ratio.monthly_november_last_year, item.ratio.monthly_last_year_november,
item.ratio.monthly_december_last_year, item.ratio.monthly_last_year_december,
]) ])
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
......
...@@ -541,6 +541,210 @@ export default class SummaryOfTriputra extends Component { ...@@ -541,6 +541,210 @@ export default class SummaryOfTriputra extends Component {
const handlePushChild = (item) => { const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[0] === item.company_id) let indexIDzz = dataTable.findIndex((val) => val[0] === item.company_id)
if (indexIDzz === -1) { if (indexIDzz === -1) {
// revenue ytd
let revenueYtdAct = item.revenue_ytd_act == '' ? 0 : Number(item.revenue_ytd_act)
let revenueYtdMB = item.revenue_ytd_mb == '' ? 0 : Number(item.revenue_ytd_mb)
let revenueYtdPersenMB = 0
if (revenueYtdMB < 0) {
if (revenueYtdAct >= revenueYtdMB) {
revenueYtdPersenMB = ( revenueYtdMB - revenueYtdAct ) / revenueYtdMB + 1
} else {
revenueYtdPersenMB = ( revenueYtdMB - revenueYtdAct ) / revenueYtdMB
}
} else {
revenueYtdPersenMB = revenueYtdAct / revenueYtdMB
}
// revenue ytd last year
let revenueYtdLY = item.revenue_ytd_last_year == '' ? 0 : Number(item.revenue_ytd_last_year)
let revenueYtdPersenLY = 0
if (revenueYtdLY < 0) {
if (revenueYtdAct >= revenueYtdLY) {
revenueYtdPersenLY = ( revenueYtdLY - revenueYtdAct ) / revenueYtdLY + 1
} else {
revenueYtdPersenLY = ( revenueYtdLY - revenueYtdAct ) / revenueYtdLY
}
} else {
revenueYtdPersenLY = revenueYtdAct / revenueYtdLY
}
// revenue fy
let revenueFyOl = item.revenue_fy_ol == '' ? 0 : Number(item.revenue_fy_ol)
let revenueFyMB = item.revenue_fy_mb == '' ? 0 : Number(item.revenue_fy_mb)
let revenueFyPersenMB = 0
if (revenueFyMB < 0) {
if (revenueFyOl >= revenueFyMB) {
revenueFyPersenMB = ( revenueFyMB - revenueFyOl ) / revenueFyMB + 1
} else {
revenueFyPersenMB = ( revenueFyMB - revenueFyOl ) / revenueFyMB
}
} else {
revenueFyPersenMB = revenueFyOl / revenueFyMB
}
// revenue fy last year
let revenueFyLY = item.revenue_fy_last_year == '' ? 0 : Number(item.revenue_fy_last_year)
let revenueFyPersenLY = 0
if (revenueFyLY < 0) {
if (revenueFyOl >= revenueFyLY) {
revenueFyPersenLY = ( revenueFyLY - revenueFyOl ) / revenueFyLY + 1
} else {
revenueFyPersenLY = ( revenueFyLY - revenueFyOl ) / revenueFyLY
}
} else {
revenueFyPersenLY = revenueFyOl / revenueFyLY
}
// ebitda ytd
let ebitdaYtdAct = item.ebitda_ytd_act == '' ? 0 : Number(item.ebitda_ytd_act)
let ebitdaYtdMB = item.ebitda_ytd_mb == '' ? 0 : Number(item.ebitda_ytd_mb)
let ebitdaYtdPersenMB = 0
if (ebitdaYtdMB < 0) {
if (ebitdaYtdAct >= ebitdaYtdMB) {
ebitdaYtdPersenMB = ( ebitdaYtdMB - ebitdaYtdAct ) / ebitdaYtdMB + 1
} else {
ebitdaYtdPersenMB = ( ebitdaYtdMB - ebitdaYtdAct ) / ebitdaYtdMB
}
} else {
ebitdaYtdPersenMB = ebitdaYtdAct / ebitdaYtdMB
}
// ebitda ytd last year
let ebitdaYtdLY = item.ebitda_ytd_last_year == '' ? 0 : Number(item.ebitda_ytd_last_year)
let ebitdaYtdPersenLY = 0
if (ebitdaYtdLY < 0) {
if (ebitdaYtdAct >= ebitdaYtdLY) {
ebitdaYtdPersenLY = ( ebitdaYtdLY - ebitdaYtdAct ) / ebitdaYtdLY + 1
} else {
ebitdaYtdPersenLY = ( ebitdaYtdLY - ebitdaYtdAct ) / ebitdaYtdLY
}
} else {
ebitdaYtdPersenLY = ebitdaYtdAct / ebitdaYtdLY
}
// ebitda fy
let ebitdaFyOl = item.ebitda_fy_ol == '' ? 0 : Number(item.ebitda_fy_ol)
let ebitdaFyMB = item.ebitda_fy_mb == '' ? 0 : Number(item.ebitda_fy_mb)
let ebitdaFyPersenMB = 0
if (ebitdaFyMB < 0) {
if (ebitdaFyOl >= ebitdaFyMB) {
ebitdaFyPersenMB = ( ebitdaFyMB - ebitdaFyOl ) / ebitdaFyMB + 1
} else {
ebitdaFyPersenMB = ( ebitdaFyMB - ebitdaFyOl ) / ebitdaFyMB
}
} else {
ebitdaFyPersenMB = ebitdaFyOl / ebitdaFyMB
}
// ebitda fy last year
let ebitdaFyLY = item.ebitda_fy_last_year == '' ? 0 : Number(item.ebitda_fy_last_year)
let ebitdaFyPersenLY = 0
if (ebitdaFyLY < 0) {
if (ebitdaFyOl >= ebitdaFyLY) {
ebitdaFyPersenLY = ( ebitdaFyLY - ebitdaFyOl ) / ebitdaFyLY + 1
} else {
ebitdaFyPersenLY = ( ebitdaFyLY - ebitdaFyOl ) / ebitdaFyLY
}
} else {
ebitdaFyPersenLY = ebitdaFyOl / ebitdaFyLY
}
// tpat ytd
let tpatYtdAct = item.tpat_ytd_act == '' ? 0 : Number(item.tpat_ytd_act)
let tpatYtdMB = item.tpat_ytd_mb == '' ? 0 : Number(item.tpat_ytd_mb)
let tpatYtdPersenMB = 0
if (tpatYtdMB < 0) {
if (tpatYtdAct >= tpatYtdMB) {
tpatYtdPersenMB = ( tpatYtdMB - tpatYtdAct ) / tpatYtdMB + 1
} else {
tpatYtdPersenMB = ( tpatYtdMB - tpatYtdAct ) / tpatYtdMB
}
} else {
tpatYtdPersenMB = tpatYtdAct / tpatYtdMB
}
// tpat ytd last year
let tpatYtdLY = item.tpat_ytd_last_year == '' ? 0 : Number(item.tpat_ytd_last_year)
let tpatYtdPersenLY = 0
if (tpatYtdLY < 0) {
if (tpatYtdAct >= tpatYtdLY) {
tpatYtdPersenLY = ( tpatYtdLY - tpatYtdAct ) / tpatYtdLY + 1
} else {
tpatYtdPersenLY = ( tpatYtdLY - tpatYtdAct ) / tpatYtdLY
}
} else {
tpatYtdPersenLY = tpatYtdAct / tpatYtdLY
}
// tpat fy
let tpatFyOl = item.tpat_fy_ol == '' ? 0 : Number(item.tpat_fy_ol)
let tpatFyMB = item.tpat_fy_mb == '' ? 0 : Number(item.tpat_fy_mb)
let tpatFyPersenMB = 0
if (tpatFyMB < 0) {
if (tpatFyOl >= tpatFyMB) {
tpatFyPersenMB = ( tpatFyMB - tpatFyOl ) / tpatFyMB + 1
} else {
tpatFyPersenMB = ( tpatFyMB - tpatFyOl ) / tpatFyMB
}
} else {
tpatFyPersenMB = tpatFyOl / tpatFyMB
}
// tpat fy last year
let tpatFyLY = item.tpat_fy_last_year == '' ? 0 : Number(item.tpat_fy_last_year)
let tpatFyPersenLY = 0
if (tpatFyLY < 0) {
if (tpatFyOl >= tpatFyLY) {
tpatFyPersenLY = ( tpatFyLY - tpatFyOl ) / tpatFyLY + 1
} else {
tpatFyPersenLY = ( tpatFyLY - tpatFyOl ) / tpatFyLY
}
} else {
tpatFyPersenLY = tpatFyOl / tpatFyLY
}
// npat ytd
let npatYtdAct = item.npat_ytd_act == '' ? 0 : Number(item.npat_ytd_act)
let npatYtdMB = item.npat_ytd_mb == '' ? 0 : Number(item.npat_ytd_mb)
let npatYtdPersenMB = 0
if (npatYtdMB < 0) {
if (npatYtdAct >= npatYtdMB) {
npatYtdPersenMB = ( npatYtdMB - npatYtdAct ) / npatYtdMB + 1
} else {
npatYtdPersenMB = ( npatYtdMB - npatYtdAct ) / npatYtdMB
}
} else {
npatYtdPersenMB = npatYtdAct / npatYtdMB
}
// npat ytd last year
let npatYtdLY = item.npat_ytd_last_year == '' ? 0 : Number(item.npat_ytd_last_year)
let npatYtdPersenLY = 0
if (npatYtdLY < 0) {
if (npatYtdAct >= npatYtdLY) {
npatYtdPersenLY = ( npatYtdLY - npatYtdAct ) / npatYtdLY + 1
} else {
npatYtdPersenLY = ( npatYtdLY - npatYtdAct ) / npatYtdLY
}
} else {
npatYtdPersenLY = npatYtdAct / npatYtdLY
}
// npat fy
let npatFyOl = item.npat_fy_ol == '' ? 0 : Number(item.npat_fy_ol)
let npatFyMB = item.npat_fy_mb == '' ? 0 : Number(item.npat_fy_mb)
let npatFyPersenMB = 0
if (npatFyMB < 0) {
if (npatFyOl >= npatFyMB) {
npatFyPersenMB = ( npatFyMB - npatFyOl ) / npatFyMB + 1
} else {
npatFyPersenMB = ( npatFyMB - npatFyOl ) / npatFyMB
}
} else {
npatFyPersenMB = npatFyOl / npatFyMB
}
// npat fy last year
let npatFyLY = item.npat_fy_last_year == '' ? 0 : Number(item.npat_fy_last_year)
let npatFyPersenLY = 0
if (npatFyLY < 0) {
if (npatFyOl >= npatFyLY) {
npatFyPersenLY = ( npatFyLY - npatFyOl ) / npatFyLY + 1
} else {
npatFyPersenLY = ( npatFyLY - npatFyOl ) / npatFyLY
}
} else {
npatFyPersenLY = npatFyOl / npatFyLY
}
dataTable.push([ dataTable.push([
item.company_id, item.company_id,
item.parent, item.parent,
...@@ -548,44 +752,60 @@ export default class SummaryOfTriputra extends Component { ...@@ -548,44 +752,60 @@ export default class SummaryOfTriputra extends Component {
item.company_name, item.company_name,
item.revenue_ytd_act, item.revenue_ytd_act,
item.revenue_ytd_mb, item.revenue_ytd_mb,
item.revenue_ytd_percent_of_mb, // item.revenue_ytd_percent_of_mb,
isNaN(revenueYtdPersenMB) || revenueYtdPersenMB == 'Infinity' || revenueYtdPersenMB == '-Infinity' ? ( item.revenue_ytd_mb == '' || item.revenue_ytd_mb == 0 ? -0 : 0 ) : ( item.revenue_ytd_mb == '' || item.revenue_ytd_mb == 0 ? Number(revenueYtdPersenMB) * Number(-100) : Number(revenueYtdPersenMB) * Number(100) ),
item.revenue_ytd_last_year, item.revenue_ytd_last_year,
item.revenue_ytd_percent_of_last_year, // item.revenue_ytd_percent_of_last_year,
isNaN(revenueYtdPersenLY) || revenueYtdPersenLY == 'Infinity' || revenueYtdPersenLY == '-Infinity' ? ( item.revenue_ytd_last_year == '' || item.revenue_ytd_last_year == 0 ? -0 : 0 ) : ( item.revenue_ytd_last_year == '' || item.revenue_ytd_last_year == 0 ? Number(revenueYtdPersenLY) * Number(-100) : Number(revenueYtdPersenLY) * Number(100) ),
item.revenue_fy_ol, item.revenue_fy_ol,
item.revenue_fy_mb, item.revenue_fy_mb,
item.revenue_fy_percent_of_mb, // item.revenue_fy_percent_of_mb,
isNaN(revenueFyPersenMB) || revenueFyPersenMB == 'Infinity' || revenueFyPersenMB == '-Infinity' ? ( item.revenue_fy_mb == '' || item.revenue_fy_mb == 0 ? -0 : 0 ) : ( item.revenue_fy_mb == '' || item.revenue_fy_mb == 0 ? Number(revenueFyPersenMB) * Number(-100) : Number(revenueFyPersenMB) * Number(100) ),
item.revenue_fy_last_year, item.revenue_fy_last_year,
item.revenue_fy_percent_of_last_year, // item.revenue_fy_percent_of_last_year,
isNaN(revenueFyPersenLY) || revenueFyPersenLY == 'Infinity' || revenueFyPersenLY == '-Infinity' ? ( item.revenue_fy_last_year == '' || item.revenue_fy_last_year == 0 ? -0 : 0 ) : ( item.revenue_fy_last_year == '' || item.revenue_fy_last_year == 0 ? Number(revenueFyPersenLY) * Number(-100) : Number(revenueFyPersenLY) * Number(100) ),
item.ebitda_ytd_act, item.ebitda_ytd_act,
item.ebitda_ytd_mb, item.ebitda_ytd_mb,
item.ebitda_ytd_percent_of_mb, // item.ebitda_ytd_percent_of_mb,
isNaN(ebitdaYtdPersenMB) || ebitdaYtdPersenMB == 'Infinity' || ebitdaYtdPersenMB == '-Infinity' ? ( item.ebitda_ytd_mb == '' || item.ebitda_ytd_mb == 0 ? -0 : 0 ) : ( item.ebitda_ytd_mb == '' || item.ebitda_ytd_mb == 0 ? Number(ebitdaYtdPersenMB) * Number(-100) : Number(ebitdaYtdPersenMB) * Number(100) ),
item.ebitda_ytd_last_year, item.ebitda_ytd_last_year,
item.ebitda_ytd_percent_of_last_year, // item.ebitda_ytd_percent_of_last_year,
isNaN(ebitdaYtdPersenLY) || ebitdaYtdPersenLY == 'Infinity' || ebitdaYtdPersenLY == '-Infinity' ? ( item.ebitda_ytd_last_year == '' || item.ebitda_ytd_last_year == 0 ? -0 : 0 ) : ( item.ebitda_ytd_last_year == '' || item.ebitda_ytd_last_year == 0 ? Number(ebitdaYtdPersenLY) * Number(-100) : Number(ebitdaYtdPersenLY) * Number(100) ),
item.ebitda_fy_ol, item.ebitda_fy_ol,
item.ebitda_fy_mb, item.ebitda_fy_mb,
item.ebitda_fy_percent_of_mb, // item.ebitda_fy_percent_of_mb,
isNaN(ebitdaFyPersenMB) || ebitdaFyPersenMB == 'Infinity' || ebitdaFyPersenMB == '-Infinity' ? ( item.ebitda_fy_mb == '' || item.ebitda_fy_mb == 0 ? -0 : 0 ) : ( item.ebitda_fy_mb == '' || item.ebitda_fy_mb == 0 ? Number(ebitdaFyPersenMB) * Number(-100) : Number(ebitdaFyPersenMB) * Number(100) ),
item.ebitda_fy_last_year, item.ebitda_fy_last_year,
item.ebitda_fy_percent_of_last_year, // item.ebitda_fy_percent_of_last_year,
isNaN(ebitdaFyPersenLY) || ebitdaFyPersenLY == 'Infinity' || ebitdaFyPersenLY == '-Infinity' ? ( item.ebitda_fy_last_year == '' || item.ebitda_fy_last_year == 0 ? -0 : 0 ) : ( item.ebitda_fy_last_year == '' || item.ebitda_fy_last_year == 0 ? Number(ebitdaFyPersenLY) * Number(-100) : Number(ebitdaFyPersenLY) * Number(100) ),
item.tpat_ytd_act, item.tpat_ytd_act,
item.tpat_ytd_mb, item.tpat_ytd_mb,
item.tpat_ytd_percent_of_mb, // item.tpat_ytd_percent_of_mb,
isNaN(tpatYtdPersenMB) || tpatYtdPersenMB == 'Infinity' || tpatYtdPersenMB == '-Infinity' ? ( item.tpat_ytd_mb == '' || item.tpat_ytd_mb == 0 ? -0 : 0 ) : ( item.tpat_ytd_mb == '' || item.tpat_ytd_mb == 0 ? Number(tpatYtdPersenMB) * Number(-100) : Number(tpatYtdPersenMB) * Number(100) ),
item.tpat_ytd_last_year, item.tpat_ytd_last_year,
item.tpat_ytd_percent_of_last_year, // item.tpat_ytd_percent_of_last_year,
isNaN(tpatYtdPersenLY) || tpatYtdPersenLY == 'Infinity' || tpatYtdPersenLY == '-Infinity' ? ( item.tpat_ytd_last_year == '' || item.tpat_ytd_last_year == 0 ? -0 : 0 ) : ( item.tpat_ytd_last_year == '' || item.tpat_ytd_last_year == 0 ? Number(tpatYtdPersenLY) * Number(-100) : Number(tpatYtdPersenLY) * Number(100) ),
item.tpat_fy_ol, item.tpat_fy_ol,
item.tpat_fy_mb, item.tpat_fy_mb,
item.tpat_fy_percent_of_mb, // item.tpat_fy_percent_of_mb,
isNaN(tpatFyPersenMB) || tpatFyPersenMB == 'Infinity' || tpatFyPersenMB == '-Infinity' ? ( item.tpat_fy_mb == '' || item.tpat_fy_mb == 0 ? -0 : 0 ) : ( item.tpat_fy_mb == '' || item.tpat_fy_mb == 0 ? Number(tpatFyPersenMB) * Number(-100) : Number(tpatFyPersenMB) * Number(100) ),
item.tpat_fy_last_year, item.tpat_fy_last_year,
item.tpat_fy_percent_of_last_year, // item.tpat_fy_percent_of_last_year,
isNaN(tpatFyPersenLY) || tpatFyPersenLY == 'Infinity' || tpatFyPersenLY == '-Infinity' ? ( item.tpat_fy_last_year == '' || item.tpat_fy_last_year == 0 ? -0 : 0 ) : ( item.tpat_fy_last_year == '' || item.tpat_fy_last_year == 0 ? Number(tpatFyPersenLY) * Number(-100) : Number(tpatFyPersenLY) * Number(100) ),
item.npat_ytd_act, item.npat_ytd_act,
item.npat_ytd_mb, item.npat_ytd_mb,
item.npat_ytd_percent_of_mb, // item.npat_ytd_percent_of_mb,
isNaN(npatYtdPersenMB) || npatYtdPersenMB == 'Infinity' || npatYtdPersenMB == '-Infinity' ? ( item.npat_ytd_mb == '' || item.npat_ytd_mb == 0 ? -0 : 0 ) : ( item.npat_ytd_mb == '' || item.npat_ytd_mb == 0 ? Number(npatYtdPersenMB) * Number(-100) : Number(npatYtdPersenMB) * Number(100) ),
item.npat_ytd_last_year, item.npat_ytd_last_year,
item.npat_ytd_percent_of_last_year, // item.npat_ytd_percent_of_last_year,
isNaN(npatYtdPersenLY) || npatYtdPersenLY == 'Infinity' || npatYtdPersenLY == '-Infinity' ? ( item.npat_ytd_last_year == '' || item.npat_ytd_last_year == 0 ? -0 : 0 ) : ( item.npat_ytd_last_year == '' || item.npat_ytd_last_year == 0 ? Number(npatYtdPersenLY) * Number(-100) : Number(npatYtdPersenLY) * Number(100) ),
item.npat_fy_ol, item.npat_fy_ol,
item.npat_fy_mb, item.npat_fy_mb,
item.npat_fy_percent_of_mb, // item.npat_fy_percent_of_mb,
isNaN(npatFyPersenMB) || npatFyPersenMB == 'Infinity' || npatFyPersenMB == '-Infinity' ? ( item.npat_fy_mb == '' || item.npat_fy_mb == 0 ? -0 : 0 ) : ( item.npat_fy_mb == '' || item.npat_fy_mb == 0 ? Number(npatFyPersenMB) * Number(-100) : Number(npatFyPersenMB) * Number(100) ),
item.npat_fy_last_year, item.npat_fy_last_year,
item.npat_fy_percent_of_last_year, // item.npat_fy_percent_of_last_year,
isNaN(npatFyPersenLY) || npatFyPersenLY == 'Infinity' || npatFyPersenLY == '-Infinity' ? ( item.tpat_fy_last_year == '' || item.tpat_fy_last_year == 0 ? -0 : 0 ) : ( item.tpat_fy_last_year == '' || item.tpat_fy_last_year == 0 ? Number(npatFyPersenLY) * Number(-100) : Number(npatFyPersenLY) * Number(100) ),
item.order, item.order,
]) ])
} }
...@@ -598,6 +818,210 @@ export default class SummaryOfTriputra extends Component { ...@@ -598,6 +818,210 @@ export default class SummaryOfTriputra extends Component {
} }
} }
res.map((item, index) => { res.map((item, index) => {
// revenue ytd
let revenueYtdAct = item.revenue_ytd_act == '' ? 0 : Number(item.revenue_ytd_act)
let revenueYtdMB = item.revenue_ytd_mb == '' ? 0 : Number(item.revenue_ytd_mb)
let revenueYtdPersenMB = 0
if (revenueYtdMB < 0) {
if (revenueYtdAct >= revenueYtdMB) {
revenueYtdPersenMB = ( revenueYtdMB - revenueYtdAct ) / revenueYtdMB + 1
} else {
revenueYtdPersenMB = ( revenueYtdMB - revenueYtdAct ) / revenueYtdMB
}
} else {
revenueYtdPersenMB = revenueYtdAct / revenueYtdMB
}
// revenue ytd last year
let revenueYtdLY = item.revenue_ytd_last_year == '' ? 0 : Number(item.revenue_ytd_last_year)
let revenueYtdPersenLY = 0
if (revenueYtdLY < 0) {
if (revenueYtdAct >= revenueYtdLY) {
revenueYtdPersenLY = ( revenueYtdLY - revenueYtdAct ) / revenueYtdLY + 1
} else {
revenueYtdPersenLY = ( revenueYtdLY - revenueYtdAct ) / revenueYtdLY
}
} else {
revenueYtdPersenLY = revenueYtdAct / revenueYtdLY
}
// revenue fy
let revenueFyOl = item.revenue_fy_ol == '' ? 0 : Number(item.revenue_fy_ol)
let revenueFyMB = item.revenue_fy_mb == '' ? 0 : Number(item.revenue_fy_mb)
let revenueFyPersenMB = 0
if (revenueFyMB < 0) {
if (revenueFyOl >= revenueFyMB) {
revenueFyPersenMB = ( revenueFyMB - revenueFyOl ) / revenueFyMB + 1
} else {
revenueFyPersenMB = ( revenueFyMB - revenueFyOl ) / revenueFyMB
}
} else {
revenueFyPersenMB = revenueFyOl / revenueFyMB
}
// revenue fy last year
let revenueFyLY = item.revenue_fy_last_year == '' ? 0 : Number(item.revenue_fy_last_year)
let revenueFyPersenLY = 0
if (revenueFyLY < 0) {
if (revenueFyOl >= revenueFyLY) {
revenueFyPersenLY = ( revenueFyLY - revenueFyOl ) / revenueFyLY + 1
} else {
revenueFyPersenLY = ( revenueFyLY - revenueFyOl ) / revenueFyLY
}
} else {
revenueFyPersenLY = revenueFyOl / revenueFyLY
}
// ebitda ytd
let ebitdaYtdAct = item.ebitda_ytd_act == '' ? 0 : Number(item.ebitda_ytd_act)
let ebitdaYtdMB = item.ebitda_ytd_mb == '' ? 0 : Number(item.ebitda_ytd_mb)
let ebitdaYtdPersenMB = 0
if (ebitdaYtdMB < 0) {
if (ebitdaYtdAct >= ebitdaYtdMB) {
ebitdaYtdPersenMB = ( ebitdaYtdMB - ebitdaYtdAct ) / ebitdaYtdMB + 1
} else {
ebitdaYtdPersenMB = ( ebitdaYtdMB - ebitdaYtdAct ) / ebitdaYtdMB
}
} else {
ebitdaYtdPersenMB = ebitdaYtdAct / ebitdaYtdMB
}
// ebitda ytd last year
let ebitdaYtdLY = item.ebitda_ytd_last_year == '' ? 0 : Number(item.ebitda_ytd_last_year)
let ebitdaYtdPersenLY = 0
if (ebitdaYtdLY < 0) {
if (ebitdaYtdAct >= ebitdaYtdLY) {
ebitdaYtdPersenLY = ( ebitdaYtdLY - ebitdaYtdAct ) / ebitdaYtdLY + 1
} else {
ebitdaYtdPersenLY = ( ebitdaYtdLY - ebitdaYtdAct ) / ebitdaYtdLY
}
} else {
ebitdaYtdPersenLY = ebitdaYtdAct / ebitdaYtdLY
}
// ebitda fy
let ebitdaFyOl = item.ebitda_fy_ol == '' ? 0 : Number(item.ebitda_fy_ol)
let ebitdaFyMB = item.ebitda_fy_mb == '' ? 0 : Number(item.ebitda_fy_mb)
let ebitdaFyPersenMB = 0
if (ebitdaFyMB < 0) {
if (ebitdaFyOl >= ebitdaFyMB) {
ebitdaFyPersenMB = ( ebitdaFyMB - ebitdaFyOl ) / ebitdaFyMB + 1
} else {
ebitdaFyPersenMB = ( ebitdaFyMB - ebitdaFyOl ) / ebitdaFyMB
}
} else {
ebitdaFyPersenMB = ebitdaFyOl / ebitdaFyMB
}
// ebitda fy last year
let ebitdaFyLY = item.ebitda_fy_last_year == '' ? 0 : Number(item.ebitda_fy_last_year)
let ebitdaFyPersenLY = 0
if (ebitdaFyLY < 0) {
if (ebitdaFyOl >= ebitdaFyLY) {
ebitdaFyPersenLY = ( ebitdaFyLY - ebitdaFyOl ) / ebitdaFyLY + 1
} else {
ebitdaFyPersenLY = ( ebitdaFyLY - ebitdaFyOl ) / ebitdaFyLY
}
} else {
ebitdaFyPersenLY = ebitdaFyOl / ebitdaFyLY
}
// tpat ytd
let tpatYtdAct = item.tpat_ytd_act == '' ? 0 : Number(item.tpat_ytd_act)
let tpatYtdMB = item.tpat_ytd_mb == '' ? 0 : Number(item.tpat_ytd_mb)
let tpatYtdPersenMB = 0
if (tpatYtdMB < 0) {
if (tpatYtdAct >= tpatYtdMB) {
tpatYtdPersenMB = ( tpatYtdMB - tpatYtdAct ) / tpatYtdMB + 1
} else {
tpatYtdPersenMB = ( tpatYtdMB - tpatYtdAct ) / tpatYtdMB
}
} else {
tpatYtdPersenMB = tpatYtdAct / tpatYtdMB
}
// tpat ytd last year
let tpatYtdLY = item.tpat_ytd_last_year == '' ? 0 : Number(item.tpat_ytd_last_year)
let tpatYtdPersenLY = 0
if (tpatYtdLY < 0) {
if (tpatYtdAct >= tpatYtdLY) {
tpatYtdPersenLY = ( tpatYtdLY - tpatYtdAct ) / tpatYtdLY + 1
} else {
tpatYtdPersenLY = ( tpatYtdLY - tpatYtdAct ) / tpatYtdLY
}
} else {
tpatYtdPersenLY = tpatYtdAct / tpatYtdLY
}
// tpat fy
let tpatFyOl = item.tpat_fy_ol == '' ? 0 : Number(item.tpat_fy_ol)
let tpatFyMB = item.tpat_fy_mb == '' ? 0 : Number(item.tpat_fy_mb)
let tpatFyPersenMB = 0
if (tpatFyMB < 0) {
if (tpatFyOl >= tpatFyMB) {
tpatFyPersenMB = ( tpatFyMB - tpatFyOl ) / tpatFyMB + 1
} else {
tpatFyPersenMB = ( tpatFyMB - tpatFyOl ) / tpatFyMB
}
} else {
tpatFyPersenMB = tpatFyOl / tpatFyMB
}
// tpat fy last year
let tpatFyLY = item.tpat_fy_last_year == '' ? 0 : Number(item.tpat_fy_last_year)
let tpatFyPersenLY = 0
if (tpatFyLY < 0) {
if (tpatFyOl >= tpatFyLY) {
tpatFyPersenLY = ( tpatFyLY - tpatFyOl ) / tpatFyLY + 1
} else {
tpatFyPersenLY = ( tpatFyLY - tpatFyOl ) / tpatFyLY
}
} else {
tpatFyPersenLY = tpatFyOl / tpatFyLY
}
// npat ytd
let npatYtdAct = item.npat_ytd_act == '' ? 0 : Number(item.npat_ytd_act)
let npatYtdMB = item.npat_ytd_mb == '' ? 0 : Number(item.npat_ytd_mb)
let npatYtdPersenMB = 0
if (npatYtdMB < 0) {
if (npatYtdAct >= npatYtdMB) {
npatYtdPersenMB = ( npatYtdMB - npatYtdAct ) / npatYtdMB + 1
} else {
npatYtdPersenMB = ( npatYtdMB - npatYtdAct ) / npatYtdMB
}
} else {
npatYtdPersenMB = npatYtdAct / npatYtdMB
}
// npat ytd last year
let npatYtdLY = item.npat_ytd_last_year == '' ? 0 : Number(item.npat_ytd_last_year)
let npatYtdPersenLY = 0
if (npatYtdLY < 0) {
if (npatYtdAct >= npatYtdLY) {
npatYtdPersenLY = ( npatYtdLY - npatYtdAct ) / npatYtdLY + 1
} else {
npatYtdPersenLY = ( npatYtdLY - npatYtdAct ) / npatYtdLY
}
} else {
npatYtdPersenLY = npatYtdAct / npatYtdLY
}
// npat fy
let npatFyOl = item.npat_fy_ol == '' ? 0 : Number(item.npat_fy_ol)
let npatFyMB = item.npat_fy_mb == '' ? 0 : Number(item.npat_fy_mb)
let npatFyPersenMB = 0
if (npatFyMB < 0) {
if (npatFyOl >= npatFyMB) {
npatFyPersenMB = ( npatFyMB - npatFyOl ) / npatFyMB + 1
} else {
npatFyPersenMB = ( npatFyMB - npatFyOl ) / npatFyMB
}
} else {
npatFyPersenMB = npatFyOl / npatFyMB
}
// npat fy last year
let npatFyLY = item.npat_fy_last_year == '' ? 0 : Number(item.npat_fy_last_year)
let npatFyPersenLY = 0
if (npatFyLY < 0) {
if (npatFyOl >= npatFyLY) {
npatFyPersenLY = ( npatFyLY - npatFyOl ) / npatFyLY + 1
} else {
npatFyPersenLY = ( npatFyLY - npatFyOl ) / npatFyLY
}
} else {
npatFyPersenLY = npatFyOl / npatFyLY
}
dataTable.push([ dataTable.push([
item.company_id, item.company_id,
item.parent, item.parent,
...@@ -605,44 +1029,60 @@ export default class SummaryOfTriputra extends Component { ...@@ -605,44 +1029,60 @@ export default class SummaryOfTriputra extends Component {
item.company_name, item.company_name,
item.revenue_ytd_act, item.revenue_ytd_act,
item.revenue_ytd_mb, item.revenue_ytd_mb,
item.revenue_ytd_percent_of_mb, // item.revenue_ytd_percent_of_mb,
isNaN(revenueYtdPersenMB) || revenueYtdPersenMB == 'Infinity' || revenueYtdPersenMB == '-Infinity' ? ( item.revenue_ytd_mb == '' || item.revenue_ytd_mb == 0 ? -0 : 0 ) : ( item.revenue_ytd_mb == '' || item.revenue_ytd_mb == 0 ? Number(revenueYtdPersenMB) * Number(-100) : Number(revenueYtdPersenMB) * Number(100) ),
item.revenue_ytd_last_year, item.revenue_ytd_last_year,
item.revenue_ytd_percent_of_last_year, // item.revenue_ytd_percent_of_last_year,
isNaN(revenueYtdPersenLY) || revenueYtdPersenLY == 'Infinity' || revenueYtdPersenLY == '-Infinity' ? ( item.revenue_ytd_last_year == '' || item.revenue_ytd_last_year == 0 ? -0 : 0 ) : ( item.revenue_ytd_last_year == '' || item.revenue_ytd_last_year == 0 ? Number(revenueYtdPersenLY) * Number(-100) : Number(revenueYtdPersenLY) * Number(100) ),
item.revenue_fy_ol, item.revenue_fy_ol,
item.revenue_fy_mb, item.revenue_fy_mb,
item.revenue_fy_percent_of_mb, // item.revenue_fy_percent_of_mb,
isNaN(revenueFyPersenMB) || revenueFyPersenMB == 'Infinity' || revenueFyPersenMB == '-Infinity' ? ( item.revenue_fy_mb == '' || item.revenue_fy_mb == 0 ? -0 : 0 ) : ( item.revenue_fy_mb == '' || item.revenue_fy_mb == 0 ? Number(revenueFyPersenMB) * Number(-100) : Number(revenueFyPersenMB) * Number(100) ),
item.revenue_fy_last_year, item.revenue_fy_last_year,
item.revenue_fy_percent_of_last_year, // item.revenue_fy_percent_of_last_year,
isNaN(revenueFyPersenLY) || revenueFyPersenLY == 'Infinity' || revenueFyPersenLY == '-Infinity' ? ( item.revenue_fy_last_year == '' || item.revenue_fy_last_year == 0 ? -0 : 0 ) : ( item.revenue_fy_last_year == '' || item.revenue_fy_last_year == 0 ? Number(revenueFyPersenLY) * Number(-100) : Number(revenueFyPersenLY) * Number(100) ),
item.ebitda_ytd_act, item.ebitda_ytd_act,
item.ebitda_ytd_mb, item.ebitda_ytd_mb,
item.ebitda_ytd_percent_of_mb, // item.ebitda_ytd_percent_of_mb,
isNaN(ebitdaYtdPersenMB) || ebitdaYtdPersenMB == 'Infinity' || ebitdaYtdPersenMB == '-Infinity' ? ( item.ebitda_ytd_mb == '' || item.ebitda_ytd_mb == 0 ? -0 : 0 ) : ( item.ebitda_ytd_mb == '' || item.ebitda_ytd_mb == 0 ? Number(ebitdaYtdPersenMB) * Number(-100) : Number(ebitdaYtdPersenMB) * Number(100) ),
item.ebitda_ytd_last_year, item.ebitda_ytd_last_year,
item.ebitda_ytd_percent_of_last_year, // item.ebitda_ytd_percent_of_last_year,
isNaN(ebitdaYtdPersenLY) || ebitdaYtdPersenLY == 'Infinity' || ebitdaYtdPersenLY == '-Infinity' ? ( item.ebitda_ytd_last_year == '' || item.ebitda_ytd_last_year == 0 ? -0 : 0 ) : ( item.ebitda_ytd_last_year == '' || item.ebitda_ytd_last_year == 0 ? Number(ebitdaYtdPersenLY) * Number(-100) : Number(ebitdaYtdPersenLY) * Number(100) ),
item.ebitda_fy_ol, item.ebitda_fy_ol,
item.ebitda_fy_mb, item.ebitda_fy_mb,
item.ebitda_fy_percent_of_mb, // item.ebitda_fy_percent_of_mb,
isNaN(ebitdaFyPersenMB) || ebitdaFyPersenMB == 'Infinity' || ebitdaFyPersenMB == '-Infinity' ? ( item.ebitda_fy_mb == '' || item.ebitda_fy_mb == 0 ? -0 : 0 ) : ( item.ebitda_fy_mb == '' || item.ebitda_fy_mb == 0 ? Number(ebitdaFyPersenMB) * Number(-100) : Number(ebitdaFyPersenMB) * Number(100) ),
item.ebitda_fy_last_year, item.ebitda_fy_last_year,
item.ebitda_fy_percent_of_last_year, // item.ebitda_fy_percent_of_last_year,
isNaN(ebitdaFyPersenLY) || ebitdaFyPersenLY == 'Infinity' || ebitdaFyPersenLY == '-Infinity' ? ( item.ebitda_fy_last_year == '' || item.ebitda_fy_last_year == 0 ? -0 : 0 ) : ( item.ebitda_fy_last_year == '' || item.ebitda_fy_last_year == 0 ? Number(ebitdaFyPersenLY) * Number(-100) : Number(ebitdaFyPersenLY) * Number(100) ),
item.tpat_ytd_act, item.tpat_ytd_act,
item.tpat_ytd_mb, item.tpat_ytd_mb,
item.tpat_ytd_percent_of_mb, // item.tpat_ytd_percent_of_mb,
isNaN(tpatYtdPersenMB) || tpatYtdPersenMB == 'Infinity' || tpatYtdPersenMB == '-Infinity' ? ( item.tpat_ytd_mb == '' || item.tpat_ytd_mb == 0 ? -0 : 0 ) : ( item.tpat_ytd_mb == '' || item.tpat_ytd_mb == 0 ? Number(tpatYtdPersenMB) * Number(-100) : Number(tpatYtdPersenMB) * Number(100) ),
item.tpat_ytd_last_year, item.tpat_ytd_last_year,
item.tpat_ytd_percent_of_last_year, // item.tpat_ytd_percent_of_last_year,
isNaN(tpatYtdPersenLY) || tpatYtdPersenLY == 'Infinity' || tpatYtdPersenLY == '-Infinity' ? ( item.tpat_ytd_last_year == '' || item.tpat_ytd_last_year == 0 ? -0 : 0 ) : ( item.tpat_ytd_last_year == '' || item.tpat_ytd_last_year == 0 ? Number(tpatYtdPersenLY) * Number(-100) : Number(tpatYtdPersenLY) * Number(100) ),
item.tpat_fy_ol, item.tpat_fy_ol,
item.tpat_fy_mb, item.tpat_fy_mb,
item.tpat_fy_percent_of_mb, // item.tpat_fy_percent_of_mb,
isNaN(tpatFyPersenMB) || tpatFyPersenMB == 'Infinity' || tpatFyPersenMB == '-Infinity' ? ( item.tpat_fy_mb == '' || item.tpat_fy_mb == 0 ? -0 : 0 ) : ( item.tpat_fy_mb == '' || item.tpat_fy_mb == 0 ? Number(tpatFyPersenMB) * Number(-100) : Number(tpatFyPersenMB) * Number(100) ),
item.tpat_fy_last_year, item.tpat_fy_last_year,
item.tpat_fy_percent_of_last_year, // item.tpat_fy_percent_of_last_year,
isNaN(tpatFyPersenLY) || tpatFyPersenLY == 'Infinity' || tpatFyPersenLY == '-Infinity' ? ( item.tpat_fy_last_year == '' || item.tpat_fy_last_year == 0 ? -0 : 0 ) : ( item.tpat_fy_last_year == '' || item.tpat_fy_last_year == 0 ? Number(tpatFyPersenLY) * Number(-100) : Number(tpatFyPersenLY) * Number(100) ),
item.npat_ytd_act, item.npat_ytd_act,
item.npat_ytd_mb, item.npat_ytd_mb,
item.npat_ytd_percent_of_mb, // item.npat_ytd_percent_of_mb,
isNaN(npatYtdPersenMB) || npatYtdPersenMB == 'Infinity' || npatYtdPersenMB == '-Infinity' ? ( item.npat_ytd_mb == '' || item.npat_ytd_mb == 0 ? -0 : 0 ) : ( item.npat_ytd_mb == '' || item.npat_ytd_mb == 0 ? Number(npatYtdPersenMB) * Number(-100) : Number(npatYtdPersenMB) * Number(100) ),
item.npat_ytd_last_year, item.npat_ytd_last_year,
item.npat_ytd_percent_of_last_year, // item.npat_ytd_percent_of_last_year,
isNaN(npatYtdPersenLY) || npatYtdPersenLY == 'Infinity' || npatYtdPersenLY == '-Infinity' ? ( item.npat_ytd_last_year == '' || item.npat_ytd_last_year == 0 ? -0 : 0 ) : ( item.npat_ytd_last_year == '' || item.npat_ytd_last_year == 0 ? Number(npatYtdPersenLY) * Number(-100) : Number(npatYtdPersenLY) * Number(100) ),
item.npat_fy_ol, item.npat_fy_ol,
item.npat_fy_mb, item.npat_fy_mb,
item.npat_fy_percent_of_mb, // item.npat_fy_percent_of_mb,
isNaN(npatFyPersenMB) || npatFyPersenMB == 'Infinity' || npatFyPersenMB == '-Infinity' ? ( item.npat_fy_mb == '' || item.npat_fy_mb == 0 ? -0 : 0 ) : ( item.npat_fy_mb == '' || item.npat_fy_mb == 0 ? Number(npatFyPersenMB) * Number(-100) : Number(npatFyPersenMB) * Number(100) ),
item.npat_fy_last_year, item.npat_fy_last_year,
item.npat_fy_percent_of_last_year, // item.npat_fy_percent_of_last_year,
isNaN(npatFyPersenLY) || npatFyPersenLY == 'Infinity' || npatFyPersenLY == '-Infinity' ? ( item.tpat_fy_last_year == '' || item.tpat_fy_last_year == 0 ? -0 : 0 ) : ( item.tpat_fy_last_year == '' || item.tpat_fy_last_year == 0 ? Number(npatFyPersenLY) * Number(-100) : Number(npatFyPersenLY) * Number(100) ),
item.order, item.order,
]) ])
if (item.children !== null) { if (item.children !== null) {
...@@ -751,87 +1191,179 @@ export default class SummaryOfTriputra extends Component { ...@@ -751,87 +1191,179 @@ export default class SummaryOfTriputra extends Component {
console.log(newPayload); console.log(newPayload);
console.log(response); console.log(response);
let dataTable = [] let dataTable = []
// if (response.data) { if (response.data) {
// let res = response.data.data let res = response.data.data
// const handlePushChild = (item) => { const handlePushChild = (item) => {
// let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) let indexIDzz = dataTable.findIndex((val) => val[0] === item.company_id)
// if (indexIDzz === -1) { if (indexIDzz === -1) {
// dataTable.push([ dataTable.push([
// item.type_report_id, item.company_id,
// item.id, item.parent,
// item.parent, item.level,
// item.formula, item.company_name,
// item.level, item.revenue_one,
// item.description, item.revenue_two,
// item.ratio.total_actual_before === null ? "0.0" : item.ratio.total_actual_before === "" ? "0.0" : item.ratio.total_actual_before, item.revenue_three,
// Number(item.ratio.january).toFixed(1), item.revenue_four,
// Number(item.ratio.february).toFixed(1), item.revenue_five,
// Number(item.ratio.march).toFixed(1), item.revenue_six,
// Number(item.ratio.april).toFixed(1), item.revenue_seven,
// Number(item.ratio.may).toFixed(1), item.revenue_eight,
// Number(item.ratio.june).toFixed(1), item.revenue_nine,
// Number(item.ratio.july).toFixed(1), item.revenue_ten,
// Number(item.ratio.august).toFixed(1), item.revenue_twelve,
// Number(item.ratio.september).toFixed(1), item.ebitda_one,
// Number(item.ratio.october).toFixed(1), item.ebitda_two,
// Number(item.ratio.november).toFixed(1), item.ebitda_three,
// Number(item.ratio.december).toFixed(1), item.ebitda_four,
// Number(item.ratio.total_current_year).toFixed(1), item.ebitda_five,
// Number(item.ratio.total_next_year).toFixed(1), item.ebitda_six,
// Number(item.ratio.total_more_year).toFixed(1), item.ebitda_seven,
// item.order, item.ebitda_eight,
// item.condition_it_should_be, item.ebitda_nine,
// item.condition_if_wrong item.ebitda_ten,
// ]) item.ebitda_twelve,
// } item.tpat_one,
// if (item.children !== null) { item.tpat_two,
// if (item.children.length > 0) { item.tpat_three,
// item.children.map((items, indexs) => { item.tpat_four,
// handlePushChild(items) item.tpat_five,
// }) item.tpat_six,
// } item.tpat_seven,
// } item.tpat_eight,
// } item.tpat_nine,
// res.map((item, index) => { item.tpat_ten,
// dataTable.push([ item.tpat_twelve,
// item.type_report_id, item.npat_one,
// item.id, item.npat_two,
// item.parent, item.npat_three,
// item.formula, item.npat_four,
// item.level, item.npat_five,
// item.description, item.npat_six,
// item.ratio.total_actual_before === null ? "0.0" : item.ratio.total_actual_before === "" ? "0.0" : item.ratio.total_actual_before, item.npat_seven,
// Number(item.ratio.january).toFixed(1), item.npat_eight,
// Number(item.ratio.february).toFixed(1), item.npat_nine,
// Number(item.ratio.march).toFixed(1), item.npat_ten,
// Number(item.ratio.april).toFixed(1), item.npat_twelve,
// Number(item.ratio.may).toFixed(1), item.total_asset_one,
// Number(item.ratio.june).toFixed(1), item.total_asset_two,
// Number(item.ratio.july).toFixed(1), item.total_asset_three,
// Number(item.ratio.august).toFixed(1), item.total_asset_four,
// Number(item.ratio.september).toFixed(1), item.total_asset_five,
// Number(item.ratio.october).toFixed(1), item.total_asset_six,
// Number(item.ratio.november).toFixed(1), item.total_asset_seven,
// Number(item.ratio.december).toFixed(1), item.total_asset_eight,
// Number(item.ratio.total_current_year).toFixed(1), item.total_asset_nine,
// Number(item.ratio.total_next_year).toFixed(1), item.total_asset_ten,
// Number(item.ratio.total_more_year).toFixed(1), item.total_asset_twelve,
// item.order, item.total_equity_one,
// item.condition_it_should_be, item.total_equity_two,
// item.condition_if_wrong item.total_equity_three,
// ]) item.total_equity_four,
// if (item.children !== null) { item.total_equity_five,
// if (item.children.length > 0) { item.total_equity_six,
// item.children.map((items, indexs) => { item.total_equity_seven,
// handlePushChild(items) item.total_equity_eight,
// }) item.total_equity_nine,
// } item.total_equity_ten,
// } item.total_equity_twelve,
// }) 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,
item.parent,
item.level,
item.company_name,
item.revenue_one,
item.revenue_two,
item.revenue_three,
item.revenue_four,
item.revenue_five,
item.revenue_six,
item.revenue_seven,
item.revenue_eight,
item.revenue_nine,
item.revenue_ten,
item.revenue_twelve,
item.ebitda_one,
item.ebitda_two,
item.ebitda_three,
item.ebitda_four,
item.ebitda_five,
item.ebitda_six,
item.ebitda_seven,
item.ebitda_eight,
item.ebitda_nine,
item.ebitda_ten,
item.ebitda_twelve,
item.tpat_one,
item.tpat_two,
item.tpat_three,
item.tpat_four,
item.tpat_five,
item.tpat_six,
item.tpat_seven,
item.tpat_eight,
item.tpat_nine,
item.tpat_ten,
item.tpat_twelve,
item.npat_one,
item.npat_two,
item.npat_three,
item.npat_four,
item.npat_five,
item.npat_six,
item.npat_seven,
item.npat_eight,
item.npat_nine,
item.npat_ten,
item.npat_twelve,
item.total_asset_one,
item.total_asset_two,
item.total_asset_three,
item.total_asset_four,
item.total_asset_five,
item.total_asset_six,
item.total_asset_seven,
item.total_asset_eight,
item.total_asset_nine,
item.total_asset_ten,
item.total_asset_twelve,
item.total_equity_one,
item.total_equity_two,
item.total_equity_three,
item.total_equity_four,
item.total_equity_five,
item.total_equity_six,
item.total_equity_seven,
item.total_equity_eight,
item.total_equity_nine,
item.total_equity_ten,
item.total_equity_twelve,
item.order,
])
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, previewTable: true, loading: false, previewDownload: true })
// } else { } else {
// this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false }) this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
// } }
}) })
} }
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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