Commit 3209b81a authored by Riri Novita's avatar Riri Novita

lagi

parent 207cdaa4
...@@ -1285,20 +1285,20 @@ export default class SubHolding extends Component { ...@@ -1285,20 +1285,20 @@ export default class SubHolding extends Component {
let indexIDzz = dbSumaPL.findIndex((val) => val[1] === item.id) let indexIDzz = dbSumaPL.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) { if (indexIDzz === -1) {
let mtd_actual = item.profit_loss.mtd_actual == ''? 0 : item.profit_loss.mtd_actual let mtd_actual = item.profit_loss.mtd_actual == ''? 0 : item.profit_loss.mtd_actual
let mtd = item.profit_loss.mtd == ''? 0 : item.profit_loss.mtd let mtd_mb = item.profit_loss.mtd_mb == ''? 0 : item.profit_loss.mtd_mb
let persenMtd = Number(mtd_actual/mtd) let persenMtd = Number(mtd_actual/mtd_mb)
let ytd_actual = item.profit_loss.ytd_actual == ''? 0 : item.profit_loss.ytd_actual let ytd_actual = item.profit_loss.ytd_actual == ''? 0 : item.profit_loss.ytd_actual
let ytd = item.profit_loss.ytd == ''? 0 : item.profit_loss.ytd let ytd_mb = item.profit_loss.ytd_mb == ''? 0 : item.profit_loss.ytd_mb
let persenYtd = Number(ytd_actual/ytd) let persenYtd = Number(ytd_actual/ytd_mb)
let quarter_actual = item.profit_loss.quarter_actual == ''? 0 : item.profit_loss.quarter_actual let q1_actual = item.profit_loss.q1_actual == ''? 0 : item.profit_loss.q1_actual
let quarter = item.profit_loss.quarter == ''? 0 : item.profit_loss.quarter let q1_mb = item.profit_loss.q1_mb == ''? 0 : item.profit_loss.q1_mb
let persenQuarter = Number(quarter_actual/quarter) let persenQuarter = Number(q1_actual/q1_mb)
let fy_actual = item.profit_loss.fy_actual == ''? 0 : item.profit_loss.fy_actual let fy_actual = item.profit_loss.fy_actual == ''? 0 : item.profit_loss.fy_actual
let fy = item.profit_loss.fy == ''? 0 : item.profit_loss.fy let fy_mb = item.profit_loss.fy_mb == ''? 0 : item.profit_loss.fy_mb
let persenFy = Number(fy_actual/fy) let persenFy = Number(fy_actual/fy_mb)
dbSumaPL.push([ dbSumaPL.push([
item.id, item.id,
...@@ -1348,20 +1348,20 @@ export default class SubHolding extends Component { ...@@ -1348,20 +1348,20 @@ export default class SubHolding extends Component {
dbSumaPL.push([ dbSumaPL.push([
item.id, item.id,
item.profit_loss.mtd_actual, item.profit_loss.mtd_actual,
item.profit_loss.mtd, item.profit_loss.mtd_mb,
isNaN(persenMtd)? 0 : persenMtd * 100, isNaN(persenMtd) || persenMtd == 'Infinity' || persenMtd == '-Infinity'? (item.profit_loss.mtd == '' || item.profit_loss.mtd == 0? -0 : 0) : (item.profit_loss.mtd == '' || item.profit_loss.mtd == 0? persenMtd * -100 : persenMtd * 100),
item.profit_loss.mtd_last_year, item.profit_loss.mtd_last_year,
item.profit_loss.ytd_actual, item.profit_loss.ytd_actual,
item.profit_loss.ytd, item.profit_loss.ytd,
isNaN(persenYtd)? 0 : persenYtd * 100, isNaN(persenYtd) || persenYtd == 'Infinity' || persenYtd == '-Infinity'? (item.profit_loss.ytd == '' || item.profit_loss.ytd == 0? -0 : 0) : (item.profit_loss.ytd == '' || item.profit_loss.ytd == 0? persenYtd * -100 : persenYtd * 100),
item.profit_loss.ytd_last_year, item.profit_loss.ytd_last_year,
item.profit_loss.quarter_actual, item.profit_loss.quarter_actual,
item.profit_loss.quarter, item.profit_loss.quarter,
isNaN(persenQuarter)? 0 : persenQuarter * 100, isNaN(persenQuarter) || persenQuarter == 'Infinity' || persenQuarter == '-Infinity'? (item.profit_loss.quarter == '' || item.profit_loss.quarter == 0? -0 : 0) : (item.profit_loss.quarter == '' || item.profit_loss.quarter == 0? persenQuarter * -100 : persenQuarter * 100),
item.profit_loss.quarter_last_year, item.profit_loss.quarter_last_year,
item.profit_loss.fy_actual, item.profit_loss.fy_actual,
item.profit_loss.fy, item.profit_loss.fy,
isNaN(persenFy)? 0 : persenFy * 100, isNaN(persenFy) || persenFy == 'Infinity' || persenFy == '-Infinity'? (item.profit_loss.fy == '' || item.profit_loss.fy == 0? -0 : 0) : (item.profit_loss.fy == '' || item.profit_loss.fy == 0? persenFy * -100 : persenFy * 100),
item.profit_loss.fy_last_year, item.profit_loss.fy_last_year,
]) ])
if (item.children !== null) { if (item.children !== null) {
...@@ -1372,6 +1372,7 @@ export default class SubHolding extends Component { ...@@ -1372,6 +1372,7 @@ export default class SubHolding extends Component {
} }
} }
}) })
this.setState({ dataTable: dbSumaPL, loading: false, previewTable: true, previewDownload: true })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
......
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