Commit f8011e9e authored by Riri Novita's avatar Riri Novita

Merge branch 'riri' into 'master'

rumush

See merge request !1072
parents 34686707 78c706a0
......@@ -1435,13 +1435,46 @@ export default class SubHolding extends Component {
if (indexIDzz === -1) {
let mtd_actual = item.profit_loss.mtd_actual == ''? 0 : item.profit_loss.mtd_actual
let mtd_mb = item.profit_loss.mtd_mb == ''? 0 : item.profit_loss.mtd_mb
let persenMtd = Number(mtd_actual/mtd_mb)
let ytd_actual = item.profit_loss.ytd_actual == ''? 0 : item.profit_loss.ytd_actual
let ytd_mb = item.profit_loss.ytd_mb == ''? 0 : item.profit_loss.ytd_mb
let ytd_last_year = item.profit_loss.ytd_last_year == ''? 0 : item.profit_loss.ytd_last_year
let persenYtdMB = Number(ytd_actual/ytd_mb)
let persenYtdLY = Number(ytd_actual/ytd_last_year)
let persenMtd = 0
if (mtd_mb < 0) {
if (mtd_actual >= mtd_mb) {
persenMtd = ((mtd_mb - mtd_actual) / mtd_mb + 1 )
} else {
persenMtd = ((mtd_mb - mtd_actual) / mtd_mb)
}
}
else {
persenMtd = Number(mtd_actual/mtd_mb)
}
let ytd_actual = item.profit_loss.ytd_actual == ''? 0 : Number(item.profit_loss.ytd_actual)
let ytd_mb = item.profit_loss.ytd_mb == ''? 0 : Number(item.profit_loss.ytd_mb)
let ytd_last_year = item.profit_loss.ytd_last_year == ''? 0 : Number(item.profit_loss.ytd_last_year)
let persenYtdMB = 0
if (ytd_mb < 0) {
if (ytd_actual >= ytd_mb) {
persenYtdMB = ((ytd_mb - ytd_actual) / ytd_mb + 1 )
} else {
persenYtdMB = ((ytd_mb - ytd_actual) / ytd_mb)
}
}
else {
persenYtdMB = Number(ytd_actual/ytd_mb)
}
let persenYtdLY = 0
if (ytd_last_year < 0) {
if (ytd_actual >= ytd_last_year) {
persenYtdLY = ((ytd_last_year - ytd_actual) / ytd_last_year + 1 )
} else {
persenYtdLY = (ytd_last_year - ytd_actual) / ytd_last_year
}
}
else {
persenYtdLY = Number(ytd_actual/ytd_last_year)
}
let q1_actual = item.profit_loss.q1_actual == ''? 0 : item.profit_loss.q1_actual
let q1_mb = item.profit_loss.q1_mb == ''? 0 : item.profit_loss.q1_mb
......@@ -1501,9 +1534,20 @@ export default class SubHolding extends Component {
}
}
res.map((item,index) => {
let mtd_actual = item.profit_loss.mtd_actual == ''? 0 : item.profit_loss.mtd_actual
let mtd_mb = item.profit_loss.mtd_mb == ''? 0 : item.profit_loss.mtd_mb
let persenMtd = Number(mtd_actual/mtd_mb)
let mtd_actual = item.profit_loss.mtd_actual == ''? 0 : Number(item.profit_loss.mtd_actual)
let mtd_mb = item.profit_loss.mtd_mb == ''? 0 : Number(item.profit_loss.mtd_mb)
let persenMtd = 0
if (mtd_mb < 0) {
if (mtd_actual >= mtd_mb) {
persenMtd = ((mtd_mb - mtd_actual) / mtd_mb + 1 )
} else {
persenMtd = ((mtd_mb - mtd_actual) / mtd_mb)
}
}
else {
persenMtd = Number(mtd_actual/mtd_mb)
}
let ytd_actual = item.profit_loss.ytd_actual == ''? 0 : item.profit_loss.ytd_actual
let ytd_mb = item.profit_loss.ytd_mb == ''? 0 : item.profit_loss.ytd_mb
......
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