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

update tambahan mba sab CAT

parent 37f8b5a3
......@@ -639,8 +639,18 @@ export default class CorporateAnnualTargetMR extends Component {
this.setState({ loading: true }, () => {
let total = 0
let perfomanceScore = ''
let totalWeight = 0
let datatable3 = datatable2.map((item, index) => {
// console.log(item[6])
//total weight
if (item[0] !== 1 && item[0] !== 4) {
if (item[12] == '' || String(item[12]) == '0' || String(item[12]) == '0.0') {
totalWeight += Number(0)
} else {
totalWeight += Number(item[6])
}
}
//ach
let totalAch = 0
if (item[8] == 'HIB') {
......@@ -693,7 +703,7 @@ export default class CorporateAnnualTargetMR extends Component {
if (item[12] == '' || String(item[12]) == '0' || String(item[12]) == '0.0') {
totalSW = 0
} else {
totalSW = Number(totalScore) * Number(handlePercent) / 1000
totalSW = (Number(totalScore) * Number(handlePercent) / 1000)
}
totalSW = Number(totalSW).toFixed(2)
if (item[0] !== 1 && item[0] !== 4) {
......@@ -725,10 +735,11 @@ export default class CorporateAnnualTargetMR extends Component {
]
]
})
console.log(totalWeight)
console.log(total)
console.log(datatable3);
total = Number(total).toFixed(2)
totalWeight = Number(totalWeight) / 100
total = Number(Number(total).toFixed(2) / Number(totalWeight)).toFixed(2)
if (total >= 1.00 && total <= 2.00) {
perfomanceScore = 'K'
} else if (total >= 2.01 && total <= 2.75) {
......
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