Commit c3674eeb authored by Faisal Hamdi's avatar Faisal Hamdi

Merge branch 'faisal' into 'master'

Faisal

See merge request !1443
parents 5a6e4c01 c67cd0ec
......@@ -2883,7 +2883,7 @@ export default class SubHolding extends Component {
})
} else if (this.state.report.value === 11) {
let dbCATPQ = [];
let payloadCATPQ = {...payload, report_id: 17, quarter: this.state.quarter.name}
let payloadCATPQ = {...payload, report_id: 10, quarter: this.state.quarter.name}
api.create().getReportCATPQ(payloadCATPQ).then(response => {
console.log(payloadCATPQ);
console.log(response);
......@@ -3016,54 +3016,6 @@ export default class SubHolding extends Component {
let parentTrue = item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || item.parent_name == 'CUSTOMER PERSPECTIVE'
let weight = String(item.corporate_annual_target.weight).substr(0, String(item.corporate_annual_target.weight).length - 1)
// let achivementYtd = 0
// if (item.formula_ytd == 'HIB') {
// let actual = item.corporate_annual_target.actual_ytd == "" ? 0 : Number(item.corporate_annual_target.actual_ytd)
// let target = item.corporate_annual_target.target_ytd == "" ? 0 : Number(item.corporate_annual_target.target_ytd)
// if (target < 0) {
// if (actual > target) {
// achivementYtd = (actual / target) - 1
// } else {
// achivementYtd = (actual / target)
// }
// } else if (target == 0) {
// if (target >= actual) {
// achivementYtd = 1.26
// } else {
// achivementYtd = 0
// }
// } else {
// if (actual == target) {
// achivementYtd = (actual / target)
// } else {
// achivementYtd = 2 - (actual / target)
// }
// }
// } else {
// let actual = item.corporate_annual_target.actual_ytd == "" ? 0 : Number(item.corporate_annual_target.actual_ytd)
// let target = item.corporate_annual_target.target_ytd == "" ? 0 : Number(item.corporate_annual_target.target_ytd)
// if (target < 0) {
// if (actual >= target) {
// achivementYtd = ((target - actual) / target) + 1
// } else {
// achivementYtd = (target - actual) / target
// }
// } else if (target == 0) {
// if (target <= actual) {
// achivementYtd = 1.26
// } else {
// achivementYtd = 0
// }
// } else {
// // if (actual <= target) {
// achivementYtd = (actual / target)
// // } else {
// // achivementYtd = 1 - (actual / target)
// // }
// }
// }
// total = String(total) == 'NaN' || String(total) == 'Infinity' || String(total) == '-Infinity' ? 0 : total
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total) * 100
dbCATPA.push([
item.type_report_id,
item.id,
......@@ -3072,19 +3024,13 @@ export default class SubHolding extends Component {
item.level,
item.description,
item.corporate_annual_target.weight == "" ? Number(0).toFixed(1) : Number(weight).toFixed(1),
// item.uom,
// item.kpi_type,
// item.max_ach,
// item.formula_ytd,
parentTrue ? item.corporate_annual_target.uom : item.uom,
parentTrue ? item.corporate_annual_target.jenis_kpi == "" ? null : item.corporate_annual_target.jenis_kpi : item.jenis_kpi == "" ? null : item.kpi_type,
parentTrue ? item.corporate_annual_target.max_ach == "" ? null : titleCase(item.corporate_annual_target.max_ach) : item.max_ach == "" ? null : titleCase(item.max_ach),
item.corporate_annual_target.formula_ytd == "" ? null : item.corporate_annual_target.formula_ytd,
item.corporate_annual_target.actual_ytd,
item.corporate_annual_target.target_ytd,
item.corporate_annual_target.achivement_ytd,
// isNaN(achivementYtd) || achivementYtd == 'Infinity' || achivementYtd == '-Infinity'? 0 : (Number(achivementYtd) * 100),
item.corporate_annual_target.score,
item.corporate_annual_target.score_x_weight,
item.order
......@@ -3931,7 +3877,7 @@ export default class SubHolding extends Component {
}
} else if (this.state.report.value === 11) {
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cat/quarterly/export_report?report_id=17&&company_id=${this.state.company.company_id}&&periode=${this.state.periode.periode}&&quarter=${this.state.quarter.name}`
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cat/quarterly/export_report?report_id=10&&company_id=${this.state.company.company_id}&&periode=${this.state.periode.periode}&&quarter=${this.state.quarter.name}`
)
console.log(res);
res = await res.blob()
......
......@@ -25045,7 +25045,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
value={Number(value).toFixed(2)}
/>
}
/>
......@@ -25280,7 +25280,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
value={Number(value).toFixed(2)}
/>
}
/>
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