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' },
], ],
...@@ -2894,7 +2894,8 @@ export default class SubHolding extends Component { ...@@ -2894,7 +2894,8 @@ export default class SubHolding extends Component {
let indexIDzz = dbCATPQ.findIndex((val) => val[1] === item.id) let indexIDzz = dbCATPQ.findIndex((val) => val[1] === item.id)
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 { // } else {
achivementYtd = (actual / target) // achivementYtd = (actual / target)
} // }
} else if (target == 0) { // } else if (target == 0) {
if (target >= actual) { // if (target >= actual) {
achivementYtd = 1.26 // achivementYtd = 1.26
} else { // } else {
achivementYtd = 0 // achivementYtd = 0
} // }
} else { // } else {
if (actual == target) { // if (actual == target) {
achivementYtd = (actual / target) // achivementYtd = (actual / target)
} else { // } else {
achivementYtd = 2 - (actual / target) // achivementYtd = 2 - (actual / target)
} // }
} // }
} else { // } else {
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 = ((target - actual) / target) + 1 // achivementYtd = ((target - actual) / target) + 1
} else { // } else {
achivementYtd = (target - actual) / target // achivementYtd = (target - actual) / target
} // }
} else if (target == 0) { // } else if (target == 0) {
if (target <= actual) { // if (target <= actual) {
achivementYtd = 1.26 // achivementYtd = 1.26
} else { // } else {
achivementYtd = 0 // achivementYtd = 0
} // }
} else { // } else {
// if (actual <= target) { // // if (actual <= target) {
achivementYtd = (actual / target) // achivementYtd = (actual / target)
// } else { // // } else {
// achivementYtd = 1 - (actual / target) // // 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,73 +26661,67 @@ export default class TableSubHolding extends Component { ...@@ -26680,73 +26661,67 @@ 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 null :
: tableMeta.rowData[0] === 1 ? <div style={{ flex: 1 }}>
null : <FormControlLabel
<div style={{ flex: 1 }}> style={{ margin: 0 }}
<FormControlLabel value={value}
style={{ margin: 0 }} control={
value={value} <NumberFormat
control={ thousandSeparator={true}
<NumberFormat style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
thousandSeparator={true} type="text"
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} placeholder=""
type="text" disabled={true}
placeholder="" value={Number(value).toFixed(1)}
disabled={true} />
value={Number(tableMeta.rowData[3]).toFixed(2)} }
/> />
} </div>
/>
</div>
} }
</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 null :
: tableMeta.rowData[0] === 1 ? <div style={{ flex: 1 }}>
null : <FormControlLabel
<div style={{ flex: 1 }}> style={{ margin: 0 }}
<FormControlLabel value={value}
style={{ margin: 0 }} control={
value={value} <NumberFormat
control={ thousandSeparator={true}
<NumberFormat style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
thousandSeparator={true} type="text"
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} placeholder=""
type="text" suffix={'%'}
placeholder="" disabled={true}
suffix={'%'} value={Number(value).toFixed(1)}
disabled={true} />
value={Number(tableMeta.rowData[4]).toFixed(2)} }
/> />
} </div>
/>
</div>
} }
</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 null :
: tableMeta.rowData[0] === 1 ? <div style={{ flex: 1 }}>
null : <FormControlLabel
<div style={{ flex: 1 }}> style={{ margin: 0 }}
<FormControlLabel value={value}
style={{ margin: 0 }} control={
value={value} <NumberFormat
control={ thousandSeparator={true}
<NumberFormat style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
thousandSeparator={true} type="text"
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} placeholder=""
type="text" disabled={true}
placeholder="" value={Number(value).toFixed(1)}
disabled={true} />
value={Number(tableMeta.rowData[5]).toFixed(2)} }
/> />
} </div>
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -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,237 +26780,216 @@ export default class TableSubHolding extends Component { ...@@ -26805,237 +26780,216 @@ 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 null :
: tableMeta.rowData[0] === 1 ? <div style={{ flex: 1 }}>
null : <FormControlLabel
<div style={{ flex: 1 }}> style={{ margin: 0 }}
<FormControlLabel value={value}
style={{ margin: 0 }} control={
value={value} <NumberFormat
control={ thousandSeparator={true}
<NumberFormat style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
thousandSeparator={true} type="text"
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} placeholder=""
type="text" disabled={true}
placeholder="" value={Number(value).toFixed(1)}
disabled={true} />
value={Number(tableMeta.rowData[6]).toFixed(2)} }
/> />
} </div>
/>
</div>
} }
</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 null :
: tableMeta.rowData[0] === 1 ? <div style={{ flex: 1 }}>
null : <FormControlLabel
<div style={{ flex: 1 }}> style={{ margin: 0 }}
<FormControlLabel value={value}
style={{ margin: 0 }} control={
value={value} <NumberFormat
control={ thousandSeparator={true}
<NumberFormat style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
thousandSeparator={true} type="text"
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} placeholder=""
type="text" disabled={true}
placeholder="" value={Number(value).toFixed(1)}
disabled={true} />
value={Number(tableMeta.rowData[7]).toFixed(2)} }
/> />
} </div>
/>
</div>
} }
</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 null :
: tableMeta.rowData[0] === 1 ? <div style={{ flex: 1 }}>
null : <FormControlLabel
<div style={{ flex: 1 }}> style={{ margin: 0 }}
<FormControlLabel value={value}
style={{ margin: 0 }} control={
value={value} <NumberFormat
control={ thousandSeparator={true}
<NumberFormat style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
thousandSeparator={true} type="text"
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} placeholder=""
type="text" suffix={`%`}
placeholder="" disabled={true}
suffix={'%'} value={value}
disabled={true} />
value={Number(tableMeta.rowData[8]).toFixed(2)} }
/> />
} </div>
/>
</div>
} }
</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 null :
: tableMeta.rowData[0] === 1 ? <div style={{ flex: 1 }}>
null : <FormControlLabel
<div style={{ flex: 1 }}> style={{ margin: 0 }}
<FormControlLabel value={value}
style={{ margin: 0 }} control={
value={value} <NumberFormat
control={ thousandSeparator={true}
<NumberFormat style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
thousandSeparator={true} type="text"
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} placeholder=""
type="text" disabled={true}
placeholder="" value={Number(value).toFixed(1)}
disabled={true} />
value={Number(tableMeta.rowData[9]).toFixed(2)} }
/> />
} </div>
/>
</div>
} }
</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 null :
: tableMeta.rowData[0] === 1 ? <div style={{ flex: 1 }}>
null : <FormControlLabel
<div style={{ flex: 1 }}> style={{ margin: 0 }}
<FormControlLabel value={value}
style={{ margin: 0 }} control={
value={value} <NumberFormat
control={ thousandSeparator={true}
<NumberFormat style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
thousandSeparator={true} type="text"
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} placeholder=""
type="text" disabled={true}
placeholder="" value={Number(value).toFixed(1)}
disabled={true} />
value={Number(tableMeta.rowData[10]).toFixed(2)} }
/> />
} </div>
/>
</div>
} }
</div> </div>
</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 null :
: tableMeta.rowData[0] === 1 ? <div style={{ flex: 1 }}>
null : <FormControlLabel
<div style={{ flex: 1 }}> style={{ margin: 0 }}
<FormControlLabel value={value}
style={{ margin: 0 }} control={
value={value} <NumberFormat
control={ thousandSeparator={true}
<NumberFormat style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
thousandSeparator={true} type="text"
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} placeholder=""
type="text" disabled={true}
placeholder="" value={Number(value).toFixed(1)}
disabled={true} />
value={Number(tableMeta.rowData[11]).toFixed(2)} }
/> />
} </div>
/>
</div>
} }
</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 null :
: tableMeta.rowData[0] === 1 ? <div style={{ flex: 1 }}>
null : <FormControlLabel
<div style={{ flex: 1 }}> style={{ margin: 0 }}
<FormControlLabel value={value}
style={{ margin: 0 }} control={
value={value} <NumberFormat
control={ thousandSeparator={true}
<NumberFormat style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
thousandSeparator={true} type="text"
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} placeholder=""
type="text" disabled={true}
placeholder="" value={Number(value).toFixed(1)}
disabled={true} />
value={Number(tableMeta.rowData[12]).toFixed(2)} }
/> />
} </div>
/>
</div>
} }
</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 null :
: tableMeta.rowData[0] === 1 ? <div style={{ flex: 1 }}>
null : <FormControlLabel
<div style={{ flex: 1 }}> style={{ margin: 0 }}
<FormControlLabel value={value}
style={{ margin: 0 }} control={
value={value} <NumberFormat
control={ thousandSeparator={true}
<NumberFormat style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
thousandSeparator={true} type="text"
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} placeholder=""
type="text" disabled={true}
placeholder="" value={Number(value).toFixed(1)}
suffix={'%'} />
disabled={true} }
value={Number(tableMeta.rowData[13]).toFixed(2)} />
/> </div>
}
/>
</div>
} }
</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 null :
: tableMeta.rowData[0] === 1 ? <div style={{ flex: 1 }}>
null : <FormControlLabel
<div style={{ flex: 1 }}> style={{ margin: 0 }}
<FormControlLabel value={value}
style={{ margin: 0 }} control={
value={value} <NumberFormat
control={ thousandSeparator={true}
<NumberFormat style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
thousandSeparator={true} type="text"
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} placeholder=""
type="text" disabled={true}
placeholder="" value={Number(value).toFixed(1)}
disabled={true} />
value={Number(tableMeta.rowData[14]).toFixed(2)} }
/> />
} </div>
/>
</div>
} }
</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 null :
: tableMeta.rowData[0] === 1 ? <div style={{ flex: 1 }}>
null : <FormControlLabel
<div style={{ flex: 1 }}> style={{ margin: 0 }}
<FormControlLabel value={value}
style={{ margin: 0 }} control={
value={value} <NumberFormat
control={ thousandSeparator={true}
<NumberFormat style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
thousandSeparator={true} type="text"
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} placeholder=""
type="text" disabled={true}
placeholder="" value={Number(value).toFixed(1)}
disabled={true} />
value={Number(tableMeta.rowData[15]).toFixed(2)} }
/> />
} </div>
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -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,33 +27010,31 @@ export default class TableSubHolding extends Component { ...@@ -27056,33 +27010,31 @@ 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 null :
: tableMeta.rowData[0] === 1 ? <div style={{ flex: 1 }}>
null : <FormControlLabel
<div style={{ flex: 1 }}> style={{ margin: 0 }}
<FormControlLabel value={value}
style={{ margin: 0 }} control={
value={value} <NumberFormat
control={ thousandSeparator={true}
<NumberFormat style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
thousandSeparator={true} type="text"
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} placeholder=""
type="text" disabled={true}
placeholder="" value={Number(value).toFixed(1)}
disabled={true} />
value={Number(tableMeta.rowData[16]).toFixed(2)} }
/> />
} </div>
/>
</div>
} }
</div> </div>
) )
} }
} }
}, { }, {
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,26 +27045,24 @@ export default class TableSubHolding extends Component { ...@@ -27093,26 +27045,24 @@ 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 null :
: tableMeta.rowData[0] === 1 ? <div style={{ flex: 1 }}>
null : <FormControlLabel
<div style={{ flex: 1 }}> style={{ margin: 0 }}
<FormControlLabel value={value}
style={{ margin: 0 }} control={
value={value} <NumberFormat
control={ thousandSeparator={true}
<NumberFormat style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
thousandSeparator={true} type="text"
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} placeholder=""
type="text" disabled={true}
placeholder="" value={Number(value).toFixed(1)}
disabled={true} />
value={Number(tableMeta.rowData[17]).toFixed(2)} }
/> />
} </div>
/>
</div>
} }
</div> </div>
) )
...@@ -27130,27 +27080,25 @@ export default class TableSubHolding extends Component { ...@@ -27130,27 +27080,25 @@ 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 null :
: tableMeta.rowData[0] === 1 ? <div style={{ flex: 1 }}>
null : <FormControlLabel
<div style={{ flex: 1 }}> style={{ margin: 0 }}
<FormControlLabel value={value}
style={{ margin: 0 }} control={
value={value} <NumberFormat
control={ thousandSeparator={true}
<NumberFormat style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
thousandSeparator={true} type="text"
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} placeholder=""
type="text" suffix={`%`}
placeholder="" disabled={true}
suffix={'%'} value={Number(value).toFixed(1)}
disabled={true} />
value={Number(tableMeta.rowData[18]).toFixed(2)} }
/> />
} </div>
/>
</div>
} }
</div> </div>
) )
...@@ -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