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

update

parent 833ce80b
...@@ -296,7 +296,7 @@ export default class BudgetTahunan extends Component { ...@@ -296,7 +296,7 @@ export default class BudgetTahunan extends Component {
item.revision, item.revision,
this.state.lastStatus === 'APPROVED' ? 'CLOSED' : this.state.isSubmit === false ? "CLOSED" : status_approv, this.state.lastStatus === 'APPROVED' ? 'CLOSED' : this.state.isSubmit === false ? "CLOSED" : status_approv,
item.report_id, item.report_id,
Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload, item.report_name === "Cash Flow" ? item.is_can_upload : (Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload),
item.revision item.revision
] ]
}) })
......
...@@ -115,7 +115,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -115,7 +115,7 @@ export default class CorporateAnnualTarget extends Component {
let dataInternalBsn = [] let dataInternalBsn = []
let dataFin = [] let dataFin = []
let dataLearn = [] let dataLearn = []
// console.log(response) console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
...@@ -1076,7 +1076,6 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1076,7 +1076,6 @@ export default class CorporateAnnualTarget extends Component {
} else { } else {
} }
anjay.push(String(total)) anjay.push(String(total))
} else if (item.includes('[CM]AVG')) { } else if (item.includes('[CM]AVG')) {
if (forecast == undefined) { if (forecast == undefined) {
...@@ -1085,7 +1084,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1085,7 +1084,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} else if (item.includes('X')) { } else if (item.includes('X')) {
let indexX = String(item).indexOf('X') let indexX = String(item).indexOf('X')
console.log(item) // console.log(item)
if (indexX == 0) { if (indexX == 0) {
anjay.push(String(item).substr(1, String(item).length)) anjay.push(String(item).substr(1, String(item).length))
} else { } else {
...@@ -1097,13 +1096,9 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1097,13 +1096,9 @@ export default class CorporateAnnualTarget extends Component {
let convertID = -1 let convertID = -1
if (tableMeta.rowData[11].value == 'FORMULA') { if (tableMeta.rowData[11].value == 'FORMULA') {
let indexIDReport = dataTable2.findIndex((val) => val[1] == formulaAwal) let indexIDReport = dataTable2.findIndex((val) => val[1] == formulaAwal)
console.log(indexX)
console.log(formulaAwal)
console.log(indexIDReport)
console.log(dataTable2[indexIDReport][31])
convertID = dataTable2[indexIDReport][31] convertID = dataTable2[indexIDReport][31]
let indexID = dataTable2.findIndex((val) => val[31] == convertID == -1 ? item : convertID) let indexID = dataTable2.findIndex((val) => val[31] == (convertID == -1 ? item : convertID))
let valuezz = dataTable2[indexID][column].value == undefined ? dataTable2[indexID][column] : dataTable2[indexID][column].value let valuezz = dataTable2[indexID][tableMeta.columnIndex].value == undefined ? dataTable2[indexID][tableMeta.columnIndex] : dataTable2[indexID][tableMeta.columnIndex].value
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
} else { } else {
let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${formulaAwal}`) && val.periode == Number(this.props.periode)) let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${formulaAwal}`) && val.periode == Number(this.props.periode))
...@@ -1144,9 +1139,9 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1144,9 +1139,9 @@ export default class CorporateAnnualTarget extends Component {
let indexIDReport = dataTable2.findIndex((val) => val[1] == item) let indexIDReport = dataTable2.findIndex((val) => val[1] == item)
convertID = dataTable2[indexIDReport][31] convertID = dataTable2[indexIDReport][31]
} }
let indexID = dataTable2.findIndex((val) => val[31] == convertID == -1 ? item : convertID) let indexID = dataTable2.findIndex((val) => val[31] == (convertID == -1 ? item : convertID))
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = dataTable2[indexID][column].value == undefined ? dataTable2[indexID][column] : dataTable2[indexID][column].value let valuezz = dataTable2[indexID][tableMeta.columnIndex].value == undefined ? dataTable2[indexID][tableMeta.columnIndex] : dataTable2[indexID][tableMeta.columnIndex].value
if (item == dataTable2[tableMeta.rowIndex][31]) { if (item == dataTable2[tableMeta.rowIndex][31]) {
anjay.push(0) anjay.push(0)
} else { } else {
...@@ -1160,6 +1155,11 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1160,6 +1155,11 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}) })
// if (tableMeta.rowData[11].value == 'FORMULA') {
// console.log(anjay)
// console.log(column)
// }
let anjay2 = [] let anjay2 = []
let kurung = false let kurung = false
...@@ -1871,26 +1871,49 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1871,26 +1871,49 @@ export default class CorporateAnnualTarget extends Component {
null null
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel {(tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7) && tableMeta.rowData[11].value == 'FORMULA' ?
style={{ margin: 0 }} // null
value={value} <FormControlLabel
control={ style={{ margin: 0 }}
<NumberFormat value={value}
thousandSeparator={true} control={
style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} <NumberFormat
type="text" thousandSeparator={true}
placeholder="" style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
value={Number(value).toFixed(1)} type="text"
disabled={true} placeholder=""
decimalScale={1} value={Number(handleValueFormula(value, tableMeta, 0)).toFixed(1)}
onBlur={(event) => { disabled
// updateValue(event.target.value) decimalScale={1}
handleChange(event.target.value, tableMeta) onBlur={(event) => {
// // // // console.log(dataTable2) // updateValue(event.target.value)
}} handleChange(event.target.value, tableMeta)
/> // // // // console.log(tableMeta.rowData[0])
} }}
/> />
}
/>
:
<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=""
value={Number(value).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// // // // console.log(dataTable2)
}}
/>
}
/>}
</div> </div>
} }
</div> </div>
...@@ -1966,7 +1989,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1966,7 +1989,7 @@ export default class CorporateAnnualTarget extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", 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={Number(handleValueFormula(value, tableMeta, 1)).toFixed(1)} value={Number(handleValueFormula(value, tableMeta, 1)).toFixed(1)}
...@@ -2068,26 +2091,49 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2068,26 +2091,49 @@ export default class CorporateAnnualTarget extends Component {
</div> </div>
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel {tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
style={{ margin: 0 }} // null
value={value} <FormControlLabel
control={ style={{ margin: 0 }}
<NumberFormat value={value}
thousandSeparator={true} control={
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} <NumberFormat
type="text" thousandSeparator={true}
placeholder="" style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
value={Number(value).toFixed(1)} type="text"
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)} placeholder=""
decimalScale={1} value={Number(handleValueFormula(value, tableMeta, 2)).toFixed(1)}
onBlur={(event) => { disabled
// updateValue(event.target.value) decimalScale={1}
handleChange(event.target.value, tableMeta) onBlur={(event) => {
// // // // console.log(tableMeta.rowData[0]) // updateValue(event.target.value)
}} handleChange(event.target.value, tableMeta)
/> // // // // console.log(tableMeta.rowData[0])
} }}
/> />
}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
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}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// // // // console.log(tableMeta.rowData[0])
}}
/>
}
/>}
</div>) </div>)
} }
</div> </div>
...@@ -2154,26 +2200,49 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2154,26 +2200,49 @@ export default class CorporateAnnualTarget extends Component {
</div> </div>
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel {tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
style={{ margin: 0 }} // null
value={value} <FormControlLabel
control={ style={{ margin: 0 }}
<NumberFormat value={value}
thousandSeparator={true} control={
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} <NumberFormat
type="text" thousandSeparator={true}
placeholder="" style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
value={Number(value).toFixed(1)} type="text"
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)} placeholder=""
decimalScale={1} value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
onBlur={(event) => { disabled
// updateValue(event.target.value) decimalScale={1}
handleChange(event.target.value, tableMeta) onBlur={(event) => {
// // // // console.log(tableMeta.rowData[0]) // updateValue(event.target.value)
}} handleChange(event.target.value, tableMeta)
/> // // // // console.log(tableMeta.rowData[0])
} }}
/> />
}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
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}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// // // // console.log(tableMeta.rowData[0])
}}
/>
}
/>}
</div> </div>
) )
} }
...@@ -2241,26 +2310,49 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2241,26 +2310,49 @@ export default class CorporateAnnualTarget extends Component {
</div> </div>
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel {tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
style={{ margin: 0 }} // null
value={value} <FormControlLabel
control={ style={{ margin: 0 }}
<NumberFormat value={value}
thousandSeparator={true} control={
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} <NumberFormat
type="text" thousandSeparator={true}
placeholder="" style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
value={Number(value).toFixed(1)} type="text"
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)} placeholder=""
decimalScale={1} value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)}
onBlur={(event) => { disabled
// updateValue(event.target.value) decimalScale={1}
handleChange(event.target.value, tableMeta) onBlur={(event) => {
// // // // console.log(tableMeta.rowData[0]) // updateValue(event.target.value)
}} handleChange(event.target.value, tableMeta)
/> // // // // console.log(tableMeta.rowData[0])
} }}
/> />
}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
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}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// // // // console.log(tableMeta.rowData[0])
}}
/>
}
/>}
</div> </div>
) )
} }
...@@ -2328,41 +2420,64 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2328,41 +2420,64 @@ export default class CorporateAnnualTarget extends Component {
</div> </div>
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel {tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
style={{ margin: 0 }} // null
value={value} <FormControlLabel
control={ style={{ margin: 0 }}
<NumberFormat value={value}
thousandSeparator={true} control={
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} <NumberFormat
type="text" thousandSeparator={true}
placeholder="" style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
value={Number(value).toFixed(1)} type="text"
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)} placeholder=""
decimalScale={1} value={Number(handleValueFormula(value, tableMeta, 5)).toFixed(1)}
onBlur={(event) => { disabled
// updateValue(event.target.value) decimalScale={1}
handleChange(event.target.value, tableMeta) onBlur={(event) => {
// // // // console.log(tableMeta.rowData[0]) // updateValue(event.target.value)
}} handleChange(event.target.value, tableMeta)
/> // // // // console.log(tableMeta.rowData[0])
} }}
/> />
</div> }
) />
} :
</div> <FormControlLabel
) style={{ margin: 0 }}
} value={value}
} control={
}, { <NumberFormat
name: `Jun ${this.props.periode}`, thousandSeparator={true}
options: { style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
customHeadRender: (columnMeta) => ( type="text"
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> placeholder=""
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> value={Number(value).toFixed(1)}
</TableCell> 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}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// // // // console.log(tableMeta.rowData[0])
}}
/>
}
/>}
</div>
)
}
</div>
)
}
}
}, {
name: `Jun ${this.props.periode}`,
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (value, tableMeta) => { customBodyRender: (value, tableMeta) => {
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 96 }}>
...@@ -2415,26 +2530,49 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2415,26 +2530,49 @@ export default class CorporateAnnualTarget extends Component {
</div> </div>
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel {tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
style={{ margin: 0 }} // null
value={value} <FormControlLabel
control={ style={{ margin: 0 }}
<NumberFormat value={value}
thousandSeparator={true} control={
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} <NumberFormat
type="text" thousandSeparator={true}
placeholder="" style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
value={Number(value).toFixed(1)} type="text"
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)} placeholder=""
decimalScale={1} value={Number(handleValueFormula(value, tableMeta, 6)).toFixed(1)}
onBlur={(event) => { disabled
// updateValue(event.target.value) decimalScale={1}
handleChange(event.target.value, tableMeta) onBlur={(event) => {
// // // // console.log(tableMeta.rowData[0]) // updateValue(event.target.value)
}} handleChange(event.target.value, tableMeta)
/> // // // // console.log(tableMeta.rowData[0])
} }}
/> />
}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
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}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// // // // console.log(tableMeta.rowData[0])
}}
/>
}
/>}
</div> </div>
) )
} }
...@@ -2502,26 +2640,49 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2502,26 +2640,49 @@ export default class CorporateAnnualTarget extends Component {
</div> </div>
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel {tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
style={{ margin: 0 }} // null
value={value} <FormControlLabel
control={ style={{ margin: 0 }}
<NumberFormat value={value}
thousandSeparator={true} control={
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} <NumberFormat
type="text" thousandSeparator={true}
placeholder="" style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
value={Number(value).toFixed(1)} type="text"
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)} placeholder=""
decimalScale={1} value={Number(handleValueFormula(value, tableMeta, 7)).toFixed(1)}
onBlur={(event) => { disabled
// updateValue(event.target.value) decimalScale={1}
handleChange(event.target.value, tableMeta) onBlur={(event) => {
// // // // console.log(tableMeta.rowData[0]) // updateValue(event.target.value)
}} handleChange(event.target.value, tableMeta)
/> // // // // console.log(tableMeta.rowData[0])
} }}
/> />
}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
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}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// // // // console.log(tableMeta.rowData[0])
}}
/>
}
/>}
</div> </div>
) )
} }
...@@ -2589,26 +2750,49 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2589,26 +2750,49 @@ export default class CorporateAnnualTarget extends Component {
</div> </div>
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel {tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
style={{ margin: 0 }} // null
value={value} <FormControlLabel
control={ style={{ margin: 0 }}
<NumberFormat value={value}
thousandSeparator={true} control={
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} <NumberFormat
type="text" thousandSeparator={true}
placeholder="" style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
value={Number(value).toFixed(1)} type="text"
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)} placeholder=""
decimalScale={1} value={Number(handleValueFormula(value, tableMeta, 8)).toFixed(1)}
onBlur={(event) => { disabled
// updateValue(event.target.value) decimalScale={1}
handleChange(event.target.value, tableMeta) onBlur={(event) => {
// // // // console.log(tableMeta.rowData[0]) // updateValue(event.target.value)
}} handleChange(event.target.value, tableMeta)
/> // // // // console.log(tableMeta.rowData[0])
} }}
/> />
}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
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}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// // // // console.log(tableMeta.rowData[0])
}}
/>
}
/>}
</div> </div>
) )
} }
...@@ -2676,26 +2860,49 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2676,26 +2860,49 @@ export default class CorporateAnnualTarget extends Component {
</div> </div>
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel {tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
style={{ margin: 0 }} // null
value={value} <FormControlLabel
control={ style={{ margin: 0 }}
<NumberFormat value={value}
thousandSeparator={true} control={
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} <NumberFormat
type="text" thousandSeparator={true}
placeholder="" style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
value={Number(value).toFixed(1)} type="text"
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)} placeholder=""
decimalScale={1} value={Number(handleValueFormula(value, tableMeta, 9)).toFixed(1)}
onBlur={(event) => { disabled
// updateValue(event.target.value) decimalScale={1}
handleChange(event.target.value, tableMeta) onBlur={(event) => {
// // // // console.log(tableMeta.rowData[0]) // updateValue(event.target.value)
}} handleChange(event.target.value, tableMeta)
/> // // // // console.log(tableMeta.rowData[0])
} }}
/> />
}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
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}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// // // // console.log(tableMeta.rowData[0])
}}
/>
}
/>}
</div> </div>
) )
} }
...@@ -2763,26 +2970,49 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2763,26 +2970,49 @@ export default class CorporateAnnualTarget extends Component {
</div> </div>
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel {tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
style={{ margin: 0 }} // null
value={value} <FormControlLabel
control={ style={{ margin: 0 }}
<NumberFormat value={value}
thousandSeparator={true} control={
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} <NumberFormat
type="text" thousandSeparator={true}
placeholder="" style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
value={Number(value).toFixed(1)} type="text"
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)} placeholder=""
decimalScale={1} value={Number(handleValueFormula(value, tableMeta, 10)).toFixed(1)}
onBlur={(event) => { disabled
// updateValue(event.target.value) decimalScale={1}
handleChange(event.target.value, tableMeta) onBlur={(event) => {
// // // // console.log(tableMeta.rowData[0]) // updateValue(event.target.value)
}} handleChange(event.target.value, tableMeta)
/> // // // // console.log(tableMeta.rowData[0])
} }}
/> />
}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
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}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// // // // console.log(tableMeta.rowData[0])
}}
/>
}
/>}
</div> </div>
) )
} }
...@@ -2850,26 +3080,49 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2850,26 +3080,49 @@ export default class CorporateAnnualTarget extends Component {
</div> </div>
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel {tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
style={{ margin: 0 }} // null
value={value} <FormControlLabel
control={ style={{ margin: 0 }}
<NumberFormat value={value}
thousandSeparator={true} control={
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} <NumberFormat
type="text" thousandSeparator={true}
placeholder="" style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
value={Number(value).toFixed(1)} type="text"
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)} placeholder=""
decimalScale={1} value={Number(handleValueFormula(value, tableMeta, 11)).toFixed(1)}
onBlur={(event) => { disabled
// updateValue(event.target.value) decimalScale={1}
handleChange(event.target.value, tableMeta) onBlur={(event) => {
// // // // console.log(tableMeta.rowData[0]) // updateValue(event.target.value)
}} handleChange(event.target.value, tableMeta)
/> // // // // console.log(tableMeta.rowData[0])
} }}
/> />
}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
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}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// // // // console.log(tableMeta.rowData[0])
}}
/>
}
/>}
</div> </div>
) )
} }
...@@ -2937,26 +3190,49 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2937,26 +3190,49 @@ export default class CorporateAnnualTarget extends Component {
</div> </div>
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel {tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
style={{ margin: 0 }} // null
value={value} <FormControlLabel
control={ style={{ margin: 0 }}
<NumberFormat value={value}
thousandSeparator={true} control={
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} <NumberFormat
type="text" thousandSeparator={true}
placeholder="" style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
value={Number(value).toFixed(1)} type="text"
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)} placeholder=""
decimalScale={1} value={Number(handleValueFormula(value, tableMeta, 12)).toFixed(1)}
onBlur={(event) => { disabled
// updateValue(event.target.value) decimalScale={1}
handleChange(event.target.value, tableMeta) onBlur={(event) => {
// // // // console.log(tableMeta.rowData[0]) // updateValue(event.target.value)
}} handleChange(event.target.value, tableMeta)
/> // // // // console.log(tableMeta.rowData[0])
} }}
/> />
}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
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}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// // // // console.log(tableMeta.rowData[0])
}}
/>
}
/>}
</div> </div>
) )
} }
...@@ -2976,32 +3252,57 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2976,32 +3252,57 @@ export default class CorporateAnnualTarget extends Component {
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 96 }}>
{ {
tableMeta.rowData[6] === 'ROIC' ? // tableMeta.rowData[6] === 'ROIC' ?
<div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
<FormControlLabel // <FormControlLabel
style={{ margin: 0 }} // style={{ margin: 0 }}
value={value} // value={value}
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={Number(handleTotal(tableMeta, 'roic')).toFixed(1)} // value={Number(handleTotal(tableMeta, 'roic')).toFixed(1)}
disabled={true} // disabled={true}
onBlur={(event) => { // onBlur={(event) => {
// updateValue(event.target.value) // // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) // handleChange(event.target.value, tableMeta)
// // // // console.log(tableMeta.rowData[0]) // // // // // console.log(tableMeta.rowData[0])
}} // }}
/> // />
} // }
/> // />
</div> : // </div> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ? tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null : null :
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ? (handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}> <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=""
value={Number(handleValueForecast(value, tableMeta, this.props.periode)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// // // // console.log(tableMeta.rowData[0])
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
// null
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={value} value={value}
...@@ -3011,8 +3312,8 @@ export default class CorporateAnnualTarget extends Component { ...@@ -3011,8 +3312,8 @@ export default class CorporateAnnualTarget 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=""
value={Number(handleValueForecast(value, tableMeta, this.props.periode)).toFixed(1)} value={Number(handleValueFormula(value, tableMeta, 13)).toFixed(1)}
disabled={true} disabled
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -3022,9 +3323,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -3022,9 +3323,7 @@ export default class CorporateAnnualTarget extends Component {
/> />
} }
/> />
</div> :
:
<div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={value} value={value}
...@@ -3044,9 +3343,9 @@ export default class CorporateAnnualTarget extends Component { ...@@ -3044,9 +3343,9 @@ export default class CorporateAnnualTarget extends Component {
}} }}
/> />
} }
/> />}
</div> </div>
) )
} }
</div> </div>
) )
...@@ -3112,26 +3411,49 @@ export default class CorporateAnnualTarget extends Component { ...@@ -3112,26 +3411,49 @@ export default class CorporateAnnualTarget extends Component {
</div> </div>
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel {tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
style={{ margin: 0 }} // null
value={value} <FormControlLabel
control={ style={{ margin: 0 }}
<NumberFormat value={value}
thousandSeparator={true} control={
style={{ color: '#5198ea', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} <NumberFormat
type="text" thousandSeparator={true}
placeholder="" style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
value={Number(value).toFixed(1)} type="text"
disabled={false} placeholder=""
decimalScale={1} value={Number(handleValueFormula(value, tableMeta, 14)).toFixed(1)}
onBlur={(event) => { disabled
// updateValue(event.target.value) decimalScale={1}
handleChange(event.target.value, tableMeta) onBlur={(event) => {
// // // // console.log(tableMeta.rowData[0]) // updateValue(event.target.value)
}} handleChange(event.target.value, tableMeta)
/> // // // // console.log(tableMeta.rowData[0])
} }}
/> />
}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: '#5198ea', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
disabled={false}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// // // // console.log(tableMeta.rowData[0])
}}
/>
}
/>}
</div> </div>
) )
} }
...@@ -3199,26 +3521,49 @@ export default class CorporateAnnualTarget extends Component { ...@@ -3199,26 +3521,49 @@ export default class CorporateAnnualTarget extends Component {
</div> </div>
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel {tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
style={{ margin: 0 }} // null
value={value} <FormControlLabel
control={ style={{ margin: 0 }}
<NumberFormat value={value}
thousandSeparator={true} control={
style={{ color: '#5198ea', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} <NumberFormat
type="text" thousandSeparator={true}
placeholder="" style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
value={Number(value).toFixed(1)} type="text"
disabled={false} placeholder=""
decimalScale={1} value={Number(handleValueFormula(value, tableMeta, 16)).toFixed(1)}
onBlur={(event) => { disabled
// updateValue(event.target.value) decimalScale={1}
handleChange(event.target.value, tableMeta) onBlur={(event) => {
// // // // console.log(tableMeta.rowData[0]) // updateValue(event.target.value)
}} handleChange(event.target.value, tableMeta)
/> // // // // console.log(tableMeta.rowData[0])
} }}
/> />
}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: '#5198ea', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
disabled={false}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// // // // console.log(tableMeta.rowData[0])
}}
/>
}
/>}
</div> </div>
) )
} }
......
...@@ -129,6 +129,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -129,6 +129,7 @@ export default class CorporateAnnualTargetMR extends Component {
} }
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev }) this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
// this.setState({ viewOnly: true })
} }
getParameterGroup() { getParameterGroup() {
...@@ -717,7 +718,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -717,7 +718,7 @@ export default class CorporateAnnualTargetMR extends Component {
} }
} else { } else {
// if (actual <= target) { // if (actual <= target) {
totalAch = (actual / target) totalAch = (actual / target)
// } else { // } else {
// totalAch = 1 - (actual / target) // totalAch = 1 - (actual / target)
// } // }
...@@ -736,10 +737,10 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -736,10 +737,10 @@ export default class CorporateAnnualTargetMR extends Component {
let totalScore = 0 let totalScore = 0
let achx100 = item[9] == '100%' && (item[8] == 'HIB' || item[8] == 'HIG') ? Number(totalAch) / 100 > 1 ? 1 : Number(totalAch) / 100 : Number(totalAch) / 100 let achx100 = item[9] == '100%' && (item[8] == 'HIB' || item[8] == 'HIG') ? Number(totalAch) / 100 > 1 ? 1 : Number(totalAch) / 100 : Number(totalAch) / 100
// if (item[5] == "Max Quality drop from Bor-Barge") { // if (item[5] == "Max Quality drop from Bor-Barge") {
// console.log(listParameterFilter) // console.log(listParameterFilter)
// console.log(listParameterFilterCompany) // console.log(listParameterFilterCompany)
// // console.log(Number(item.min_value)) // // console.log(Number(item.min_value))
// console.log(Number(item.max_value)) // console.log(Number(item.max_value))
// } // }
if (listParameterFilterCompany.length == 0) { if (listParameterFilterCompany.length == 0) {
listParameterFilter.map((items, index) => { listParameterFilter.map((items, index) => {
...@@ -978,10 +979,19 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -978,10 +979,19 @@ export default class CorporateAnnualTargetMR extends Component {
if (forecast == undefined) { if (forecast == undefined) {
// console.log(formulaAwal) // console.log(formulaAwal)
// console.log(tableMeta.rowData[17]) // console.log(tableMeta.rowData[17])
let indexID = tableMeta.rowData[17].findIndex((val) => val.item_formula == String(`@${formulaAwal}`) && val.periode == Number(this.props.periode)) let convertID = -1
if (indexID !== -1) { if (tableMeta.rowData[10] == 'FORMULA') {
let valuezz = tableMeta.rowData[17][indexID].value let indexIDReport = dataTable2.findIndex((val) => val[1] == formulaAwal)
convertID = dataTable2[indexIDReport][18]
let indexID = dataTable2.findIndex((val) => val[18] == (convertID == -1 ? item : convertID))
let valuezz = dataTable2[indexID][column].value == undefined ? dataTable2[indexID][column] : dataTable2[indexID][column].value
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
} else {
let indexID = tableMeta.rowData[17].findIndex((val) => val.item_formula == String(`@${formulaAwal}`) && val.periode == Number(this.props.periode))
if (indexID !== -1) {
let valuezz = tableMeta.rowData[17][indexID].value
anjay.push(valuezz == "" ? 0 : valuezz)
}
} }
} else { } else {
// // // console.log(dataTable2[tableMeta.rowIndex][30]) // // // console.log(dataTable2[tableMeta.rowIndex][30])
...@@ -1010,7 +1020,12 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1010,7 +1020,12 @@ export default class CorporateAnnualTargetMR extends Component {
} }
} else { } else {
let indexID = dataTable2.findIndex((val) => val[18] == item) let convertID = -1
if (tableMeta.rowData[10] == 'FORMULA') {
let indexIDReport = dataTable2.findIndex((val) => val[1] == item)
convertID = dataTable2[indexIDReport][18]
}
let indexID = dataTable2.findIndex((val) => val[18] == (convertID == -1 ? item : convertID))
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = dataTable2[indexID][column].value == undefined ? dataTable2[indexID][column] : dataTable2[indexID][column].value let valuezz = dataTable2[indexID][column].value == undefined ? dataTable2[indexID][column] : dataTable2[indexID][column].value
if (item == dataTable2[tableMeta.rowIndex][18]) { if (item == dataTable2[tableMeta.rowIndex][18]) {
...@@ -1027,8 +1042,12 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1027,8 +1042,12 @@ export default class CorporateAnnualTargetMR extends Component {
} }
}) })
// console.log(baru) // if (tableMeta.rowData[10] == 'FORMULA') {
// console.log(anjay) // // let indexIDReport = dataTable2.findIndex((val) => val[1] == item)
// // convertID = dataTable2[indexIDReport][18]
// console.log(baru)
// console.log(anjay)
// }
let anjay2 = [] let anjay2 = []
let kurung = false let kurung = false
...@@ -1148,12 +1167,12 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1148,12 +1167,12 @@ export default class CorporateAnnualTargetMR extends Component {
} }
}) })
total = dataTable2[tableMeta.rowIndex][5] == "ROIC" ? "0" : R.equals(total, NaN) ? "0.0" : total total = R.equals(total, NaN) ? "0.0" : total
if (dataTable2[tableMeta.rowIndex][5] == "ROIC") { // if (dataTable2[tableMeta.rowIndex][5] == "ROIC") {
dataTable2[tableMeta.rowIndex][column] = 0 // dataTable2[tableMeta.rowIndex][column] = 0
} else { // } else {
dataTable2[tableMeta.rowIndex][column] = Number(total).toFixed(1) dataTable2[tableMeta.rowIndex][column] = Number(total).toFixed(1)
} // }
return Number(total).toFixed(1) return Number(total).toFixed(1)
} }
...@@ -1314,7 +1333,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1314,7 +1333,7 @@ export default class CorporateAnnualTargetMR extends Component {
} }
} else { } else {
// if (actual <= target) { // if (actual <= target) {
total = (actual / target) total = (actual / target)
// } else { // } else {
// total = 1 - (actual / target) // total = 1 - (actual / target)
// } // }
...@@ -1644,7 +1663,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1644,7 +1663,7 @@ export default class CorporateAnnualTargetMR extends Component {
style={{ color: this.state.get_for == 'view' ? "black" : handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta) ? "#5198ea" : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.state.get_for == 'view' ? "black" : handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta) ? "#5198ea" : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={tableMeta.rowData[5] === "ROIC" ? Number(value).toFixed(1) : tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ? Number(handleValueFormula(value, tableMeta, tableMeta.columnIndex)).toFixed(1) : Number(value).toFixed(1)} value={tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ? Number(handleValueFormula(value, tableMeta, tableMeta.columnIndex)).toFixed(1) : Number(value).toFixed(1)}
// 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)} // 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)}
disabled={this.state.get_for == 'view' ? true : !handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta)} disabled={this.state.get_for == 'view' ? true : !handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta)}
decimalScale={1} decimalScale={1}
......
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