Commit fb50741a authored by r.kurnia's avatar r.kurnia

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into rifka

parents 249c9ab9 22de988c
...@@ -66,7 +66,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -66,7 +66,7 @@ export default class CorporateAnnualTarget extends Component {
loading: false, loading: false,
uomList: [], uomList: [],
formulaYtdList: { formulaYtdList: {
options: [{ value: 'SUM' }, { value: 'AVG' }, { value: 'LAST' }], options: [{ value: 'SUM' }, { value: 'AVG' }, { value: 'LAST' }, { value: 'FORMULA' }],
getOptionLabel: (option) => titleCase(option.value), getOptionLabel: (option) => titleCase(option.value),
}, },
kpiTypeList: [], kpiTypeList: [],
...@@ -173,27 +173,27 @@ export default class CorporateAnnualTarget extends Component { ...@@ -173,27 +173,27 @@ export default class CorporateAnnualTarget extends Component {
item.level, item.level,
"", "",
item.description, item.description,
item.type_report_id == 1 ? `${Number(item.weight) * 100}%` : (String(Number(String(item.cat.weight).substr(0,String(item.cat.weight).length-1)).toFixed(1)) + '%'), item.type_report_id == 1 ? `${Number(item.weight) * 100}%` : (String(Number(String(item.cat.weight).substr(0, String(item.cat.weight).length - 1)).toFixed(1)) + '%'),
parentTrue ? item.cat.uom : item.uom, parentTrue ? item.cat.uom : item.uom,
parentTrue ? item.cat.kpi_type == "" ? null : { value: item.cat.kpi_type } : item.kpi_type == "" ? null : { value: item.kpi_type }, parentTrue ? item.cat.kpi_type == "" ? null : { value: item.cat.kpi_type } : item.kpi_type == "" ? null : { value: item.kpi_type },
parentTrue ? item.cat.max_ach == "" ? null : { value: titleCase(item.cat.max_ach) } : item.max_ach == "" ? null : { value: titleCase(item.max_ach) }, parentTrue ? item.cat.max_ach == "" ? null : { value: titleCase(item.cat.max_ach) } : item.max_ach == "" ? null : { value: titleCase(item.max_ach) },
parentTrue ? item.cat.formula == "" ? null : { value: item.cat.formula } : item.formula_ytd == "" ? null : { value: item.formula_ytd }, parentTrue ? item.cat.formula == "" ? null : { value: item.cat.formula } : item.formula_ytd == "" ? null : { value: item.formula_ytd },
item.cat.total_actual_before == "" ? item.cat.total_actual_before : String(item.cat.total_actual_before).indexOf(".") == -1 ? Number(item.cat.total_actual_before) : Number(item.cat.total_actual_before).toFixed(1), item.cat.total_actual_before == "" ? item.cat.total_actual_before : String(item.cat.total_actual_before).indexOf(".") == -1 ? Number(item.cat.total_actual_before) : Number(item.cat.total_actual_before).toFixed(1),
item.description === 'ROIC' ? Number(item.cat.january).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3? (item.cat.january == "" ? item.cat.january : String(item.cat.january).indexOf(".") == -1 ? Number(item.cat.january) : Number(item.cat.january).toFixed(1)) : { value: item.cat.january, formula: item.cat.january_formula } : (item.cat.january == "" ? item.cat.january : String(item.cat.january).indexOf(".") == -1 ? Number(item.cat.january) : Number(item.cat.january).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.cat.january == "" ? item.cat.january : String(item.cat.january).indexOf(".") == -1 ? Number(item.cat.january) : Number(item.cat.january).toFixed(1)) : { value: item.cat.january, formula: item.cat.january_formula } : (item.cat.january == "" ? item.cat.january : String(item.cat.january).indexOf(".") == -1 ? Number(item.cat.january) : Number(item.cat.january).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.february).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3? (item.cat.february == "" ? item.cat.february : String(item.cat.february).indexOf(".") == -1 ? Number(item.cat.february) : Number(item.cat.february).toFixed(1)) : { value: item.cat.february, formula: item.cat.february_formula } : (item.cat.february == "" ? item.cat.february : String(item.cat.february).indexOf(".") == -1 ? Number(item.cat.february) : Number(item.cat.february).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.cat.february == "" ? item.cat.february : String(item.cat.february).indexOf(".") == -1 ? Number(item.cat.february) : Number(item.cat.february).toFixed(1)) : { value: item.cat.february, formula: item.cat.february_formula } : (item.cat.february == "" ? item.cat.february : String(item.cat.february).indexOf(".") == -1 ? Number(item.cat.february) : Number(item.cat.february).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.march).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3? (item.cat.march == "" ? item.cat.march : String(item.cat.march).indexOf(".") == -1 ? Number(item.cat.march) : Number(item.cat.march).toFixed(1)) : { value: item.cat.march, formula: item.cat.march_formula } : (item.cat.march == "" ? item.cat.march : String(item.cat.march).indexOf(".") == -1 ? Number(item.cat.march) : Number(item.cat.march).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.cat.march == "" ? item.cat.march : String(item.cat.march).indexOf(".") == -1 ? Number(item.cat.march) : Number(item.cat.march).toFixed(1)) : { value: item.cat.march, formula: item.cat.march_formula } : (item.cat.march == "" ? item.cat.march : String(item.cat.march).indexOf(".") == -1 ? Number(item.cat.march) : Number(item.cat.march).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.april).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3? (item.cat.april == "" ? item.cat.april : String(item.cat.april).indexOf(".") == -1 ? Number(item.cat.april) : Number(item.cat.april).toFixed(1)) : { value: item.cat.april, formula: item.cat.april_formula } : (item.cat.april == "" ? item.cat.april : String(item.cat.april).indexOf(".") == -1 ? Number(item.cat.april) : Number(item.cat.april).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.cat.april == "" ? item.cat.april : String(item.cat.april).indexOf(".") == -1 ? Number(item.cat.april) : Number(item.cat.april).toFixed(1)) : { value: item.cat.april, formula: item.cat.april_formula } : (item.cat.april == "" ? item.cat.april : String(item.cat.april).indexOf(".") == -1 ? Number(item.cat.april) : Number(item.cat.april).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.may).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3? (item.cat.may == "" ? item.cat.may : String(item.cat.may).indexOf(".") == -1 ? Number(item.cat.may) : Number(item.cat.may).toFixed(1)) : { value: item.cat.may, formula: item.cat.may_formula } : (item.cat.may == "" ? item.cat.may : String(item.cat.may).indexOf(".") == -1 ? Number(item.cat.may) : Number(item.cat.may).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.cat.may == "" ? item.cat.may : String(item.cat.may).indexOf(".") == -1 ? Number(item.cat.may) : Number(item.cat.may).toFixed(1)) : { value: item.cat.may, formula: item.cat.may_formula } : (item.cat.may == "" ? item.cat.may : String(item.cat.may).indexOf(".") == -1 ? Number(item.cat.may) : Number(item.cat.may).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.june).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3? (item.cat.june == "" ? item.cat.june : String(item.cat.june).indexOf(".") == -1 ? Number(item.cat.june) : Number(item.cat.june).toFixed(1)) : { value: item.cat.june, formula: item.cat.june_formula } : item.description === 'ROIC' ? Number(item.cat.june).toFixed(1) : (item.cat.june == "" ? item.cat.june : String(item.cat.june).indexOf(".") == -1 ? Number(item.cat.june) : Number(item.cat.june).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.cat.june == "" ? item.cat.june : String(item.cat.june).indexOf(".") == -1 ? Number(item.cat.june) : Number(item.cat.june).toFixed(1)) : { value: item.cat.june, formula: item.cat.june_formula } : (item.cat.june == "" ? item.cat.june : String(item.cat.june).indexOf(".") == -1 ? Number(item.cat.june) : Number(item.cat.june).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.july).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3? (item.cat.july == "" ? item.cat.july : String(item.cat.july).indexOf(".") == -1 ? Number(item.cat.july) : Number(item.cat.july).toFixed(1)) : { value: item.cat.july, formula: item.cat.july_formula } : item.description === 'ROIC' ? Number(item.cat.july).toFixed(1) : (item.cat.july == "" ? item.cat.july : String(item.cat.july).indexOf(".") == -1 ? Number(item.cat.july) : Number(item.cat.july).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.cat.july == "" ? item.cat.july : String(item.cat.july).indexOf(".") == -1 ? Number(item.cat.july) : Number(item.cat.july).toFixed(1)) : { value: item.cat.july, formula: item.cat.july_formula } : (item.cat.july == "" ? item.cat.july : String(item.cat.july).indexOf(".") == -1 ? Number(item.cat.july) : Number(item.cat.july).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.august).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3? (item.cat.august == "" ? item.cat.august : String(item.cat.august).indexOf(".") == -1 ? Number(item.cat.august) : Number(item.cat.august).toFixed(1)) : { value: item.cat.august, formula: item.cat.august_formula } : (item.cat.august == "" ? item.cat.august : String(item.cat.august).indexOf(".") == -1 ? Number(item.cat.august) : Number(item.cat.august).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.cat.august == "" ? item.cat.august : String(item.cat.august).indexOf(".") == -1 ? Number(item.cat.august) : Number(item.cat.august).toFixed(1)) : { value: item.cat.august, formula: item.cat.august_formula } : (item.cat.august == "" ? item.cat.august : String(item.cat.august).indexOf(".") == -1 ? Number(item.cat.august) : Number(item.cat.august).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.september).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3? (item.cat.september == "" ? item.cat.september : String(item.cat.september).indexOf(".") == -1 ? Number(item.cat.september) : Number(item.cat.september).toFixed(1)) : { value: item.cat.september, formula: item.cat.september_formula } : (item.cat.september == "" ? item.cat.september : String(item.cat.september).indexOf(".") == -1 ? Number(item.cat.september) : Number(item.cat.september).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.cat.september == "" ? item.cat.september : String(item.cat.september).indexOf(".") == -1 ? Number(item.cat.september) : Number(item.cat.september).toFixed(1)) : { value: item.cat.september, formula: item.cat.september_formula } : (item.cat.september == "" ? item.cat.september : String(item.cat.september).indexOf(".") == -1 ? Number(item.cat.september) : Number(item.cat.september).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.october).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3? (item.cat.october == "" ? item.cat.october : String(item.cat.october).indexOf(".") == -1 ? Number(item.cat.october) : Number(item.cat.october).toFixed(1)) : { value: item.cat.october, formula: item.cat.october_formula } : (item.cat.october == "" ? item.cat.october : String(item.cat.october).indexOf(".") == -1 ? Number(item.cat.october) : Number(item.cat.october).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.cat.october == "" ? item.cat.october : String(item.cat.october).indexOf(".") == -1 ? Number(item.cat.october) : Number(item.cat.october).toFixed(1)) : { value: item.cat.october, formula: item.cat.october_formula } : (item.cat.october == "" ? item.cat.october : String(item.cat.october).indexOf(".") == -1 ? Number(item.cat.october) : Number(item.cat.october).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.november).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3? (item.cat.november == "" ? item.cat.november : String(item.cat.november).indexOf(".") == -1 ? Number(item.cat.november) : Number(item.cat.november).toFixed(1)) : { value: item.cat.november, formula: item.cat.november_formula } : (item.cat.november == "" ? item.cat.november : String(item.cat.november).indexOf(".") == -1 ? Number(item.cat.november) : Number(item.cat.november).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.cat.november == "" ? item.cat.november : String(item.cat.november).indexOf(".") == -1 ? Number(item.cat.november) : Number(item.cat.november).toFixed(1)) : { value: item.cat.november, formula: item.cat.november_formula } : (item.cat.november == "" ? item.cat.november : String(item.cat.november).indexOf(".") == -1 ? Number(item.cat.november) : Number(item.cat.november).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.december).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3? (item.cat.december == "" ? item.cat.december : String(item.cat.december).indexOf(".") == -1 ? Number(item.cat.december) : Number(item.cat.december).toFixed(1)) : { value: item.cat.december, formula: item.cat.december_formula } : (item.cat.december == "" ? item.cat.december : String(item.cat.december).indexOf(".") == -1 ? Number(item.cat.december) : Number(item.cat.december).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.cat.december == "" ? item.cat.december : String(item.cat.december).indexOf(".") == -1 ? Number(item.cat.december) : Number(item.cat.december).toFixed(1)) : { value: item.cat.december, formula: item.cat.december_formula } : (item.cat.december == "" ? item.cat.december : String(item.cat.december).indexOf(".") == -1 ? Number(item.cat.december) : Number(item.cat.december).toFixed(1)),
item.cat.total_current_year == "" ? 0 : String(item.cat.total_current_year).indexOf(".") == -1 ? Number(item.cat.total_current_year) : Number(item.cat.total_current_year).toFixed(1), item.cat.total_current_year == "" ? 0 : String(item.cat.total_current_year).indexOf(".") == -1 ? Number(item.cat.total_current_year) : Number(item.cat.total_current_year).toFixed(1),
item.description === 'ROIC' ? Number(item.cat.total_next_year).toFixed(1) : item.cat.total_next_year == "" ? item.cat.total_next_year : String(item.cat.total_next_year).indexOf(".") == -1 ? Number(item.cat.total_next_year) : Number(item.cat.total_next_year).toFixed(1), item.cat.total_next_year == "" ? item.cat.total_next_year : String(item.cat.total_next_year).indexOf(".") == -1 ? Number(item.cat.total_next_year) : Number(item.cat.total_next_year).toFixed(1),
item.description === 'ROIC' ? Number(item.cat.total_more_year).toFixed(1) : item.cat.total_more_year == "" ? item.cat.total_more_year : String(item.cat.total_more_year).indexOf(".") == -1 ? Number(item.cat.total_more_year) : Number(item.cat.total_more_year).toFixed(1), item.cat.total_more_year == "" ? item.cat.total_more_year : String(item.cat.total_more_year).indexOf(".") == -1 ? Number(item.cat.total_more_year) : Number(item.cat.total_more_year).toFixed(1),
item.cat.strategic, item.cat.strategic,
item.cat.pic, item.cat.pic,
item.cat.forecast_formula, item.cat.forecast_formula,
...@@ -217,27 +217,27 @@ export default class CorporateAnnualTarget extends Component { ...@@ -217,27 +217,27 @@ export default class CorporateAnnualTarget extends Component {
item.level, item.level,
"", "",
item.description, item.description,
item.type_report_id == 1 ? `${Number(item.weight) * 100}%` : (String(Number(String(item.cat.weight).substr(0,String(item.cat.weight).length-1)).toFixed(1)) + '%'), item.type_report_id == 1 ? `${Number(item.weight) * 100}%` : (String(Number(String(item.cat.weight).substr(0, String(item.cat.weight).length - 1)).toFixed(1)) + '%'),
item.cat.uom, item.cat.uom,
item.kpi_type == "" ? null : { value: item.kpi_type }, item.kpi_type == "" ? null : { value: item.kpi_type },
item.max_ach == "" ? null : { value: titleCase(item.max_ach) }, item.max_ach == "" ? null : { value: titleCase(item.max_ach) },
item.formula == "" ? null : { value: item.formula_ytd }, item.formula == "" ? null : { value: item.formula_ytd },
item.cat.total_actual_before == "" ? item.cat.total_actual_before : String(item.cat.total_actual_before).indexOf(".") == -1 ? Number(item.cat.total_actual_before) : Number(item.cat.total_actual_before).toFixed(1), item.cat.total_actual_before == "" ? item.cat.total_actual_before : String(item.cat.total_actual_before).indexOf(".") == -1 ? Number(item.cat.total_actual_before) : Number(item.cat.total_actual_before).toFixed(1),
item.description === 'ROIC' ? Number(item.cat.january).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.january, formula: item.cat.january_formula } : (item.cat.january == "" ? item.cat.january : String(item.cat.january).indexOf(".") == -1 ? Number(item.cat.january) : Number(item.cat.january).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.january, formula: item.cat.january_formula } : (item.cat.january == "" ? item.cat.january : String(item.cat.january).indexOf(".") == -1 ? Number(item.cat.january) : Number(item.cat.january).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.february).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.february, formula: item.cat.february_formula } : (item.cat.february == "" ? item.cat.february : String(item.cat.february).indexOf(".") == -1 ? Number(item.cat.february) : Number(item.cat.february).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.february, formula: item.cat.february_formula } : (item.cat.february == "" ? item.cat.february : String(item.cat.february).indexOf(".") == -1 ? Number(item.cat.february) : Number(item.cat.february).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.march).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.march, formula: item.cat.march_formula } : (item.cat.march == "" ? item.cat.march : String(item.cat.march).indexOf(".") == -1 ? Number(item.cat.march) : Number(item.cat.march).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.march, formula: item.cat.march_formula } : (item.cat.march == "" ? item.cat.march : String(item.cat.march).indexOf(".") == -1 ? Number(item.cat.march) : Number(item.cat.march).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.april).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.april, formula: item.cat.april_formula } : (item.cat.april == "" ? item.cat.april : String(item.cat.april).indexOf(".") == -1 ? Number(item.cat.april) : Number(item.cat.april).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.april, formula: item.cat.april_formula } : (item.cat.april == "" ? item.cat.april : String(item.cat.april).indexOf(".") == -1 ? Number(item.cat.april) : Number(item.cat.april).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.may).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.may, formula: item.cat.may_formula } : (item.cat.may == "" ? item.cat.may : String(item.cat.may).indexOf(".") == -1 ? Number(item.cat.may) : Number(item.cat.may).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.may, formula: item.cat.may_formula } : (item.cat.may == "" ? item.cat.may : String(item.cat.may).indexOf(".") == -1 ? Number(item.cat.may) : Number(item.cat.may).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.june).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.june, formula: item.cat.june_formula } : item.description === 'ROIC' ? Number(item.cat.june).toFixed(1) : (item.cat.june == "" ? item.cat.june : String(item.cat.june).indexOf(".") == -1 ? Number(item.cat.june) : Number(item.cat.june).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.june, formula: item.cat.june_formula } : (item.cat.june == "" ? item.cat.june : String(item.cat.june).indexOf(".") == -1 ? Number(item.cat.june) : Number(item.cat.june).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.july).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.july, formula: item.cat.july_formula } : item.description === 'ROIC' ? Number(item.cat.july).toFixed(1) : (item.cat.july == "" ? item.cat.july : String(item.cat.july).indexOf(".") == -1 ? Number(item.cat.july) : Number(item.cat.july).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.july, formula: item.cat.july_formula } : (item.cat.july == "" ? item.cat.july : String(item.cat.july).indexOf(".") == -1 ? Number(item.cat.july) : Number(item.cat.july).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.august).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.august, formula: item.cat.august_formula } : (item.cat.august == "" ? item.cat.august : String(item.cat.august).indexOf(".") == -1 ? Number(item.cat.august) : Number(item.cat.august).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.august, formula: item.cat.august_formula } : (item.cat.august == "" ? item.cat.august : String(item.cat.august).indexOf(".") == -1 ? Number(item.cat.august) : Number(item.cat.august).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.september).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.september, formula: item.cat.september_formula } : (item.cat.september == "" ? item.cat.september : String(item.cat.september).indexOf(".") == -1 ? Number(item.cat.september) : Number(item.cat.september).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.september, formula: item.cat.september_formula } : (item.cat.september == "" ? item.cat.september : String(item.cat.september).indexOf(".") == -1 ? Number(item.cat.september) : Number(item.cat.september).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.october).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.october, formula: item.cat.october_formula } : (item.cat.october == "" ? item.cat.october : String(item.cat.october).indexOf(".") == -1 ? Number(item.cat.october) : Number(item.cat.october).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.october, formula: item.cat.october_formula } : (item.cat.october == "" ? item.cat.october : String(item.cat.october).indexOf(".") == -1 ? Number(item.cat.october) : Number(item.cat.october).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.november).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.november, formula: item.cat.november_formula } : (item.cat.november == "" ? item.cat.november : String(item.cat.november).indexOf(".") == -1 ? Number(item.cat.november) : Number(item.cat.november).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.november, formula: item.cat.november_formula } : (item.cat.november == "" ? item.cat.november : String(item.cat.november).indexOf(".") == -1 ? Number(item.cat.november) : Number(item.cat.november).toFixed(1)),
item.description === 'ROIC' ? Number(item.cat.december).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.december, formula: item.cat.december_formula } : (item.cat.december == "" ? item.cat.december : String(item.cat.december).indexOf(".") == -1 ? Number(item.cat.december) : Number(item.cat.december).toFixed(1)), item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.cat.december, formula: item.cat.december_formula } : (item.cat.december == "" ? item.cat.december : String(item.cat.december).indexOf(".") == -1 ? Number(item.cat.december) : Number(item.cat.december).toFixed(1)),
item.cat.total_current_year == "" ? 0 : String(item.cat.total_current_year).indexOf(".") == -1 ? Number(item.cat.total_current_year) : Number(item.cat.total_current_year).toFixed(1), item.cat.total_current_year == "" ? 0 : String(item.cat.total_current_year).indexOf(".") == -1 ? Number(item.cat.total_current_year) : Number(item.cat.total_current_year).toFixed(1),
item.description === 'ROIC' ? Number(item.cat.total_next_year).toFixed(1) : item.cat.total_next_year == "" ? item.cat.total_next_year : String(item.cat.total_next_year).indexOf(".") == -1 ? Number(item.cat.total_next_year) : Number(item.cat.total_next_year).toFixed(1), item.cat.total_next_year == "" ? item.cat.total_next_year : String(item.cat.total_next_year).indexOf(".") == -1 ? Number(item.cat.total_next_year) : Number(item.cat.total_next_year).toFixed(1),
item.description === 'ROIC' ? Number(item.cat.total_more_year).toFixed(1) : item.cat.total_more_year == "" ? item.cat.total_more_year : String(item.cat.total_more_year).indexOf(".") == -1 ? Number(item.cat.total_more_year) : Number(item.cat.total_more_year).toFixed(1), item.cat.total_more_year == "" ? item.cat.total_more_year : String(item.cat.total_more_year).indexOf(".") == -1 ? Number(item.cat.total_more_year) : Number(item.cat.total_more_year).toFixed(1),
item.cat.strategic, item.cat.strategic,
item.cat.pic, item.cat.pic,
item.cat.forecast_formula, item.cat.forecast_formula,
...@@ -252,7 +252,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -252,7 +252,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)
}) })
} else { } else {
...@@ -361,7 +361,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -361,7 +361,7 @@ export default class CorporateAnnualTarget extends Component {
weight: i[2] === undefined ? "" : String(Number(i[2] * 100).toFixed(1)) + '%', weight: i[2] === undefined ? "" : String(Number(i[2] * 100).toFixed(1)) + '%',
uom: i[3] === undefined ? "" : String(i[3]).trim(), uom: i[3] === undefined ? "" : String(i[3]).trim(),
kpi_type: i[4] === undefined ? "" : String(i[4]).trim(), kpi_type: i[4] === undefined ? "" : String(i[4]).trim(),
max_ach: i[5] === undefined ? "" : String(i[5]).toLocaleLowerCase() !== 'unlimited' ? (String(i[5]).includes('%')? String(i[5].trim()) : String(Number(i[5] * 100) + '%')) : String(i[5]).trim(), max_ach: i[5] === undefined ? "" : String(i[5]).toLocaleLowerCase() !== 'unlimited' ? (String(i[5]).includes('%') ? String(i[5].trim()) : String(Number(i[5] * 100) + '%')) : String(i[5]).trim(),
formula: i[6] === undefined ? "" : String(i[6]).trim(), formula: i[6] === undefined ? "" : String(i[6]).trim(),
total_actual_before: i[7] === undefined ? "0.0" : reg.test(String(i[7])) === false ? "0.0" : String(Number(i[7]).toFixed(1)).trim(), total_actual_before: i[7] === undefined ? "0.0" : reg.test(String(i[7])) === false ? "0.0" : String(Number(i[7]).toFixed(1)).trim(),
january: i[8] === undefined ? "0.0" : reg.test(String(i[8])) === false ? "0.0" : String(Number(i[8]).toFixed(1)).trim(), january: i[8] === undefined ? "0.0" : reg.test(String(i[8])) === false ? "0.0" : String(Number(i[8]).toFixed(1)).trim(),
...@@ -390,7 +390,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -390,7 +390,7 @@ export default class CorporateAnnualTarget extends Component {
weight: i[2] === undefined ? "" : String(Number(i[2] * 100).toFixed(1)) + '%', weight: i[2] === undefined ? "" : String(Number(i[2] * 100).toFixed(1)) + '%',
uom: i[3] === undefined ? "" : String(i[3]).trim(), uom: i[3] === undefined ? "" : String(i[3]).trim(),
kpi_type: i[4] === undefined ? "" : String(i[4]).trim(), kpi_type: i[4] === undefined ? "" : String(i[4]).trim(),
max_ach: i[5] === undefined ? "" : String(i[5]).toLocaleLowerCase() !== 'unlimited' ? (String(i[5]).includes('%')? String(i[5].trim()) : String(Number(i[5] * 100) + '%')) : String(i[5]).trim(), max_ach: i[5] === undefined ? "" : String(i[5]).toLocaleLowerCase() !== 'unlimited' ? (String(i[5]).includes('%') ? String(i[5].trim()) : String(Number(i[5] * 100) + '%')) : String(i[5]).trim(),
formula: i[6] === undefined ? "" : String(i[6]).trim(), formula: i[6] === undefined ? "" : String(i[6]).trim(),
total_actual_before: i[7] === undefined ? "0.0" : reg.test(String(i[7])) === false ? "0.0" : String(Number(i[7]).toFixed(1)).trim(), total_actual_before: i[7] === undefined ? "0.0" : reg.test(String(i[7])) === false ? "0.0" : String(Number(i[7]).toFixed(1)).trim(),
january: i[8] === undefined ? "0.0" : reg.test(String(i[8])) === false ? "0.0" : String(Number(i[8]).toFixed(1)).trim(), january: i[8] === undefined ? "0.0" : reg.test(String(i[8])) === false ? "0.0" : String(Number(i[8]).toFixed(1)).trim(),
...@@ -620,18 +620,18 @@ export default class CorporateAnnualTarget extends Component { ...@@ -620,18 +620,18 @@ export default class CorporateAnnualTarget extends Component {
"max_ach": i[10] == null ? "" : i[10].value, "max_ach": i[10] == null ? "" : i[10].value,
"formula": i[11] == null ? "" : i[11].value, "formula": i[11] == null ? "" : i[11].value,
"total_actual_before": String(i[12]) == "" ? "0.0" : String(i[12]), "total_actual_before": String(i[12]) == "" ? "0.0" : String(i[12]),
"january": i[6] === 'ROIC' ? String(Number(i[13]).toFixed(1)) : stateFR ? i[0] == 3? String(i[13]) : String(Number(i[13].value).toFixed(1)) : String(i[13]), "january": i[6] === 'ROIC' ? String(Number(i[13]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[13]) : String(Number(i[13].value).toFixed(1)) : String(i[13]),
"february": i[6] === 'ROIC' ? String(Number(i[14]).toFixed(1)) : stateFR ? i[0] == 3? String(i[14]) : String(Number(i[14].value).toFixed(1)) : String(i[14]), "february": i[6] === 'ROIC' ? String(Number(i[14]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[14]) : String(Number(i[14].value).toFixed(1)) : String(i[14]),
"march": i[6] === 'ROIC' ? String(Number(i[15]).toFixed(1)) : stateFR ? i[0] == 3? String(i[15]) : String(Number(i[15].value).toFixed(1)) : String(i[15]), "march": i[6] === 'ROIC' ? String(Number(i[15]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[15]) : String(Number(i[15].value).toFixed(1)) : String(i[15]),
"april": i[6] === 'ROIC' ? String(Number(i[16]).toFixed(1)) : stateFR ? i[0] == 3? String(i[16]) : String(Number(i[16].value).toFixed(1)) : String(i[16]), "april": i[6] === 'ROIC' ? String(Number(i[16]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[16]) : String(Number(i[16].value).toFixed(1)) : String(i[16]),
"may": i[6] === 'ROIC' ? String(Number(i[17]).toFixed(1)) : stateFR ? i[0] == 3? String(i[17]) : String(Number(i[17].value).toFixed(1)) : String(i[17]), "may": i[6] === 'ROIC' ? String(Number(i[17]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[17]) : String(Number(i[17].value).toFixed(1)) : String(i[17]),
"june": i[6] === 'ROIC' ? String(Number(i[18]).toFixed(1)) : stateFR ? i[0] == 3? String(i[18]) : String(Number(i[18].value).toFixed(1)) : String(i[18]), "june": i[6] === 'ROIC' ? String(Number(i[18]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[18]) : String(Number(i[18].value).toFixed(1)) : String(i[18]),
"july": i[6] === 'ROIC' ? String(Number(i[19]).toFixed(1)) : stateFR ? i[0] == 3? String(i[19]) : String(Number(i[19].value).toFixed(1)) : String(i[19]), "july": i[6] === 'ROIC' ? String(Number(i[19]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[19]) : String(Number(i[19].value).toFixed(1)) : String(i[19]),
"august": i[6] === 'ROIC' ? String(Number(i[20]).toFixed(1)) : stateFR ? i[0] == 3? String(i[20]) : String(Number(i[20].value).toFixed(1)) : String(i[20]), "august": i[6] === 'ROIC' ? String(Number(i[20]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[20]) : String(Number(i[20].value).toFixed(1)) : String(i[20]),
"september": i[6] === 'ROIC' ? String(Number(i[21]).toFixed(1)) : stateFR ? i[0] == 3? String(i[21]) : String(Number(i[21].value).toFixed(1)) : String(i[21]), "september": i[6] === 'ROIC' ? String(Number(i[21]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[21]) : String(Number(i[21].value).toFixed(1)) : String(i[21]),
"october": i[6] === 'ROIC' ? String(Number(i[22]).toFixed(1)) : stateFR ? i[0] == 3? String(i[22]) : String(Number(i[22].value).toFixed(1)) : String(i[22]), "october": i[6] === 'ROIC' ? String(Number(i[22]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[22]) : String(Number(i[22].value).toFixed(1)) : String(i[22]),
"november": i[6] === 'ROIC' ? String(Number(i[23]).toFixed(1)) : stateFR ? i[0] == 3? String(i[23]) : String(Number(i[23].value).toFixed(1)) : String(i[23]), "november": i[6] === 'ROIC' ? String(Number(i[23]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[23]) : String(Number(i[23].value).toFixed(1)) : String(i[23]),
"december": i[6] === 'ROIC' ? String(Number(i[24]).toFixed(1)) : stateFR ? i[0] == 3? String(i[24]) : String(Number(i[24].value).toFixed(1)) : String(i[24]), "december": i[6] === 'ROIC' ? String(Number(i[24]).toFixed(1)) : stateFR ? i[0] == 3 ? String(i[24]) : String(Number(i[24].value).toFixed(1)) : String(i[24]),
"total_current_year": i[6] === 'ROIC' ? String(Number(i[25]).toFixed(1)) : String(Number(i[25]).toFixed(1)) == "" ? "0.0" : String(Number(i[25]).toFixed(1)), "total_current_year": i[6] === 'ROIC' ? String(Number(i[25]).toFixed(1)) : String(Number(i[25]).toFixed(1)) == "" ? "0.0" : String(Number(i[25]).toFixed(1)),
"total_next_year": i[6] === 'ROIC' ? String(Number(i[26]).toFixed(1)) : String(Number(i[26]).toFixed(1)) == "" ? "0.0" : String(Number(i[26]).toFixed(1)), "total_next_year": i[6] === 'ROIC' ? String(Number(i[26]).toFixed(1)) : String(Number(i[26]).toFixed(1)) == "" ? "0.0" : String(Number(i[26]).toFixed(1)),
"total_more_year": i[6] === 'ROIC' ? String(Number(i[27]).toFixed(1)) : String(Number(i[27]).toFixed(1)) == "" ? "0.0" : String(Number(i[27]).toFixed(1)), "total_more_year": i[6] === 'ROIC' ? String(Number(i[27]).toFixed(1)) : String(Number(i[27]).toFixed(1)) == "" ? "0.0" : String(Number(i[27]).toFixed(1)),
...@@ -762,19 +762,19 @@ export default class CorporateAnnualTarget extends Component { ...@@ -762,19 +762,19 @@ export default class CorporateAnnualTarget extends Component {
"max_ach": i[10] == null ? "" : i[10].value, "max_ach": i[10] == null ? "" : i[10].value,
"formula": i[11] == null ? "" : i[11].value, "formula": i[11] == null ? "" : i[11].value,
"total_actual_before": String(i[12]) == "" ? "0.0" : String(i[12]), "total_actual_before": String(i[12]) == "" ? "0.0" : String(i[12]),
"january": i[13].value == undefined? (String(i[13]) == ''? "0.0" : String(i[13])) : String(i[13].value), "january": i[13].value == undefined ? (String(i[13]) == '' ? "0.0" : String(i[13])) : String(i[13].value),
// "january": stateFR ? String(i[13].value) : String(i[13]) == "" ? "0.0" : String(i[13]), // "january": stateFR ? String(i[13].value) : String(i[13]) == "" ? "0.0" : String(i[13]),
"february": i[14].value == undefined? (String(i[14]) == ''? "0.0" : String(i[14])) : String(i[14].value), "february": i[14].value == undefined ? (String(i[14]) == '' ? "0.0" : String(i[14])) : String(i[14].value),
"march": i[15].value == undefined? (String(i[15]) == ''? "0.0" : String(i[15])) : String(i[15].value), "march": i[15].value == undefined ? (String(i[15]) == '' ? "0.0" : String(i[15])) : String(i[15].value),
"april": i[16].value == undefined? (String(i[16]) == ''? "0.0" : String(i[16])) : String(i[16].value), "april": i[16].value == undefined ? (String(i[16]) == '' ? "0.0" : String(i[16])) : String(i[16].value),
"may": i[17].value == undefined? (String(i[17]) == ''? "0.0" : String(i[17])) : String(i[17].value), "may": i[17].value == undefined ? (String(i[17]) == '' ? "0.0" : String(i[17])) : String(i[17].value),
"june": i[18].value == undefined? (String(i[18]) == ''? "0.0" : String(i[18])) : String(i[18].value), "june": i[18].value == undefined ? (String(i[18]) == '' ? "0.0" : String(i[18])) : String(i[18].value),
"july": i[19].value == undefined? (String(i[19]) == ''? "0.0" : String(i[19])) : String(i[19].value), "july": i[19].value == undefined ? (String(i[19]) == '' ? "0.0" : String(i[19])) : String(i[19].value),
"august": i[20].value == undefined? (String(i[20]) == ''? "0.0" : String(i[20])) : String(i[20].value), "august": i[20].value == undefined ? (String(i[20]) == '' ? "0.0" : String(i[20])) : String(i[20].value),
"september": i[21].value == undefined? (String(i[21]) == ''? "0.0" : String(i[21])) : String(i[21].value), "september": i[21].value == undefined ? (String(i[21]) == '' ? "0.0" : String(i[21])) : String(i[21].value),
"october": i[22].value == undefined? (String(i[22]) == ''? "0.0" : String(i[22])) : String(i[22].value), "october": i[22].value == undefined ? (String(i[22]) == '' ? "0.0" : String(i[22])) : String(i[22].value),
"november": i[23].value == undefined? (String(i[23]) == ''? "0.0" : String(i[23])) : String(i[23].value), "november": i[23].value == undefined ? (String(i[23]) == '' ? "0.0" : String(i[23])) : String(i[23].value),
"december": i[24].value == undefined? (String(i[24]) == ''? "0.0" : String(i[24])) : String(i[24].value), "december": i[24].value == undefined ? (String(i[24]) == '' ? "0.0" : String(i[24])) : String(i[24].value),
"total_current_year": String(i[25]) == "" ? "0.0" : String(i[25]), "total_current_year": String(i[25]) == "" ? "0.0" : String(i[25]),
"total_next_year": String(i[26]) == "" ? "0.0" : String(i[26]), "total_next_year": String(i[26]) == "" ? "0.0" : String(i[26]),
"total_more_year": String(i[27]) == "" ? "0.0" : String(i[27]), "total_more_year": String(i[27]) == "" ? "0.0" : String(i[27]),
...@@ -1048,7 +1048,6 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1048,7 +1048,6 @@ export default class CorporateAnnualTarget extends Component {
} }
}) })
baru.map((item, index) => { baru.map((item, index) => {
if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') { if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') {
anjay.push(item) anjay.push(item)
...@@ -1086,6 +1085,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1086,6 +1085,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)
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 {
...@@ -1094,11 +1094,24 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1094,11 +1094,24 @@ export default class CorporateAnnualTarget extends Component {
let nilaiX = String(item).substr(indexX + 1, String(item).length) let nilaiX = String(item).substr(indexX + 1, String(item).length)
if (forecast == undefined) { if (forecast == undefined) {
let convertID = -1
if (tableMeta.rowData[11].value == 'FORMULA') {
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]
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
anjay.push(valuezz == "" ? 0 : valuezz)
} 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))
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = value.formula[indexID].value let valuezz = value.formula[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
} }
}
} else { } else {
// // // console.log(dataTable2[tableMeta.rowIndex][30]) // // // console.log(dataTable2[tableMeta.rowIndex][30])
let array = dataTable2[tableMeta.rowIndex][30].filter((val) => val.periode == Number(column)) let array = dataTable2[tableMeta.rowIndex][30].filter((val) => val.periode == Number(column))
...@@ -1126,7 +1139,12 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1126,7 +1139,12 @@ export default class CorporateAnnualTarget extends Component {
} }
} else { } else {
let indexID = dataTable2.findIndex((val) => val[31] == item) let convertID = -1
if (tableMeta.rowData[11].value == 'FORMULA') {
let indexIDReport = dataTable2.findIndex((val) => val[1] == item)
convertID = dataTable2[indexIDReport][31]
}
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][column].value == undefined ? dataTable2[indexID][column] : dataTable2[indexID][column].value
if (item == dataTable2[tableMeta.rowIndex][31]) { if (item == dataTable2[tableMeta.rowIndex][31]) {
...@@ -1303,7 +1321,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1303,7 +1321,7 @@ export default class CorporateAnnualTarget extends Component {
let valz = value.value let valz = value.value
let total = 0 let total = 0
let lastValz = 0 let lastValz = 0
if (valz == 'SUM' || valz == 'AVG' || valz == 'LAST') { if (valz == 'SUM' || valz == 'AVG' || valz == 'LAST' || valz == 'FORMULA') {
dataTable2[tableMeta.rowIndex].map((item, index) => { dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index >= 13 && index <= 24) { if (index >= 13 && index <= 24) {
let valItem = item == undefined || item == "" ? 0 : item let valItem = item == undefined || item == "" ? 0 : item
...@@ -1313,7 +1331,10 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1313,7 +1331,10 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}) })
dataTable2[tableMeta.rowIndex][25] = (valz == 'SUM' ? total : (valz == 'AVG' ? (total / 12) : lastValz)) if (valz == 'FORMULA') {
dataTable2[tableMeta.rowIndex][0] = 5
}
dataTable2[tableMeta.rowIndex][25] = valz == 'FORMULA' ? 0 : ((valz == 'SUM' ? total : (valz == 'AVG' ? (total / 12) : lastValz)))
} }
} }
const handleValueDropdown = (value, type, tableMeta) => { const handleValueDropdown = (value, type, tableMeta) => {
...@@ -1807,7 +1828,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1807,7 +1828,7 @@ export default class CorporateAnnualTarget extends Component {
), ),
customBodyRender: (val, tableMeta, updateValue) => { customBodyRender: (val, tableMeta, updateValue) => {
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 105 }}>
{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 :
<Autocomplete <Autocomplete
...@@ -1825,7 +1846,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1825,7 +1846,7 @@ export default class CorporateAnnualTarget extends Component {
style={{ padding: 0, margin: 0 }} style={{ padding: 0, margin: 0 }}
renderInput={(params) => renderInput={(params) =>
<div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}> <div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}>
<input style={{ borderColor: 'white', width: 96, textAlign: 'center', padding: 0, margin: 0, color: handleAction(tableMeta.rowData[2], tableMeta.rowData[0]) ? "#5198ea" : "black" }} type="text" {...params.inputProps} /> <input style={{ borderColor: 'white', width: 105, textAlign: 'center', padding: 0, margin: 0, color: handleAction(tableMeta.rowData[2], tableMeta.rowData[0]) ? "#5198ea" : "black" }} type="text" {...params.inputProps} />
</div> </div>
} }
// value={this.state.parent} // value={this.state.parent}
...@@ -1889,7 +1910,31 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1889,7 +1910,31 @@ export default class CorporateAnnualTarget extends Component {
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 96 }}>
{ {
tableMeta.rowData[6] === 'ROIC' ? // tableMeta.rowData[6] === 'ROIC' ?
// <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(value).toFixed(1)}
// disabled={true}
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// // // // // console.log(tableMeta.rowData[0])
// }}
// />
// }
// /> :
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={value} value={value}
...@@ -1899,8 +1944,9 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1899,8 +1944,9 @@ 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(value).toFixed(1)} value={Number(handleValueFormula(value, tableMeta, 1)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1908,23 +1954,23 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1908,23 +1954,23 @@ export default class CorporateAnnualTarget extends Component {
}} }}
/> />
} }
/> : />
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ? </div>
null
: :
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}> <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}
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", 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)}
disabled={true} disabled
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1934,9 +1980,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1934,9 +1980,7 @@ export default class CorporateAnnualTarget extends Component {
/> />
} }
/> />
</div>
: :
<div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={value} value={value}
...@@ -1957,6 +2001,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1957,6 +2001,7 @@ export default class CorporateAnnualTarget extends Component {
/> />
} }
/> />
}
</div>) </div>)
} }
</div> </div>
...@@ -1975,26 +2020,26 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1975,26 +2020,26 @@ export default class CorporateAnnualTarget extends Component {
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 96 }}>
{ {
tableMeta.rowData[6] === 'ROIC' ? // tableMeta.rowData[6] === 'ROIC' ?
<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(value).toFixed(1)} // value={Number(value).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])
}} // }}
/> // />
} // }
/> : // /> :
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
: :
...@@ -2061,26 +2106,26 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2061,26 +2106,26 @@ export default class CorporateAnnualTarget extends Component {
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 96 }}>
{ {
tableMeta.rowData[6] === 'ROIC' ? // tableMeta.rowData[6] === 'ROIC' ?
<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(value).toFixed(1)} // value={Number(value).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])
}} // }}
/> // />
} // }
/> : // /> :
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
: :
...@@ -2148,26 +2193,26 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2148,26 +2193,26 @@ export default class CorporateAnnualTarget extends Component {
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 96 }}>
{ {
tableMeta.rowData[6] === 'ROIC' ? // tableMeta.rowData[6] === 'ROIC' ?
<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(value).toFixed(1)} // value={Number(value).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])
}} // }}
/> // />
} // }
/> : // /> :
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
: :
...@@ -2235,26 +2280,26 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2235,26 +2280,26 @@ export default class CorporateAnnualTarget extends Component {
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 96 }}>
{ {
tableMeta.rowData[6] === 'ROIC' ? // tableMeta.rowData[6] === 'ROIC' ?
<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(value).toFixed(1)} // value={Number(value).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])
}} // }}
/> // />
} // }
/> : // /> :
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
: :
...@@ -2322,26 +2367,26 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2322,26 +2367,26 @@ export default class CorporateAnnualTarget extends Component {
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 96 }}>
{ {
tableMeta.rowData[6] === 'ROIC' ? // tableMeta.rowData[6] === 'ROIC' ?
<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(value).toFixed(1)} // value={Number(value).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])
}} // }}
/> // />
} // }
/> : // /> :
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
: :
...@@ -2409,26 +2454,26 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2409,26 +2454,26 @@ export default class CorporateAnnualTarget extends Component {
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 96 }}>
{ {
tableMeta.rowData[6] === 'ROIC' ? // tableMeta.rowData[6] === 'ROIC' ?
<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(value).toFixed(1)} // value={Number(value).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])
}} // }}
/> // />
} // }
/> : // /> :
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
: :
...@@ -2496,26 +2541,26 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2496,26 +2541,26 @@ export default class CorporateAnnualTarget extends Component {
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 96 }}>
{ {
tableMeta.rowData[6] === 'ROIC' ? // tableMeta.rowData[6] === 'ROIC' ?
<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(value).toFixed(1)} // value={Number(value).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])
}} // }}
/> // />
} // }
/> : // /> :
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
: :
...@@ -2583,26 +2628,26 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2583,26 +2628,26 @@ export default class CorporateAnnualTarget extends Component {
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 96 }}>
{ {
tableMeta.rowData[6] === 'ROIC' ? // tableMeta.rowData[6] === 'ROIC' ?
<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(value).toFixed(1)} // value={Number(value).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])
}} // }}
/> // />
} // }
/> : // /> :
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
: :
...@@ -2670,26 +2715,26 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2670,26 +2715,26 @@ export default class CorporateAnnualTarget extends Component {
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 96 }}>
{ {
tableMeta.rowData[6] === 'ROIC' ? // tableMeta.rowData[6] === 'ROIC' ?
<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(value).toFixed(1)} // value={Number(value).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])
}} // }}
/> // />
} // }
/> : // /> :
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
: :
...@@ -2757,26 +2802,26 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2757,26 +2802,26 @@ export default class CorporateAnnualTarget extends Component {
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 96 }}>
{ {
tableMeta.rowData[6] === 'ROIC' ? // tableMeta.rowData[6] === 'ROIC' ?
<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(value).toFixed(1)} // value={Number(value).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])
}} // }}
/> // />
} // }
/> : // /> :
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
: :
...@@ -2844,26 +2889,26 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2844,26 +2889,26 @@ export default class CorporateAnnualTarget extends Component {
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 96 }}>
{ {
tableMeta.rowData[6] === 'ROIC' ? // tableMeta.rowData[6] === 'ROIC' ?
<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(value).toFixed(1)} // value={Number(value).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])
}} // }}
/> // />
} // }
/> : // /> :
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
: :
...@@ -3019,26 +3064,26 @@ export default class CorporateAnnualTarget extends Component { ...@@ -3019,26 +3064,26 @@ export default class CorporateAnnualTarget extends Component {
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 96 }}>
{ {
tableMeta.rowData[6] === 'ROIC' ? // tableMeta.rowData[6] === 'ROIC' ?
<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(value).toFixed(1)} // value={Number(value).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])
}} // }}
/> // />
} // }
/> : // /> :
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
: :
...@@ -3106,26 +3151,26 @@ export default class CorporateAnnualTarget extends Component { ...@@ -3106,26 +3151,26 @@ export default class CorporateAnnualTarget extends Component {
return ( return (
<div style={{ width: 96 }}> <div style={{ width: 96 }}>
{ {
tableMeta.rowData[6] === 'ROIC' ? // tableMeta.rowData[6] === 'ROIC' ?
<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(value).toFixed(1)} // value={Number(value).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])
}} // }}
/> // />
} // }
/> : // /> :
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
: :
...@@ -3554,16 +3599,16 @@ export default class CorporateAnnualTarget extends Component { ...@@ -3554,16 +3599,16 @@ export default class CorporateAnnualTarget extends Component {
{(this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && <button {(this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && <button
className="button" className="button"
type="button" type="button"
disabled={this.state.buttonDraft? true : this.state.handleDataSalah? true : false} disabled={this.state.buttonDraft ? true : this.state.handleDataSalah ? true : false}
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: this.state.editable === true ? 'default' : this.state.handleDataSalah? 'default' : 'pointer', cursor: this.state.editable === true ? 'default' : this.state.handleDataSalah ? 'default' : 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => this.state.editable ? onClick={() => this.state.editable ?
this.setState({ alert: true }) : (this.state.handleDataSalah? null : this.setState({ loading: true }, () => this.setState({ alert: true }) : (this.state.handleDataSalah ? null : this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1 ? null : this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => { this.setState({ handleTekTekTek: 1 }, () => {
setTimeout(() => { setTimeout(() => {
...@@ -3581,15 +3626,15 @@ export default class CorporateAnnualTarget extends Component { ...@@ -3581,15 +3626,15 @@ export default class CorporateAnnualTarget extends Component {
type="button" type="button"
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: this.state.editable === true ? 'default' : this.state.handleDataSalah? 'default' : 'pointer', cursor: this.state.editable === true ? 'default' : this.state.handleDataSalah ? 'default' : 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
outline: 'none' outline: 'none'
}} }}
disabled={this.state.buttonDraft? true : this.state.handleDataSalah? true : false} disabled={this.state.buttonDraft ? true : this.state.handleDataSalah ? true : false}
onClick={() => onClick={() =>
this.state.editable ? this.setState({ alert: true }) : this.state.editable ? this.setState({ alert: true }) :
this.state.buttonError === true ? this.state.buttonError === true ?
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' }) : (this.state.handleDataSalah? null : this.setState({ loading: true }, () => this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' }) : (this.state.handleDataSalah ? null : this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1 ? null : this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => { this.setState({ handleTekTekTek: 1 }, () => {
setTimeout(() => { setTimeout(() => {
......
...@@ -422,6 +422,7 @@ export default class SubHolding extends Component { ...@@ -422,6 +422,7 @@ export default class SubHolding extends Component {
if (this.state.report.value === 1) { if (this.state.report.value === 1) {
api.create().getAllReportPLDetail(payload).then(response => { api.create().getAllReportPLDetail(payload).then(response => {
console.log(response); console.log(response);
console.log(payload);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
...@@ -477,7 +478,56 @@ export default class SubHolding extends Component { ...@@ -477,7 +478,56 @@ export default class SubHolding extends Component {
item.profit_loss.monthly_last_year_october, item.profit_loss.monthly_last_year_october,
item.profit_loss.monthly_last_year_november, item.profit_loss.monthly_last_year_november,
item.profit_loss.monthly_last_year_december, item.profit_loss.monthly_last_year_december,
item.profit_loss.notes item.profit_loss.notes,
item.profit_loss.ro_full_year_january,
item.profit_loss.ro_full_year_february,
item.profit_loss.ro_full_year_march,
item.profit_loss.ro_full_year_april,
item.profit_loss.ro_full_year_may,
item.profit_loss.ro_full_year_june,
item.profit_loss.ro_full_year_july,
item.profit_loss.ro_full_year_august,
item.profit_loss.ro_full_year_september,
item.profit_loss.ro_full_year_october,
item.profit_loss.ro_full_year_november,
item.profit_loss.ro_full_year_december,
item.profit_loss.ol_q1_january,
item.profit_loss.ol_q1_february,
item.profit_loss.ol_q1_march,
item.profit_loss.ol_q1_april,
item.profit_loss.ol_q1_may,
item.profit_loss.ol_q1_june,
item.profit_loss.ol_q1_july,
item.profit_loss.ol_q1_august,
item.profit_loss.ol_q1_september,
item.profit_loss.ol_q1_october,
item.profit_loss.ol_q1_november,
item.profit_loss.ol_q1_december,
item.profit_loss.ol_q2_january,
item.profit_loss.ol_q2_february,
item.profit_loss.ol_q2_march,
item.profit_loss.ol_q2_april,
item.profit_loss.ol_q2_may,
item.profit_loss.ol_q2_june,
item.profit_loss.ol_q2_july,
item.profit_loss.ol_q2_august,
item.profit_loss.ol_q2_september,
item.profit_loss.ol_q2_october,
item.profit_loss.ol_q2_november,
item.profit_loss.ol_q2_december,
item.profit_loss.ol_q3_january,
item.profit_loss.ol_q3_february,
item.profit_loss.ol_q3_march,
item.profit_loss.ol_q3_april,
item.profit_loss.ol_q3_may,
item.profit_loss.ol_q3_june,
item.profit_loss.ol_q3_july,
item.profit_loss.ol_q3_august,
item.profit_loss.ol_q3_september,
item.profit_loss.ol_q3_october,
item.profit_loss.ol_q3_november,
item.profit_loss.ol_q3_december,
]) ])
} }
if (item.children !== null) { if (item.children !== null) {
...@@ -537,7 +587,55 @@ export default class SubHolding extends Component { ...@@ -537,7 +587,55 @@ export default class SubHolding extends Component {
item.profit_loss.monthly_last_year_october, item.profit_loss.monthly_last_year_october,
item.profit_loss.monthly_last_year_november, item.profit_loss.monthly_last_year_november,
item.profit_loss.monthly_last_year_december, item.profit_loss.monthly_last_year_december,
item.profit_loss.notes item.profit_loss.notes,
item.profit_loss.ro_full_year_january,
item.profit_loss.ro_full_year_february,
item.profit_loss.ro_full_year_march,
item.profit_loss.ro_full_year_april,
item.profit_loss.ro_full_year_may,
item.profit_loss.ro_full_year_june,
item.profit_loss.ro_full_year_july,
item.profit_loss.ro_full_year_august,
item.profit_loss.ro_full_year_september,
item.profit_loss.ro_full_year_october,
item.profit_loss.ro_full_year_november,
item.profit_loss.ro_full_year_december,
item.profit_loss.ol_q1_january,
item.profit_loss.ol_q1_february,
item.profit_loss.ol_q1_march,
item.profit_loss.ol_q1_april,
item.profit_loss.ol_q1_may,
item.profit_loss.ol_q1_june,
item.profit_loss.ol_q1_july,
item.profit_loss.ol_q1_august,
item.profit_loss.ol_q1_september,
item.profit_loss.ol_q1_october,
item.profit_loss.ol_q1_november,
item.profit_loss.ol_q1_december,
item.profit_loss.ol_q2_january,
item.profit_loss.ol_q2_february,
item.profit_loss.ol_q2_march,
item.profit_loss.ol_q2_april,
item.profit_loss.ol_q2_may,
item.profit_loss.ol_q2_june,
item.profit_loss.ol_q2_july,
item.profit_loss.ol_q2_august,
item.profit_loss.ol_q2_september,
item.profit_loss.ol_q2_october,
item.profit_loss.ol_q2_november,
item.profit_loss.ol_q2_december,
item.profit_loss.ol_q3_january,
item.profit_loss.ol_q3_february,
item.profit_loss.ol_q3_march,
item.profit_loss.ol_q3_april,
item.profit_loss.ol_q3_may,
item.profit_loss.ol_q3_june,
item.profit_loss.ol_q3_july,
item.profit_loss.ol_q3_august,
item.profit_loss.ol_q3_september,
item.profit_loss.ol_q3_october,
item.profit_loss.ol_q3_november,
item.profit_loss.ol_q3_december,
]) ])
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
...@@ -547,7 +645,7 @@ export default class SubHolding extends Component { ...@@ -547,7 +645,7 @@ export default class SubHolding extends Component {
} }
} }
}) })
// console.log(dataTable) console.log(dataTable)
// this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true }) // this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true }) this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -140,7 +140,7 @@ export default class CatRevision extends Component { ...@@ -140,7 +140,7 @@ export default class CatRevision extends Component {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) { if (indexIDzz === -1) {
let parentTrue = item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || item.parent_name == 'CUSTOMER PERSPECTIVE' let parentTrue = item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || item.parent_name == 'CUSTOMER PERSPECTIVE'
let weight = String(item.corporate_annual_target.weight).substr(0, String(item.corporate_annual_target.weight).length - 1)
dataTable.push([ dataTable.push([
item.type_report_id, item.type_report_id,
item.id, item.id,
...@@ -148,7 +148,7 @@ export default class CatRevision extends Component { ...@@ -148,7 +148,7 @@ export default class CatRevision extends Component {
item.formula, item.formula,
item.level, item.level,
item.description, item.description,
item.type_report_id == 1 ? `${Number(item.weight) * 100}%` : (String(Number(String(item.corporate_annual_target.weight).substr(0, String(item.corporate_annual_target.weight).length - 1)).toFixed(1)) + '%'), item.corporate_annual_target.weight == "" ? Number(0).toFixed(1) : Number(weight).toFixed(1),
parentTrue ? item.corporate_annual_target.uom : item.uom, parentTrue ? item.corporate_annual_target.uom : item.uom,
parentTrue ? item.corporate_annual_target.kpi == "" ? null : { value: item.corporate_annual_target.kpi } : item.kpi_type == "" ? null : { value: item.kpi_type }, parentTrue ? item.corporate_annual_target.kpi == "" ? null : { value: item.corporate_annual_target.kpi } : item.kpi_type == "" ? null : { value: item.kpi_type },
parentTrue ? item.corporate_annual_target.max_ach == "" ? null : { value: titleCase(item.corporate_annual_target.max_ach) } : item.max_ach == "" ? null : { value: titleCase(item.max_ach) }, parentTrue ? item.corporate_annual_target.max_ach == "" ? null : { value: titleCase(item.corporate_annual_target.max_ach) } : item.max_ach == "" ? null : { value: titleCase(item.max_ach) },
...@@ -200,7 +200,7 @@ export default class CatRevision extends Component { ...@@ -200,7 +200,7 @@ export default class CatRevision extends Component {
item.formula, item.formula,
item.level, item.level,
item.description, item.description,
item.type_report_id == 1 ? `${Number(item.weight) * 100}%` : (String(Number(String(item.corporate_annual_target.weight).substr(0, String(item.corporate_annual_target.weight).length - 1)).toFixed(1)) + '%'), item.weight == '' ? Number(0).toFixed(1) : Number(Number(item.weight) * 100).toFixed(1),
item.corporate_annual_target.uom, item.corporate_annual_target.uom,
item.kpi_type == "" ? null : { value: item.kpi_type }, item.kpi_type == "" ? null : { value: item.kpi_type },
item.max_ach == "" ? null : { value: titleCase(item.max_ach) }, item.max_ach == "" ? null : { value: titleCase(item.max_ach) },
...@@ -1197,13 +1197,13 @@ export default class CatRevision extends Component { ...@@ -1197,13 +1197,13 @@ export default class CatRevision extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
suffix="%" suffix={"%"}
style={{ color: 'black', fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: 'black', fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value} value={Number(value).toFixed(1)}
disabled={true} disabled={true}
maxLength={4} decimalScale={1}
/> />
} }
/> />
...@@ -2667,7 +2667,7 @@ export default class CatRevision extends Component { ...@@ -2667,7 +2667,7 @@ export default class CatRevision extends Component {
<div style={{ display: 'flex', justifyContent: 'space-between' }}> <div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div> <div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} (rev.{this.props.revision}) {String(this.props.quarter).toLocaleUpperCase()}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} {String(this.props.quarter).toLocaleUpperCase()} (rev.{this.props.revision})</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
...@@ -2888,7 +2888,7 @@ export default class CatRevision extends Component { ...@@ -2888,7 +2888,7 @@ export default class CatRevision extends Component {
<div style={{ display: 'flex', justifyContent: 'space-between' }}> <div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div> <div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} (rev.{this.props.revision})</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} {String(this.props.quarter).toLocaleUpperCase()} (rev.{this.props.revision})</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ width: '50%' }} /> <div style={{ width: '50%' }} />
......
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