Commit 817a4bad authored by Hardiansyah's avatar Hardiansyah

Fix logic

parent 3138a75b
...@@ -22,19 +22,28 @@ const style2 = { ...@@ -22,19 +22,28 @@ const style2 = {
}; };
export default class TableSummaryTriputra extends Component { export default class TableSummaryTriputra extends Component {
getInputColor = ({ val, column = null }) => { getInputColor = ({ val, column }) => {
const COLUMN_RULE = { // const COLUMN_INDEX = {
MTD: 37, // MTD: 37,
YTD: 45, // YTD: 45,
CPSM: 49 // CPSM: 49,
}; // };
const isEditable = // if (val[2] === 0 || val[2] === 1) {
![0, 1].includes(val[2]) && // return Constant.COLORS_TEXT_COLUMNS.disabled;
!val[COLUMN_RULE[column]]; // }
return isEditable ? Constant.COLORS_TEXT_COLUMNS.active : Constant.COLORS_TEXT_COLUMNS.disabled; // const idx = COLUMN_INDEX[column];
// if (idx === undefined) {
// return Constant.COLORS_TEXT_COLUMNS.disabled;
// }
// return val[idx]
// ? Constant.COLORS_TEXT_COLUMNS.disabled
// : Constant.COLORS_TEXT_COLUMNS.active;
return Constant.COLORS_TEXT_COLUMNS.disabled
}; };
formattingNumber = (v, decimal = 1) => { formattingNumber = (v, decimal = 1) => {
if (v === null || v === undefined || v === '') return ''; if (v === null || v === undefined || v === '') return '';
......
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