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 {
listPeriode: null,
periode: null,
reportType: [
{ value: 2, label: 'DB Balance Sheet' },
{ value: 3, label: 'DB Profit & Loss' },
{ value: 1, label: 'DB Profit & Loss Detail' },
{ value: 4, label: 'DB Ratio' },
{ value: 5, label: 'DB Tax Planning' },
{ value: 21, label: 'DB Operating Indicator' },
{ value: 6, label: 'Cash Flow - Summary' },
{ value: 7, label: 'Balance Sheet - Summary' },
{ value: 8, label: 'Profit Loss - Summary' },
{ value: 9, label: 'Financial Ratio - Summary' },
// { value: 2, label: 'DB Balance Sheet' },
// { value: 3, label: 'DB Profit & Loss' },
// { value: 1, label: 'DB Profit & Loss Detail' },
// { value: 4, label: 'DB Ratio' },
// { value: 5, label: 'DB Tax Planning' },
// { value: 21, label: 'DB Operating Indicator' },
// { value: 6, label: 'Cash Flow - Summary' },
// { value: 7, label: 'Balance Sheet - Summary' },
// { value: 8, label: 'Profit Loss - Summary' },
// { value: 9, label: 'Financial Ratio - Summary' },
{ value: 11, label: 'CAT Performance Quarterly' },
{ value: 10, label: 'CAT Performance Appraisal' },
],
......@@ -2894,7 +2894,8 @@ export default class SubHolding extends Component {
let indexIDzz = dbCATPQ.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) {
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([
item.typeItemReportId,
item.itemReportId,
......@@ -2903,15 +2904,27 @@ export default class SubHolding extends Component {
item.level,
item.itemName,
item.corporate_annual_target.weight == "" ? Number(0).toFixed(1) : Number(weight).toFixed(1),
item.uom,
item.typeKpi,
item.max_ach,
item.formula_ytd,
item.actual_monthly,
item.target_monthly,
item.achivement_monthly,
item.score,
item.score_x_weight,
item.corporate_annual_target.uom,
item.corporate_annual_target.lastYearActualQx,
item.corporate_annual_target.thisYearPercentGrowthYoy,
item.corporate_annual_target.lastYearActualFy,
item.corporate_annual_target.thisYearbudgetQx,
item.corporate_annual_target.thisYearActualQx,
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
])
}
......@@ -2933,14 +2946,26 @@ export default class SubHolding extends Component {
item.itemName,
item.weight == '' ? Number(0).toFixed(1) : Number(Number(item.weight) * 100).toFixed(1),
item.uom,
item.typeKpi,
item.max_ach,
item.formula_ytd,
item.actual_monthly,
item.target_monthly,
item.achivement_monthly,
item.score,
item.score_x_weight,
item.corporate_annual_target.lastYearActualQx,
item.corporate_annual_target.thisYearPercentGrowthYoy,
item.corporate_annual_target.lastYearActualFy,
item.corporate_annual_target.thisYearbudgetQx,
item.corporate_annual_target.thisYearActualQx,
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
])
if (item.children !== null) {
......@@ -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 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)
// }
}
}
// 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([
......@@ -3044,7 +3069,8 @@ export default class SubHolding extends Component {
item.formula_ytd,
item.corporate_annual_target.actual_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_x_weight,
item.order
......
......@@ -1050,39 +1050,6 @@ export default class TableSubHolding extends Component {
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 = [{
name: "",
options: {
......@@ -26622,12 +26589,26 @@ export default class TableSubHolding extends Component {
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ width: 90, textAlign: 'center' }}>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 4 ?
<div style={{ textAlign: 'center' }}>
{tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<div>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : value}</span>
</div>
<FormControlLabel
style={{ margin: 0 }}
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>
)
......@@ -26656,7 +26637,7 @@ export default class TableSubHolding extends Component {
}
}
},{
name: "2020",
name: `${Number(this.props.periode) - 1}`,
options: {
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 }} >
......@@ -26680,73 +26661,67 @@ export default class TableSubHolding extends Component {
<div>
<div className="grid grid-3x content-center">
<div className="col-1">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[3]).toFixed(2)}
/>
}
/>
</div>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-2">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
suffix={'%'}
disabled={true}
value={Number(tableMeta.rowData[4]).toFixed(2)}
/>
}
/>
</div>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
suffix={'%'}
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-3">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[5]).toFixed(2)}
/>
}
/>
</div>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
}
</div>
</div>
......@@ -26755,7 +26730,7 @@ export default class TableSubHolding extends Component {
}
}
},{
name: "2021",
name: `${Number(this.props.periode)}`,
options: {
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 }} >
......@@ -26805,237 +26780,216 @@ export default class TableSubHolding extends Component {
<div className="grid grid-2x content-center">
<div className="grid grid-5x content-center">
<div className="col-1">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[6]).toFixed(2)}
/>
}
/>
</div>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-2">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[7]).toFixed(2)}
/>
}
/>
</div>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-3">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
suffix={'%'}
disabled={true}
value={Number(tableMeta.rowData[8]).toFixed(2)}
/>
}
/>
</div>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
suffix={`%`}
disabled={true}
value={value}
/>
}
/>
</div>
}
</div>
<div className="col-4">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(2)}
/>
}
/>
</div>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-5">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[10]).toFixed(2)}
/>
}
/>
</div>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
}
</div>
</div>
<div className="grid grid-5x content-center">
<div className="col-1">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[11]).toFixed(2)}
/>
}
/>
</div>
<div className="col-1">
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-2">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[12]).toFixed(2)}
/>
}
/>
</div>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-3">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
suffix={'%'}
disabled={true}
value={Number(tableMeta.rowData[13]).toFixed(2)}
/>
}
/>
</div>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-4">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[14]).toFixed(2)}
/>
}
/>
</div>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-5">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[15]).toFixed(2)}
/>
}
/>
</div>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
}
</div>
</div>
......@@ -27045,7 +26999,7 @@ export default class TableSubHolding extends Component {
}
}
}, {
name: `Master Budget 2021`,
name: `Master Budget ${Number(this.props.periode)}`,
options: {
customHeadRender: (columnMeta) => (
<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 {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ width: 90, textAlign: 'center' }}>
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[16]).toFixed(2)}
/>
}
/>
</div>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
}
</div>
)
}
}
}, {
name: `OL 2021`,
name: `OL ${Number(this.props.periode)}`,
options: {
customHeadRender: (columnMeta) => (
<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 {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ width: 90, textAlign: 'center' }}>
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[17]).toFixed(2)}
/>
}
/>
</div>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
}
</div>
)
......@@ -27130,27 +27080,25 @@ export default class TableSubHolding extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ width: 90, textAlign: 'center' }}>
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
suffix={'%'}
disabled={true}
value={Number(tableMeta.rowData[18]).toFixed(2)}
/>
}
/>
</div>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
suffix={`%`}
disabled={true}
value={Number(value).toFixed(1)}
/>
}
/>
</div>
}
</div>
)
......@@ -27380,7 +27328,7 @@ export default class TableSubHolding extends Component {
}
}
}, {
name: `Actual 2021`,
name: `Actual ${Number(this.props.periode)}`,
options: {
customHeadRender: (columnMeta) => (
<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 {
}
}
}, {
name: `Target 2021`,
name: `Target ${Number(this.props.periode)}`,
options: {
customHeadRender: (columnMeta) => (
<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 {
}
}
}, {
name: `Achivement 2021 (%)`,
name: `Achivement ${Number(this.props.periode)} (%)`,
options: {
customHeadRender: (columnMeta) => (
<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 {
null :
<FormControlLabel
style={{ margin: 0 }}
value={Number(value).toFixed(0)}
value={Number(value).toFixed(1)}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={handleScore(tableMeta)}
// value={Number(value).toFixed(1)}
decimalScale={0}
value={Number(value).toFixed(1)}
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