Commit 60677c8b authored by d.arizona's avatar d.arizona

apdet yasalam

parent eb184e67
...@@ -251,7 +251,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -251,7 +251,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}) })
// // console.log(dataTable) console.log(dataTable)
this.setState({ dataTable, loading: false, dataReal: res, editable: true, dataCustomerPrs, dataInternalBsn, dataFin, dataLearn}, () => { this.setState({ dataTable, loading: false, dataReal: res, editable: true, dataCustomerPrs, dataInternalBsn, dataFin, dataLearn}, () => {
// // // console.log(dataCustomerPrs) // // // console.log(dataCustomerPrs)
}) })
......
...@@ -1013,6 +1013,9 @@ export default class BalanceSheetMR extends Component { ...@@ -1013,6 +1013,9 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(val).toFixed(1)
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1072,6 +1075,9 @@ export default class BalanceSheetMR extends Component { ...@@ -1072,6 +1075,9 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[7]).toFixed(1)
:
tableMeta.rowData[0] === 2 ? tableMeta.rowData[0] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat <NumberFormat
...@@ -1159,6 +1165,9 @@ export default class BalanceSheetMR extends Component { ...@@ -1159,6 +1165,9 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[8]).toFixed(1)
:
tableMeta.rowData[0] === 2 ? tableMeta.rowData[0] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat <NumberFormat
...@@ -1246,6 +1255,9 @@ export default class BalanceSheetMR extends Component { ...@@ -1246,6 +1255,9 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[9]).toFixed(1)
:
tableMeta.rowData[0] === 3 ? tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -1373,6 +1385,9 @@ export default class BalanceSheetMR extends Component { ...@@ -1373,6 +1385,9 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[10]).toFixed(1)
:
tableMeta.rowData[0] === 2 ? tableMeta.rowData[0] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat <NumberFormat
...@@ -1508,6 +1523,9 @@ export default class BalanceSheetMR extends Component { ...@@ -1508,6 +1523,9 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[11]).toFixed(1)
:
tableMeta.rowData[0] === 7 ? tableMeta.rowData[0] === 7 ?
(Number(handleValueFormula(tableMeta, 11)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 11)).toFixed(1) <= Number(this.state.maxValue)) ? (Number(handleValueFormula(tableMeta, 11)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 11)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat <NumberFormat
...@@ -1567,6 +1585,9 @@ export default class BalanceSheetMR extends Component { ...@@ -1567,6 +1585,9 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[12]).toFixed(1)
:
tableMeta.rowData[0] === 7 ? tableMeta.rowData[0] === 7 ?
(Number(handleValueFormula(tableMeta, 12)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 12)).toFixed(1) <= Number(this.state.maxValue)) ? (Number(handleValueFormula(tableMeta, 12)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 12)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat <NumberFormat
...@@ -1631,6 +1652,9 @@ export default class BalanceSheetMR extends Component { ...@@ -1631,6 +1652,9 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[13]).toFixed(1)
:
tableMeta.rowData[0] === 7 ? tableMeta.rowData[0] === 7 ?
(Number(handleValueFormula(tableMeta, 13)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 13)).toFixed(1) <= Number(this.state.maxValue)) ? (Number(handleValueFormula(tableMeta, 13)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 13)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat <NumberFormat
...@@ -1690,6 +1714,9 @@ export default class BalanceSheetMR extends Component { ...@@ -1690,6 +1714,9 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[14]).toFixed(1)
:
tableMeta.rowData[0] === 7 ? tableMeta.rowData[0] === 7 ?
(Number(handleValueFormula(tableMeta, 14)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 14)).toFixed(1) <= Number(this.state.maxValue)) ? (Number(handleValueFormula(tableMeta, 14)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 14)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat <NumberFormat
...@@ -1754,6 +1781,9 @@ export default class BalanceSheetMR extends Component { ...@@ -1754,6 +1781,9 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[15]).toFixed(1)
:
tableMeta.rowData[0] === 7 ? tableMeta.rowData[0] === 7 ?
(Number(handleValueFormula(tableMeta, 15)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 15)).toFixed(1) <= Number(this.state.maxValue)) ? (Number(handleValueFormula(tableMeta, 15)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 15)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat <NumberFormat
...@@ -1813,6 +1843,9 @@ export default class BalanceSheetMR extends Component { ...@@ -1813,6 +1843,9 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[16]).toFixed(1)
:
tableMeta.rowData[0] === 7 ? tableMeta.rowData[0] === 7 ?
(Number(handleValueFormula(tableMeta, 16)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 16)).toFixed(1) <= Number(this.state.maxValue)) ? (Number(handleValueFormula(tableMeta, 16)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta, 16)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat <NumberFormat
...@@ -1913,6 +1946,9 @@ export default class BalanceSheetMR extends Component { ...@@ -1913,6 +1946,9 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[0] === 1 ? null : {tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[0] === 1 ? null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[17]).toFixed(1)
:
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
// value={value} // value={value}
...@@ -2003,6 +2039,9 @@ export default class BalanceSheetMR extends Component { ...@@ -2003,6 +2039,9 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[0] === 1 ? null : {tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[0] === 1 ? null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[18]).toFixed(1)
:
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
// value={value} // value={value}
...@@ -2093,6 +2132,9 @@ export default class BalanceSheetMR extends Component { ...@@ -2093,6 +2132,9 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[0] === 1 ? null : {tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[0] === 1 ? null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[19]).toFixed(1)
:
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
// value={value} // value={value}
......
...@@ -580,7 +580,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -580,7 +580,7 @@ export default class CorporateAnnualTargetMR extends Component {
perfomanceScore = 'B+' perfomanceScore = 'B+'
} else if ( total >= 4.01 && total <= 4.75) { } else if ( total >= 4.01 && total <= 4.75) {
perfomanceScore = 'BS' perfomanceScore = 'BS'
} else { } else if ( total >= 4.76 && total <= 5.00) {
perfomanceScore = 'IST' perfomanceScore = 'IST'
} }
...@@ -601,7 +601,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -601,7 +601,7 @@ export default class CorporateAnnualTargetMR extends Component {
color = 'forestgreen' color = 'forestgreen'
} else if ( total >= 4.01 && total <= 4.75) { } else if ( total >= 4.01 && total <= 4.75) {
color = 'deepskyblue' color = 'deepskyblue'
} else { } else if ( total >= 4.76 && total <= 5.00) {
color = 'dodgerblue' color = 'dodgerblue'
} }
return color return color
...@@ -619,18 +619,18 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -619,18 +619,18 @@ export default class CorporateAnnualTargetMR extends Component {
} }
} }
const handleValueFormula = (tableMeta, colIdx) => { const handleValueFormula = (value, tableMeta, column, periode, forecast) => {
// loading = true
let splitFormula = String(tableMeta.rowData[3]).split(/([()@])/) let splitFormula = String(tableMeta.rowData[3]).split(/([()@])/)
let baru = [] let baru = []
let anjay = [] let anjay = []
splitFormula.map((item, index) => { splitFormula.map((item, index) => {
let items = String(item).substr(Number(String(item).length) - 1, 1) let items = String(item).substr(Number(String(item).length) - 1, 1)
let subForm = String(item).substr(0, Number(String(item).length) - 1) let subForm = String(item).substr(0, Number(String(item).length) - 1)
let re = /^[a-zA-Z0-9_]+$/; let re = /^[a-zA-Z0-9_]+$/;
if (item !== "") { if (item !== "") {
if (items == ']') { if (!re.test(items)) {
baru.push(String(item))
} else if (!re.test(items)) {
baru.push(subForm) baru.push(subForm)
baru.push(items) baru.push(items)
} else { } else {
...@@ -638,86 +638,123 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -638,86 +638,123 @@ export default class CorporateAnnualTargetMR extends Component {
} }
} }
}) })
console.log(splitFormula)
// console.log(baru); console.log(baru)
let tambahan = false
let opet = ""
baru.map((item, index) => { baru.map((item, index) => {
if (item == 'X') { if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') {
tambahan = true
} else if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') {
anjay.push(item) anjay.push(item)
} else { } else if (item == '' || item == '@') {
if (String(item).includes('#')) {
if (String(item).includes('[M-1]')) { // } else if (item == "CurrMonth") {
let tst = '@' + String(item).replace('[M-1]', '[M1]') // anjay.push(String(column))
console.log(tst); // } else if (item.includes('[CM]SUM')) {
let indexID = dataTable2[tableMeta.rowIndex][17].findIndex((val) => val.item_formula == tst) // let columnStart = 13
// let indexX = String(item).indexOf('[')
// let formulaAwal = String(item).substr(0, indexX)
// let columnEnd = 24
// let month = column - 1
// let total = 0
// // // // console.log(formulaAwal)
// if (forecast == undefined) {
// dataTable2[tableMeta.rowIndex].map((itemz, indexz) => {
// if (indexz >= columnStart && indexz <= columnStart + month) {
// let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${formulaAwal}`) && val.periode == Number(this.props.periode))
// if (indexID !== -1) {
// let valuezz = Number(value.formula[indexID].value)
// total += valuezz
// }
// }
// })
// } else {
// }
// anjay.push(String(total))
// } else if (item.includes('[CM]AVG')) {
// if (forecast == undefined) {
// anjay.push('/')
// anjay.push(column)
// }
}
else if (item.includes('X')) {
let indexX = String(item).indexOf('X')
if (indexX == 0) {
anjay.push(String(item).substr(1, String(item).length))
} else {
let formulaAwal = String(item).substr(0, indexX - 1)
let operatorX = String(item).substr(indexX - 1, 1)
let nilaiX = String(item).substr(indexX + 1, String(item).length)
if (forecast == undefined) {
console.log(formulaAwal)
console.log(tableMeta.rowData[17])
let indexID = tableMeta.rowData[17].findIndex((val) => val.item_formula == String(`@${formulaAwal}`) && val.periode == Number(this.props.periode))
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = dataTable2[tableMeta.rowIndex][17][indexID].value let valuezz = tableMeta.rowData[17][indexID].value
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
} }
} else { } else {
let data = tableMeta.rowData[17] == null? [] : tableMeta.rowData[17] // // // console.log(dataTable2[tableMeta.rowIndex][30])
let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`)) let array = dataTable2[tableMeta.rowIndex][30].filter((val) => val.periode == Number(column))
let valuezz = array[0].value
// // // console.log(valuezz)
anjay.push(valuezz == "" ? 0 : valuezz)
// let indexID = dataTable2[tableMeta.rowIndex][30].findIndex((val) => val.periode == Number(this.props.periode))
// if (indexID !== -1) {
// let valuezz = value.formula[indexID].value
// anjay.push(valuezz == "" ? 0 : valuezz)
// }
}
anjay.push(operatorX)
anjay.push(nilaiX)
}
} else {
if (String(item).includes('#')) {
if (forecast == undefined) {
let indexID = tableMeta.rowData[17].findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode))
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = data[indexID].value let valuezz = tableMeta.rowData[17][indexID].value
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" || valuezz == null ? "0" : valuezz)
} }
} }
} else { } else {
if (String(item).includes('[M-1]')) { let indexID = dataTable2.findIndex((val) => val[31] == item)
let tst = String(item).replace('[M-1]', '') if (indexID !== -1) {
let indexID = dataTable2.findIndex((val) => val[17] == tst) let valuezz = dataTable2[indexID][column].value == undefined ? dataTable2[indexID][column] : dataTable2[indexID][column].value
if (indexID !== -1) { if (item == dataTable2[tableMeta.rowIndex][31]) {
let valuezz = dataTable2[indexID][8] anjay.push(0)
anjay.push(valuezz == "" ? 0 : valuezz) } else {
anjay.push(valuezz == "" ? "0" : valuezz)
} }
} else { } else {
let indexID = dataTable2.findIndex((val) => val[17] == item) if (item === '(-1)') {
if (item == 'X-1') {
anjay.push(-1) anjay.push(-1)
} else if (tambahan) {
if (item == '-' || item == '+' || item == '/' || item == '*') {
opet = item
} else {
anjay.push(opet == ''? Number(item) : Number(String(opet + String(item))))
tambahan = false
opet = ""
}
} else {
if (indexID !== -1) {
let valuezz = dataTable2[indexID][colIdx]
if (item == dataTable2[tableMeta.rowIndex][28]) {
anjay.push(0)
} else {
anjay.push(valuezz == "" ? 0 : valuezz)
}
} else {
if (item === '(-1)') {
anjay.push(-1)
}
}
} }
} }
} }
} }
}) })
console.log(baru) // console.log(baru)
console.log(anjay) // console.log(anjay)
let anjay2 = [] let anjay2 = []
let kurung = false let kurung = false
let item1 = [] let item1 = []
let brpKurung = 0
anjay.map((item, index) => { anjay.map((item, index) => {
if (item == "(") { if (item == "(") {
kurung = true kurung = true
// brpKurung += 1
} else if (item == ")") { } else if (item == ")") {
// brpKurung -= 1
// if (brpKurung == 0) {
kurung = false kurung = false
anjay2.push(item1) anjay2.push(item1)
item1 = [] item1 = []
// }
} else { } else {
if (kurung) { if (kurung) {
item1.push(item) item1.push(item)
...@@ -821,8 +858,26 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -821,8 +858,26 @@ export default class CorporateAnnualTargetMR extends Component {
} }
}) })
total = R.equals(total, NaN) ? "0.0" : total console.log(anjay)
dataTable2[tableMeta.rowIndex][colIdx] = total console.log(anjay2)
console.log(total)
total = dataTable2[tableMeta.rowIndex][5] == "ROIC" ? "0" : R.equals(total, NaN) ? "0.0" : total
if (dataTable2[tableMeta.rowIndex][5] == "ROIC") {
dataTable2[tableMeta.rowIndex][column] = 0
// if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].value == undefined) {
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = "0"
// } else {
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].value = "0"
// }
} else {
dataTable2[tableMeta.rowIndex][column] = total
// if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].value == undefined) {
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = total
// } else {
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].value = total
// }
}
return total return total
} }
...@@ -881,7 +936,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -881,7 +936,7 @@ export default class CorporateAnnualTargetMR extends Component {
} else { } else {
// if ((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')) { // if ((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')) {
if (idParent !== null) { if (idParent !== null) {
console.log(tableMeta) // console.log(tableMeta)
let indexsss = dataTable2.findIndex((val) => val[1] == idParent) let indexsss = dataTable2.findIndex((val) => val[1] == idParent)
if (dataTable2[indexsss][5] == 'CUSTOMER PERSPECTIVE' || dataTable2[indexsss][5] == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') { if (dataTable2[indexsss][5] == 'CUSTOMER PERSPECTIVE' || dataTable2[indexsss][5] == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') {
return true return true
...@@ -1015,6 +1070,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1015,6 +1070,7 @@ export default class CorporateAnnualTargetMR extends Component {
total = 0 total = 0
} else { } else {
total = Number(tableMeta.rowData[14]) * Number(handlePercent) / 100 total = Number(tableMeta.rowData[14]) * Number(handlePercent) / 100
console.log(total)
} }
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total).toFixed(1) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total).toFixed(1)
return total return total
...@@ -1230,6 +1286,9 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1230,6 +1286,9 @@ export default class CorporateAnnualTargetMR extends Component {
{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
: :
this.state.get_for == 'view'?
Number(value).toFixed(1)
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1240,7 +1299,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1240,7 +1299,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: 'center', 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: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={ tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6? Number(handleValueFormula(tableMeta, tableMeta.columnIndex)) : Number(value).toFixed(1)} value={ tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6? Number(handleValueFormula(value, tableMeta, tableMeta.columnIndex)) : 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}
...@@ -1271,6 +1330,9 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1271,6 +1330,9 @@ export default class CorporateAnnualTargetMR extends Component {
<div style={{ width: 75 }}> <div style={{ width: 75 }}>
{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 :
this.state.get_for == 'view'?
Number(value).toFixed(1)
:
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={value} value={value}
...@@ -1309,6 +1371,9 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1309,6 +1371,9 @@ export default class CorporateAnnualTargetMR extends Component {
<div style={{ width: 75 }}> <div style={{ width: 75 }}>
{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 :
this.state.get_for == 'view'?
Number(value).toFixed(1)
:
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={value} value={value}
...@@ -1347,6 +1412,9 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1347,6 +1412,9 @@ export default class CorporateAnnualTargetMR extends Component {
<div style={{ width: 70 }}> <div style={{ width: 70 }}>
{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 :
this.state.get_for == 'view'?
Number(value).toFixed(1)
:
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={value} value={value}
...@@ -1385,6 +1453,9 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1385,6 +1453,9 @@ export default class CorporateAnnualTargetMR extends Component {
<div style={{ width: 75 }}> <div style={{ width: 75 }}>
{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 :
this.state.get_for == 'view'?
Number(value).toFixed(1)
:
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={value} value={value}
...@@ -1424,6 +1495,9 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1424,6 +1495,9 @@ export default class CorporateAnnualTargetMR extends Component {
{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
: :
this.state.get_for == 'view'?
value
:
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
control={ control={
......
...@@ -848,6 +848,9 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -848,6 +848,9 @@ export default class FixedAssetsMovementMR extends Component {
{ {
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 4 ? tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 4 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[8]).toFixed(1)
:
tableMeta.rowData[0] === 3 ? tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -919,6 +922,9 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -919,6 +922,9 @@ export default class FixedAssetsMovementMR extends Component {
{ {
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 4 ? tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 4 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[9]).toFixed(1)
:
tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat <NumberFormat
...@@ -1017,6 +1023,9 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -1017,6 +1023,9 @@ export default class FixedAssetsMovementMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[10]).toFixed(1)
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1039,7 +1048,10 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -1039,7 +1048,10 @@ export default class FixedAssetsMovementMR extends Component {
<div className="column-2"> <div className="column-2">
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[11]).toFixed(1)
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1068,6 +1080,9 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -1068,6 +1080,9 @@ export default class FixedAssetsMovementMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[12]).toFixed(1)
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1090,7 +1105,10 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -1090,7 +1105,10 @@ export default class FixedAssetsMovementMR extends Component {
<div className="column-2"> <div className="column-2">
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[13]).toFixed(1)
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1119,6 +1137,9 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -1119,6 +1137,9 @@ export default class FixedAssetsMovementMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[14]).toFixed(1)
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1141,7 +1162,10 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -1141,7 +1162,10 @@ export default class FixedAssetsMovementMR extends Component {
<div className="column-2"> <div className="column-2">
<div style={{ textAlign: 'right', width: 120 }}> <div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(tableMeta.rowData[15]).toFixed(1)
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
......
...@@ -881,6 +881,9 @@ export default class TaxPlanningMR extends Component { ...@@ -881,6 +881,9 @@ export default class TaxPlanningMR extends Component {
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[1] === 4 || tableMeta.rowData[1] === 1 ? {tableMeta.rowData[1] === 4 || tableMeta.rowData[1] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(value.tbc).toFixed(1)
:
tableMeta.rowData[1] === 2 ? tableMeta.rowData[1] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat <NumberFormat
...@@ -943,6 +946,9 @@ export default class TaxPlanningMR extends Component { ...@@ -943,6 +946,9 @@ export default class TaxPlanningMR extends Component {
{tableMeta.rowData[2] === 4 || tableMeta.rowData[2] === 1 ? {tableMeta.rowData[2] === 4 || tableMeta.rowData[2] === 1 ?
null null
: :
this.state.get_for == 'view'?
Number(value.fcp).toFixed(1)
:
tableMeta.rowData[2] === 2 ? tableMeta.rowData[2] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat <NumberFormat
...@@ -1003,6 +1009,9 @@ export default class TaxPlanningMR extends Component { ...@@ -1003,6 +1009,9 @@ export default class TaxPlanningMR extends Component {
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ? {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null : null :
this.state.get_for == 'view'?
Number(value.tbf).toFixed(1)
:
tableMeta.rowData[3] === 2 ? tableMeta.rowData[3] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat <NumberFormat
...@@ -1130,6 +1139,9 @@ export default class TaxPlanningMR extends Component { ...@@ -1130,6 +1139,9 @@ export default class TaxPlanningMR extends Component {
{tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ? {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null null
: :
this.state.get_for == 'view'?
Number(value).toFixed(1)
:
tableMeta.rowData[3] === 2 ? tableMeta.rowData[3] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat <NumberFormat
...@@ -1224,6 +1236,9 @@ export default class TaxPlanningMR extends Component { ...@@ -1224,6 +1236,9 @@ export default class TaxPlanningMR extends Component {
{tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ? {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null null
: :
this.state.get_for == 'view'?
Number(value).toFixed(1)
:
tableMeta.rowData[3] === 2 ? tableMeta.rowData[3] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat <NumberFormat
......
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