Commit 2b305a40 authored by Faisal Hamdi's avatar Faisal Hamdi

Merge branch 'faisal' into 'master'

CAT PQ

See merge request !1420
parents c214903c 7f36e829
...@@ -28,16 +28,16 @@ export default class SubHolding extends Component { ...@@ -28,16 +28,16 @@ export default class SubHolding extends Component {
listPeriode: null, listPeriode: null,
periode: null, periode: null,
reportType: [ reportType: [
{ value: 2, label: 'DB Balance Sheet' }, // { value: 2, label: 'DB Balance Sheet' },
{ value: 3, label: 'DB Profit & Loss' }, // { value: 3, label: 'DB Profit & Loss' },
{ value: 1, label: 'DB Profit & Loss Detail' }, // { value: 1, label: 'DB Profit & Loss Detail' },
{ value: 4, label: 'DB Ratio' }, // { value: 4, label: 'DB Ratio' },
{ value: 5, label: 'DB Tax Planning' }, // { value: 5, label: 'DB Tax Planning' },
{ value: 21, label: 'DB Operating Indicator' }, // { value: 21, label: 'DB Operating Indicator' },
{ value: 6, label: 'Cash Flow - Summary' }, // { value: 6, label: 'Cash Flow - Summary' },
{ value: 7, label: 'Balance Sheet - Summary' }, // { value: 7, label: 'Balance Sheet - Summary' },
{ value: 8, label: 'Profit Loss - Summary' }, // { value: 8, label: 'Profit Loss - Summary' },
{ value: 9, label: 'Financial Ratio - Summary' }, // { value: 9, label: 'Financial Ratio - Summary' },
{ value: 11, label: 'CAT Performance Quarterly' }, { value: 11, label: 'CAT Performance Quarterly' },
{ value: 10, label: 'CAT Performance Appraisal' }, { value: 10, label: 'CAT Performance Appraisal' },
], ],
...@@ -2895,6 +2895,7 @@ export default class SubHolding extends Component { ...@@ -2895,6 +2895,7 @@ export default class SubHolding extends Component {
if (indexIDzz === -1) { if (indexIDzz === -1) {
let parentTrue = item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || item.parent_name == 'CUSTOMER PERSPECTIVE' 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 weight = String(item.corporate_annual_target.weight).substr(0, String(item.corporate_annual_target.weight).length - 1)
let percentVar = Number(item.corporate_annual_target.thisYearOlFy) / Number(item.corporate_annual_target.thisYearBudgetFy)
dbCATPQ.push([ dbCATPQ.push([
item.typeItemReportId, item.typeItemReportId,
item.itemReportId, item.itemReportId,
...@@ -2903,15 +2904,27 @@ export default class SubHolding extends Component { ...@@ -2903,15 +2904,27 @@ export default class SubHolding extends Component {
item.level, item.level,
item.itemName, item.itemName,
item.corporate_annual_target.weight == "" ? Number(0).toFixed(1) : Number(weight).toFixed(1), item.corporate_annual_target.weight == "" ? Number(0).toFixed(1) : Number(weight).toFixed(1),
item.uom, item.corporate_annual_target.uom,
item.typeKpi,
item.max_ach, item.corporate_annual_target.lastYearActualQx,
item.formula_ytd, item.corporate_annual_target.thisYearPercentGrowthYoy,
item.actual_monthly, item.corporate_annual_target.lastYearActualFy,
item.target_monthly,
item.achivement_monthly, item.corporate_annual_target.thisYearbudgetQx,
item.score, item.corporate_annual_target.thisYearActualQx,
item.score_x_weight, item.corporate_annual_target.thisYearPercentAch,
item.corporate_annual_target.thisYearScore,
item.corporate_annual_target.thisYearScoreXWeight,
item.corporate_annual_target.thisYearBudgetYtd,
item.corporate_annual_target.thisYearActualYtd,
item.corporate_annual_target.thisYearPercentAchYtd,
item.corporate_annual_target.thisYearScoreFy,
item.corporate_annual_target.thisYearScoreXWeightFy,
item.corporate_annual_target.thisYearBudgetFy,
item.corporate_annual_target.thisYearOlFy,
percentVar,
item.order item.order
]) ])
} }
...@@ -2933,14 +2946,26 @@ export default class SubHolding extends Component { ...@@ -2933,14 +2946,26 @@ export default class SubHolding extends Component {
item.itemName, item.itemName,
item.weight == '' ? Number(0).toFixed(1) : Number(Number(item.weight) * 100).toFixed(1), item.weight == '' ? Number(0).toFixed(1) : Number(Number(item.weight) * 100).toFixed(1),
item.uom, item.uom,
item.typeKpi,
item.max_ach, item.corporate_annual_target.lastYearActualQx,
item.formula_ytd, item.corporate_annual_target.thisYearPercentGrowthYoy,
item.actual_monthly, item.corporate_annual_target.lastYearActualFy,
item.target_monthly,
item.achivement_monthly, item.corporate_annual_target.thisYearbudgetQx,
item.score, item.corporate_annual_target.thisYearActualQx,
item.score_x_weight, item.corporate_annual_target.thisYearPercentAch,
item.corporate_annual_target.thisYearScore,
item.corporate_annual_target.thisYearScoreXWeight,
item.corporate_annual_target.thisYearBudgetYtd,
item.corporate_annual_target.thisYearActualYtd,
item.corporate_annual_target.thisYearPercentAchYtd,
item.corporate_annual_target.thisYearScoreFy,
item.corporate_annual_target.thisYearScoreXWeightFy,
item.corporate_annual_target.thisYearBudgetFy,
item.corporate_annual_target.thisYearOlFy,
"",
item.order item.order
]) ])
if (item.children !== null) { if (item.children !== null) {
...@@ -2982,52 +3007,52 @@ export default class SubHolding extends Component { ...@@ -2982,52 +3007,52 @@ export default class SubHolding extends Component {
let parentTrue = item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || item.parent_name == 'CUSTOMER PERSPECTIVE' 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 weight = String(item.corporate_annual_target.weight).substr(0, String(item.corporate_annual_target.weight).length - 1)
let achivementYtd = 0 // let achivementYtd = 0
if (item.formula_ytd == 'HIB') { // if (item.formula_ytd == 'HIB') {
let actual = item.corporate_annual_target.actual_ytd == "" ? 0 : Number(item.corporate_annual_target.actual_ytd) // 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) // let target = item.corporate_annual_target.target_ytd == "" ? 0 : Number(item.corporate_annual_target.target_ytd)
if (target < 0) { // if (target < 0) {
if (actual > target) { // if (actual > target) {
achivementYtd = (actual / target) - 1 // 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 { // } else {
// achivementYtd = 1 - (actual / target) // 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 // total = String(total) == 'NaN' || String(total) == 'Infinity' || String(total) == '-Infinity' ? 0 : total
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total) * 100 // dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total) * 100
dbCATPA.push([ dbCATPA.push([
...@@ -3044,7 +3069,8 @@ export default class SubHolding extends Component { ...@@ -3044,7 +3069,8 @@ export default class SubHolding extends Component {
item.formula_ytd, item.formula_ytd,
item.corporate_annual_target.actual_ytd, item.corporate_annual_target.actual_ytd,
item.corporate_annual_target.target_ytd, item.corporate_annual_target.target_ytd,
isNaN(achivementYtd) || achivementYtd == 'Infinity' || achivementYtd == '-Infinity'? 0 : (Number(achivementYtd) * 100), 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,
item.corporate_annual_target.score_x_weight, item.corporate_annual_target.score_x_weight,
item.order item.order
......
...@@ -1050,39 +1050,6 @@ export default class TableSubHolding extends Component { ...@@ -1050,39 +1050,6 @@ export default class TableSubHolding extends Component {
return total return total
} }
const handleScore = (tableMeta) => {
console.log(tableMeta);
console.log(this.state.parameterScore);
let listParameter = this.state.parameterScore
let parameterKpi = tableMeta.rowData[8]
let parameterAch = String(tableMeta.rowData[9]).includes('%') ? `MAX${String(tableMeta.rowData[9]).substr(0, String(tableMeta.rowData[9]).length - 1)}` : String(tableMeta.rowData[9])
let parameterMix = `${parameterKpi}_${parameterAch}`
let listParameterFilter = listParameter.filter((val) => val.setting_type == String(parameterMix).toLocaleUpperCase() && String(val.company_name).toLocaleLowerCase() === "default")
let listParameterFilterCompany = listParameterFilter.filter((val) => val.company_id == this.props.company.company_id)
let totalScore = 0
let achx100 = tableMeta.rowData[9] == '100%' && (tableMeta.rowData[8] == 'HIB' || tableMeta.rowData[8] == 'HIG') ? Number(tableMeta.rowData[13]) / 100 > 1 ? 1 : Number(tableMeta.rowData[13]) / 100 : Number(tableMeta.rowData[13]) / 100
if (listParameterFilterCompany.length == 0) {
listParameterFilter.map((item, index) => {
if (Number(achx100) >= Number(item.min_value) && Number(achx100) <= Number(item.max_value)) {
totalScore = Number(item.value)
}
})
} else {
listParameterFilterCompany.map((item, index) => {
if (Number(achx100) >= Number(item.min_value) && Number(achx100) <= Number(item.max_value)) {
totalScore = Number(item.value)
}
})
}
if (Number(tableMeta.rowData[12]) == Number(0)) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(0).toFixed(0)
return Number(0).toFixed(0)
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(totalScore).toFixed(0)
return Number(totalScore).toFixed(0)
}
}
const columnDBBS = [{ const columnDBBS = [{
name: "", name: "",
options: { options: {
...@@ -26622,12 +26589,26 @@ export default class TableSubHolding extends Component { ...@@ -26622,12 +26589,26 @@ export default class TableSubHolding extends Component {
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ width: 90, textAlign: 'center' }}> <div style={{ textAlign: 'center' }}>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null : null :
<div> <FormControlLabel
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : value}</span> style={{ margin: 0 }}
</div> value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
suffix={"%"}
value={Number(value).toFixed(1)}
disabled={true}
// disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
decimalScale={1}
/>
}
/>
} }
</div> </div>
) )
...@@ -26656,7 +26637,7 @@ export default class TableSubHolding extends Component { ...@@ -26656,7 +26637,7 @@ export default class TableSubHolding extends Component {
} }
} }
},{ },{
name: "2020", name: `${Number(this.props.periode) - 1}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', top: 0, zIndex: 102, fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} > <th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', top: 0, zIndex: 102, fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
...@@ -26680,9 +26661,7 @@ export default class TableSubHolding extends Component { ...@@ -26680,9 +26661,7 @@ export default class TableSubHolding extends Component {
<div> <div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
<div className="col-1"> <div className="col-1">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -26695,7 +26674,7 @@ export default class TableSubHolding extends Component { ...@@ -26695,7 +26674,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[3]).toFixed(2)} value={Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -26703,9 +26682,7 @@ export default class TableSubHolding extends Component { ...@@ -26703,9 +26682,7 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-2"> <div className="col-2">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -26719,7 +26696,7 @@ export default class TableSubHolding extends Component { ...@@ -26719,7 +26696,7 @@ export default class TableSubHolding extends Component {
placeholder="" placeholder=""
suffix={'%'} suffix={'%'}
disabled={true} disabled={true}
value={Number(tableMeta.rowData[4]).toFixed(2)} value={Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -26727,9 +26704,7 @@ export default class TableSubHolding extends Component { ...@@ -26727,9 +26704,7 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-3"> <div className="col-3">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -26742,7 +26717,7 @@ export default class TableSubHolding extends Component { ...@@ -26742,7 +26717,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[5]).toFixed(2)} value={Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -26755,7 +26730,7 @@ export default class TableSubHolding extends Component { ...@@ -26755,7 +26730,7 @@ export default class TableSubHolding extends Component {
} }
} }
},{ },{
name: "2021", name: `${Number(this.props.periode)}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', top: 0, zIndex: 102, fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} > <th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', top: 0, zIndex: 102, fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
...@@ -26805,9 +26780,7 @@ export default class TableSubHolding extends Component { ...@@ -26805,9 +26780,7 @@ export default class TableSubHolding extends Component {
<div className="grid grid-2x content-center"> <div className="grid grid-2x content-center">
<div className="grid grid-5x content-center"> <div className="grid grid-5x content-center">
<div className="col-1"> <div className="col-1">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -26820,7 +26793,7 @@ export default class TableSubHolding extends Component { ...@@ -26820,7 +26793,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[6]).toFixed(2)} value={Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -26828,9 +26801,7 @@ export default class TableSubHolding extends Component { ...@@ -26828,9 +26801,7 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-2"> <div className="col-2">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -26843,7 +26814,7 @@ export default class TableSubHolding extends Component { ...@@ -26843,7 +26814,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[7]).toFixed(2)} value={Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -26851,9 +26822,7 @@ export default class TableSubHolding extends Component { ...@@ -26851,9 +26822,7 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-3"> <div className="col-3">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -26865,9 +26834,9 @@ export default class TableSubHolding extends Component { ...@@ -26865,9 +26834,9 @@ export default class TableSubHolding extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
suffix={'%'} suffix={`%`}
disabled={true} disabled={true}
value={Number(tableMeta.rowData[8]).toFixed(2)} value={value}
/> />
} }
/> />
...@@ -26875,9 +26844,7 @@ export default class TableSubHolding extends Component { ...@@ -26875,9 +26844,7 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-4"> <div className="col-4">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -26890,7 +26857,7 @@ export default class TableSubHolding extends Component { ...@@ -26890,7 +26857,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(2)} value={Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -26898,9 +26865,7 @@ export default class TableSubHolding extends Component { ...@@ -26898,9 +26865,7 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-5"> <div className="col-5">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -26913,7 +26878,7 @@ export default class TableSubHolding extends Component { ...@@ -26913,7 +26878,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[10]).toFixed(2)} value={Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -26923,9 +26888,7 @@ export default class TableSubHolding extends Component { ...@@ -26923,9 +26888,7 @@ export default class TableSubHolding extends Component {
</div> </div>
<div className="grid grid-5x content-center"> <div className="grid grid-5x content-center">
<div className="col-1"> <div className="col-1">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -26938,7 +26901,7 @@ export default class TableSubHolding extends Component { ...@@ -26938,7 +26901,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[11]).toFixed(2)} value={Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -26946,9 +26909,7 @@ export default class TableSubHolding extends Component { ...@@ -26946,9 +26909,7 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-2"> <div className="col-2">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -26961,7 +26922,7 @@ export default class TableSubHolding extends Component { ...@@ -26961,7 +26922,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[12]).toFixed(2)} value={Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -26969,9 +26930,7 @@ export default class TableSubHolding extends Component { ...@@ -26969,9 +26930,7 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-3"> <div className="col-3">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -26983,9 +26942,8 @@ export default class TableSubHolding extends Component { ...@@ -26983,9 +26942,8 @@ export default class TableSubHolding extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
suffix={'%'}
disabled={true} disabled={true}
value={Number(tableMeta.rowData[13]).toFixed(2)} value={Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -26993,9 +26951,7 @@ export default class TableSubHolding extends Component { ...@@ -26993,9 +26951,7 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-4"> <div className="col-4">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -27008,7 +26964,7 @@ export default class TableSubHolding extends Component { ...@@ -27008,7 +26964,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[14]).toFixed(2)} value={Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -27016,9 +26972,7 @@ export default class TableSubHolding extends Component { ...@@ -27016,9 +26972,7 @@ export default class TableSubHolding extends Component {
} }
</div> </div>
<div className="col-5"> <div className="col-5">
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -27031,7 +26985,7 @@ export default class TableSubHolding extends Component { ...@@ -27031,7 +26985,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[15]).toFixed(2)} value={Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -27045,7 +26999,7 @@ export default class TableSubHolding extends Component { ...@@ -27045,7 +26999,7 @@ export default class TableSubHolding extends Component {
} }
} }
}, { }, {
name: `Master Budget 2021`, name: `Master Budget ${Number(this.props.periode)}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: 'rgb(200 224 229)', borderRight: '1px solid #fff', borderLeft: '1px solid #fff' }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: 'rgb(200 224 229)', borderRight: '1px solid #fff', borderLeft: '1px solid #fff' }}>
...@@ -27056,9 +27010,7 @@ export default class TableSubHolding extends Component { ...@@ -27056,9 +27010,7 @@ export default class TableSubHolding extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ width: 90, textAlign: 'center' }}> <div style={{ width: 90, textAlign: 'center' }}>
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -27071,7 +27023,7 @@ export default class TableSubHolding extends Component { ...@@ -27071,7 +27023,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[16]).toFixed(2)} value={Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -27082,7 +27034,7 @@ export default class TableSubHolding extends Component { ...@@ -27082,7 +27034,7 @@ export default class TableSubHolding extends Component {
} }
} }
}, { }, {
name: `OL 2021`, name: `OL ${Number(this.props.periode)}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: 'rgb(200 224 229)', borderRight: '1px solid #fff', borderLeft: '1px solid #fff' }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: 'rgb(200 224 229)', borderRight: '1px solid #fff', borderLeft: '1px solid #fff' }}>
...@@ -27093,9 +27045,7 @@ export default class TableSubHolding extends Component { ...@@ -27093,9 +27045,7 @@ export default class TableSubHolding extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ width: 90, textAlign: 'center' }}> <div style={{ width: 90, textAlign: 'center' }}>
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -27108,7 +27058,7 @@ export default class TableSubHolding extends Component { ...@@ -27108,7 +27058,7 @@ export default class TableSubHolding extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[17]).toFixed(2)} value={Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -27130,9 +27080,7 @@ export default class TableSubHolding extends Component { ...@@ -27130,9 +27080,7 @@ export default class TableSubHolding extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ width: 90, textAlign: 'center' }}> <div style={{ width: 90, textAlign: 'center' }}>
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -27144,9 +27092,9 @@ export default class TableSubHolding extends Component { ...@@ -27144,9 +27092,9 @@ export default class TableSubHolding extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
suffix={'%'} suffix={`%`}
disabled={true} disabled={true}
value={Number(tableMeta.rowData[18]).toFixed(2)} value={Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -27380,7 +27328,7 @@ export default class TableSubHolding extends Component { ...@@ -27380,7 +27328,7 @@ export default class TableSubHolding extends Component {
} }
} }
}, { }, {
name: `Actual 2021`, name: `Actual ${Number(this.props.periode)}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 75, borderLeft: '1px #fff solid' }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 75, borderLeft: '1px #fff solid' }}>
...@@ -27412,7 +27360,7 @@ export default class TableSubHolding extends Component { ...@@ -27412,7 +27360,7 @@ export default class TableSubHolding extends Component {
} }
} }
}, { }, {
name: `Target 2021`, name: `Target ${Number(this.props.periode)}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: 'rgb(200 224 229)', width: 75, borderLeft: '1px #fff solid' }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: 'rgb(200 224 229)', width: 75, borderLeft: '1px #fff solid' }}>
...@@ -27444,7 +27392,7 @@ export default class TableSubHolding extends Component { ...@@ -27444,7 +27392,7 @@ export default class TableSubHolding extends Component {
} }
} }
}, { }, {
name: `Achivement 2021 (%)`, name: `Achivement ${Number(this.props.periode)} (%)`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 75, borderLeft: '1px #fff solid' }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 75, borderLeft: '1px #fff solid' }}>
...@@ -27491,22 +27439,15 @@ export default class TableSubHolding extends Component { ...@@ -27491,22 +27439,15 @@ export default class TableSubHolding extends Component {
null : null :
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={Number(value).toFixed(0)} value={Number(value).toFixed(1)}
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={handleScore(tableMeta)} value={Number(value).toFixed(1)}
// value={Number(value).toFixed(1)}
decimalScale={0}
disabled={true} disabled={true}
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// // // console.log(dataTable2)
// }}
/> />
} }
/> />
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