Commit 1377de56 authored by Faisal Hamdi's avatar Faisal Hamdi

Merge branch 'faisal' into 'master'

update!

See merge request !1337
parents 10befa0d a0cc9a67
...@@ -150,22 +150,35 @@ export default class CatRevision extends Component { ...@@ -150,22 +150,35 @@ export default class CatRevision extends Component {
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.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)) + '%'),
parentTrue ? item.corporate_annual_target.uom : item.uom, parentTrue ? item.corporate_annual_target.uom : item.uom,
parentTrue ? item.corporate_annual_target.kpi_type == "" ? null : { value: item.corporate_annual_target.kpi_type } : 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) },
parentTrue ? item.corporate_annual_target.formula == "" ? null : { value: item.corporate_annual_target.formula } : item.formula_ytd == "" ? null : { value: item.formula_ytd }, parentTrue ? item.corporate_annual_target.formula_ytd == "" ? null : { value: item.corporate_annual_target.formula_ytd } : item.formula_ytd == "" ? null : { value: item.formula_ytd },
item.description === 'ROIC' ? Number(item.corporate_annual_target.january).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.january == "" ? item.corporate_annual_target.january : String(item.corporate_annual_target.january).indexOf(".") == -1 ? Number(item.corporate_annual_target.january) : Number(item.corporate_annual_target.january).toFixed(1)) : { value: item.corporate_annual_target.january, formula: item.corporate_annual_target.january_formula } : (item.corporate_annual_target.january == "" ? item.corporate_annual_target.january : String(item.corporate_annual_target.january).indexOf(".") == -1 ? Number(item.corporate_annual_target.january) : Number(item.corporate_annual_target.january).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.january).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.january == "" ? item.corporate_annual_target.january : String(item.corporate_annual_target.january).indexOf(".") == -1 ? Number(item.corporate_annual_target.january) : Number(item.corporate_annual_target.january).toFixed(1)) : { value: item.corporate_annual_target.january, formula: item.corporate_annual_target.january_formula } : (item.corporate_annual_target.january == "" ? item.corporate_annual_target.january : String(item.corporate_annual_target.january).indexOf(".") == -1 ? Number(item.corporate_annual_target.january) : Number(item.corporate_annual_target.january).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.february).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.february == "" ? item.corporate_annual_target.february : String(item.corporate_annual_target.february).indexOf(".") == -1 ? Number(item.corporate_annual_target.february) : Number(item.corporate_annual_target.february).toFixed(1)) : { value: item.corporate_annual_target.february, formula: item.corporate_annual_target.february_formula } : (item.corporate_annual_target.february == "" ? item.corporate_annual_target.february : String(item.corporate_annual_target.february).indexOf(".") == -1 ? Number(item.corporate_annual_target.february) : Number(item.corporate_annual_target.february).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.february).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.february == "" ? item.corporate_annual_target.february : String(item.corporate_annual_target.february).indexOf(".") == -1 ? Number(item.corporate_annual_target.february) : Number(item.corporate_annual_target.february).toFixed(1)) : { value: item.corporate_annual_target.february, formula: item.corporate_annual_target.february_formula } : (item.corporate_annual_target.february == "" ? item.corporate_annual_target.february : String(item.corporate_annual_target.february).indexOf(".") == -1 ? Number(item.corporate_annual_target.february) : Number(item.corporate_annual_target.february).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.march).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.march == "" ? item.corporate_annual_target.march : String(item.corporate_annual_target.march).indexOf(".") == -1 ? Number(item.corporate_annual_target.march) : Number(item.corporate_annual_target.march).toFixed(1)) : { value: item.corporate_annual_target.march, formula: item.corporate_annual_target.march_formula } : (item.corporate_annual_target.march == "" ? item.corporate_annual_target.march : String(item.corporate_annual_target.march).indexOf(".") == -1 ? Number(item.corporate_annual_target.march) : Number(item.corporate_annual_target.march).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.march).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.march == "" ? item.corporate_annual_target.march : String(item.corporate_annual_target.march).indexOf(".") == -1 ? Number(item.corporate_annual_target.march) : Number(item.corporate_annual_target.march).toFixed(1)) : { value: item.corporate_annual_target.march, formula: item.corporate_annual_target.march_formula } : (item.corporate_annual_target.march == "" ? item.corporate_annual_target.march : String(item.corporate_annual_target.march).indexOf(".") == -1 ? Number(item.corporate_annual_target.march) : Number(item.corporate_annual_target.march).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.april).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.april == "" ? item.corporate_annual_target.april : String(item.corporate_annual_target.april).indexOf(".") == -1 ? Number(item.corporate_annual_target.april) : Number(item.corporate_annual_target.april).toFixed(1)) : { value: item.corporate_annual_target.april, formula: item.corporate_annual_target.april_formula } : (item.corporate_annual_target.april == "" ? item.corporate_annual_target.april : String(item.corporate_annual_target.april).indexOf(".") == -1 ? Number(item.corporate_annual_target.april) : Number(item.corporate_annual_target.april).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.april).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.april == "" ? item.corporate_annual_target.april : String(item.corporate_annual_target.april).indexOf(".") == -1 ? Number(item.corporate_annual_target.april) : Number(item.corporate_annual_target.april).toFixed(1)) : { value: item.corporate_annual_target.april, formula: item.corporate_annual_target.april_formula } : (item.corporate_annual_target.april == "" ? item.corporate_annual_target.april : String(item.corporate_annual_target.april).indexOf(".") == -1 ? Number(item.corporate_annual_target.april) : Number(item.corporate_annual_target.april).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.may).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.may == "" ? item.corporate_annual_target.may : String(item.corporate_annual_target.may).indexOf(".") == -1 ? Number(item.corporate_annual_target.may) : Number(item.corporate_annual_target.may).toFixed(1)) : { value: item.corporate_annual_target.may, formula: item.corporate_annual_target.may_formula } : (item.corporate_annual_target.may == "" ? item.corporate_annual_target.may : String(item.corporate_annual_target.may).indexOf(".") == -1 ? Number(item.corporate_annual_target.may) : Number(item.corporate_annual_target.may).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.may).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.may == "" ? item.corporate_annual_target.may : String(item.corporate_annual_target.may).indexOf(".") == -1 ? Number(item.corporate_annual_target.may) : Number(item.corporate_annual_target.may).toFixed(1)) : { value: item.corporate_annual_target.may, formula: item.corporate_annual_target.may_formula } : (item.corporate_annual_target.may == "" ? item.corporate_annual_target.may : String(item.corporate_annual_target.may).indexOf(".") == -1 ? Number(item.corporate_annual_target.may) : Number(item.corporate_annual_target.may).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.june).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.june == "" ? item.corporate_annual_target.june : String(item.corporate_annual_target.june).indexOf(".") == -1 ? Number(item.corporate_annual_target.june) : Number(item.corporate_annual_target.june).toFixed(1)) : { value: item.corporate_annual_target.june, formula: item.corporate_annual_target.june_formula } : item.description === 'ROIC' ? Number(item.corporate_annual_target.june).toFixed(1) : (item.corporate_annual_target.june == "" ? item.corporate_annual_target.june : String(item.corporate_annual_target.june).indexOf(".") == -1 ? Number(item.corporate_annual_target.june) : Number(item.corporate_annual_target.june).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.june).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.june == "" ? item.corporate_annual_target.june : String(item.corporate_annual_target.june).indexOf(".") == -1 ? Number(item.corporate_annual_target.june) : Number(item.corporate_annual_target.june).toFixed(1)) : { value: item.corporate_annual_target.june, formula: item.corporate_annual_target.june_formula } : item.description === 'ROIC' ? Number(item.corporate_annual_target.june).toFixed(1) : (item.corporate_annual_target.june == "" ? item.corporate_annual_target.june : String(item.corporate_annual_target.june).indexOf(".") == -1 ? Number(item.corporate_annual_target.june) : Number(item.corporate_annual_target.june).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.july).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.july == "" ? item.corporate_annual_target.july : String(item.corporate_annual_target.july).indexOf(".") == -1 ? Number(item.corporate_annual_target.july) : Number(item.corporate_annual_target.july).toFixed(1)) : { value: item.corporate_annual_target.july, formula: item.corporate_annual_target.july_formula } : item.description === 'ROIC' ? Number(item.corporate_annual_target.july).toFixed(1) : (item.corporate_annual_target.july == "" ? item.corporate_annual_target.july : String(item.corporate_annual_target.july).indexOf(".") == -1 ? Number(item.corporate_annual_target.july) : Number(item.corporate_annual_target.july).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.july).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.july == "" ? item.corporate_annual_target.july : String(item.corporate_annual_target.july).indexOf(".") == -1 ? Number(item.corporate_annual_target.july) : Number(item.corporate_annual_target.july).toFixed(1)) : { value: item.corporate_annual_target.july, formula: item.corporate_annual_target.july_formula } : item.description === 'ROIC' ? Number(item.corporate_annual_target.july).toFixed(1) : (item.corporate_annual_target.july == "" ? item.corporate_annual_target.july : String(item.corporate_annual_target.july).indexOf(".") == -1 ? Number(item.corporate_annual_target.july) : Number(item.corporate_annual_target.july).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.august).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.august == "" ? item.corporate_annual_target.august : String(item.corporate_annual_target.august).indexOf(".") == -1 ? Number(item.corporate_annual_target.august) : Number(item.corporate_annual_target.august).toFixed(1)) : { value: item.corporate_annual_target.august, formula: item.corporate_annual_target.august_formula } : (item.corporate_annual_target.august == "" ? item.corporate_annual_target.august : String(item.corporate_annual_target.august).indexOf(".") == -1 ? Number(item.corporate_annual_target.august) : Number(item.corporate_annual_target.august).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.august).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.august == "" ? item.corporate_annual_target.august : String(item.corporate_annual_target.august).indexOf(".") == -1 ? Number(item.corporate_annual_target.august) : Number(item.corporate_annual_target.august).toFixed(1)) : { value: item.corporate_annual_target.august, formula: item.corporate_annual_target.august_formula } : (item.corporate_annual_target.august == "" ? item.corporate_annual_target.august : String(item.corporate_annual_target.august).indexOf(".") == -1 ? Number(item.corporate_annual_target.august) : Number(item.corporate_annual_target.august).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.september).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.september == "" ? item.corporate_annual_target.september : String(item.corporate_annual_target.september).indexOf(".") == -1 ? Number(item.corporate_annual_target.september) : Number(item.corporate_annual_target.september).toFixed(1)) : { value: item.corporate_annual_target.september, formula: item.corporate_annual_target.september_formula } : (item.corporate_annual_target.september == "" ? item.corporate_annual_target.september : String(item.corporate_annual_target.september).indexOf(".") == -1 ? Number(item.corporate_annual_target.september) : Number(item.corporate_annual_target.september).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.september).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.september == "" ? item.corporate_annual_target.september : String(item.corporate_annual_target.september).indexOf(".") == -1 ? Number(item.corporate_annual_target.september) : Number(item.corporate_annual_target.september).toFixed(1)) : { value: item.corporate_annual_target.september, formula: item.corporate_annual_target.september_formula } : (item.corporate_annual_target.september == "" ? item.corporate_annual_target.september : String(item.corporate_annual_target.september).indexOf(".") == -1 ? Number(item.corporate_annual_target.september) : Number(item.corporate_annual_target.september).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.october).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.october == "" ? item.corporate_annual_target.october : String(item.corporate_annual_target.october).indexOf(".") == -1 ? Number(item.corporate_annual_target.october) : Number(item.corporate_annual_target.october).toFixed(1)) : { value: item.corporate_annual_target.october, formula: item.corporate_annual_target.october_formula } : (item.corporate_annual_target.october == "" ? item.corporate_annual_target.october : String(item.corporate_annual_target.october).indexOf(".") == -1 ? Number(item.corporate_annual_target.october) : Number(item.corporate_annual_target.october).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.october).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.october == "" ? item.corporate_annual_target.october : String(item.corporate_annual_target.october).indexOf(".") == -1 ? Number(item.corporate_annual_target.october) : Number(item.corporate_annual_target.october).toFixed(1)) : { value: item.corporate_annual_target.october, formula: item.corporate_annual_target.october_formula } : (item.corporate_annual_target.october == "" ? item.corporate_annual_target.october : String(item.corporate_annual_target.october).indexOf(".") == -1 ? Number(item.corporate_annual_target.october) : Number(item.corporate_annual_target.october).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.november).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.november == "" ? item.corporate_annual_target.november : String(item.corporate_annual_target.november).indexOf(".") == -1 ? Number(item.corporate_annual_target.november) : Number(item.corporate_annual_target.november).toFixed(1)) : { value: item.corporate_annual_target.november, formula: item.corporate_annual_target.november_formula } : (item.corporate_annual_target.november == "" ? item.corporate_annual_target.november : String(item.corporate_annual_target.november).indexOf(".") == -1 ? Number(item.corporate_annual_target.november) : Number(item.corporate_annual_target.november).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.november).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.november == "" ? item.corporate_annual_target.november : String(item.corporate_annual_target.november).indexOf(".") == -1 ? Number(item.corporate_annual_target.november) : Number(item.corporate_annual_target.november).toFixed(1)) : { value: item.corporate_annual_target.november, formula: item.corporate_annual_target.november_formula } : (item.corporate_annual_target.november == "" ? item.corporate_annual_target.november : String(item.corporate_annual_target.november).indexOf(".") == -1 ? Number(item.corporate_annual_target.november) : Number(item.corporate_annual_target.november).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.december).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.december == "" ? item.corporate_annual_target.december : String(item.corporate_annual_target.december).indexOf(".") == -1 ? Number(item.corporate_annual_target.december) : Number(item.corporate_annual_target.december).toFixed(1)) : { value: item.corporate_annual_target.december, formula: item.corporate_annual_target.december_formula } : (item.corporate_annual_target.december == "" ? item.corporate_annual_target.december : String(item.corporate_annual_target.december).indexOf(".") == -1 ? Number(item.corporate_annual_target.december) : Number(item.corporate_annual_target.december).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.december).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? item.type_report_id == 3 ? (item.corporate_annual_target.december == "" ? item.corporate_annual_target.december : String(item.corporate_annual_target.december).indexOf(".") == -1 ? Number(item.corporate_annual_target.december) : Number(item.corporate_annual_target.december).toFixed(1)) : { value: item.corporate_annual_target.december, formula: item.corporate_annual_target.december_formula } : (item.corporate_annual_target.december == "" ? item.corporate_annual_target.december : String(item.corporate_annual_target.december).indexOf(".") == -1 ? Number(item.corporate_annual_target.december) : Number(item.corporate_annual_target.december).toFixed(1)),
item.corporate_annual_target.total_current_year == "" ? 0 : String(item.corporate_annual_target.total_current_year).indexOf(".") == -1 ? Number(item.corporate_annual_target.total_current_year) : Number(item.corporate_annual_target.total_current_year).toFixed(1), // item.corporate_annual_target.total_current_year == "" ? "0" : String(item.corporate_annual_target.total_current_year).indexOf(".") == -1 ? Number(item.corporate_annual_target.total_current_year) : Number(item.corporate_annual_target.total_current_year).toFixed(1),
item.corporate_annual_target.january == "" ? "0" : item.corporate_annual_target.january,
item.corporate_annual_target.february == "" ? "0" : item.corporate_annual_target.february,
item.corporate_annual_target.march == "" ? "0" : item.corporate_annual_target.march,
item.corporate_annual_target.april == "" ? "0" : item.corporate_annual_target.april,
item.corporate_annual_target.may == "" ? "0" : item.corporate_annual_target.may,
item.corporate_annual_target.june == "" ? "0" : item.corporate_annual_target.june,
item.corporate_annual_target.july == "" ? "0" : item.corporate_annual_target.july,
item.corporate_annual_target.august == "" ? "0" : item.corporate_annual_target.august,
item.corporate_annual_target.september == "" ? "0" : item.corporate_annual_target.september,
item.corporate_annual_target.october == "" ? "0" : item.corporate_annual_target.october,
item.corporate_annual_target.november == "" ? "0" : item.corporate_annual_target.november,
item.corporate_annual_target.december == "" ? "0" : item.corporate_annual_target.december,
item.corporate_annual_target.total_current_year == "" ? "0" : item.corporate_annual_target.total_current_year,
item.corporate_annual_target.strategic, item.corporate_annual_target.strategic,
item.corporate_annual_target.pic, item.corporate_annual_target.pic,
item.order item.order
...@@ -192,19 +205,32 @@ export default class CatRevision extends Component { ...@@ -192,19 +205,32 @@ export default class CatRevision extends Component {
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.description === 'ROIC' ? Number(item.corporate_annual_target.january).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.january, formula: item.corporate_annual_target.january_formula } : (item.corporate_annual_target.january == "" ? item.corporate_annual_target.january : String(item.corporate_annual_target.january).indexOf(".") == -1 ? Number(item.corporate_annual_target.january) : Number(item.corporate_annual_target.january).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.january).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.january, formula: item.corporate_annual_target.january_formula } : (item.corporate_annual_target.january == "" ? item.corporate_annual_target.january : String(item.corporate_annual_target.january).indexOf(".") == -1 ? Number(item.corporate_annual_target.january) : Number(item.corporate_annual_target.january).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.february).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.february, formula: item.corporate_annual_target.february_formula } : (item.corporate_annual_target.february == "" ? item.corporate_annual_target.february : String(item.corporate_annual_target.february).indexOf(".") == -1 ? Number(item.corporate_annual_target.february) : Number(item.corporate_annual_target.february).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.february).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.february, formula: item.corporate_annual_target.february_formula } : (item.corporate_annual_target.february == "" ? item.corporate_annual_target.february : String(item.corporate_annual_target.february).indexOf(".") == -1 ? Number(item.corporate_annual_target.february) : Number(item.corporate_annual_target.february).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.march).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.march, formula: item.corporate_annual_target.march_formula } : (item.corporate_annual_target.march == "" ? item.corporate_annual_target.march : String(item.corporate_annual_target.march).indexOf(".") == -1 ? Number(item.corporate_annual_target.march) : Number(item.corporate_annual_target.march).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.march).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.march, formula: item.corporate_annual_target.march_formula } : (item.corporate_annual_target.march == "" ? item.corporate_annual_target.march : String(item.corporate_annual_target.march).indexOf(".") == -1 ? Number(item.corporate_annual_target.march) : Number(item.corporate_annual_target.march).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.april).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.april, formula: item.corporate_annual_target.april_formula } : (item.corporate_annual_target.april == "" ? item.corporate_annual_target.april : String(item.corporate_annual_target.april).indexOf(".") == -1 ? Number(item.corporate_annual_target.april) : Number(item.corporate_annual_target.april).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.april).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.april, formula: item.corporate_annual_target.april_formula } : (item.corporate_annual_target.april == "" ? item.corporate_annual_target.april : String(item.corporate_annual_target.april).indexOf(".") == -1 ? Number(item.corporate_annual_target.april) : Number(item.corporate_annual_target.april).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.may).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.may, formula: item.corporate_annual_target.may_formula } : (item.corporate_annual_target.may == "" ? item.corporate_annual_target.may : String(item.corporate_annual_target.may).indexOf(".") == -1 ? Number(item.corporate_annual_target.may) : Number(item.corporate_annual_target.may).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.may).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.may, formula: item.corporate_annual_target.may_formula } : (item.corporate_annual_target.may == "" ? item.corporate_annual_target.may : String(item.corporate_annual_target.may).indexOf(".") == -1 ? Number(item.corporate_annual_target.may) : Number(item.corporate_annual_target.may).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.june).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.june, formula: item.corporate_annual_target.june_formula } : item.description === 'ROIC' ? Number(item.corporate_annual_target.june).toFixed(1) : (item.corporate_annual_target.june == "" ? item.corporate_annual_target.june : String(item.corporate_annual_target.june).indexOf(".") == -1 ? Number(item.corporate_annual_target.june) : Number(item.corporate_annual_target.june).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.june).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.june, formula: item.corporate_annual_target.june_formula } : item.description === 'ROIC' ? Number(item.corporate_annual_target.june).toFixed(1) : (item.corporate_annual_target.june == "" ? item.corporate_annual_target.june : String(item.corporate_annual_target.june).indexOf(".") == -1 ? Number(item.corporate_annual_target.june) : Number(item.corporate_annual_target.june).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.july).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.july, formula: item.corporate_annual_target.july_formula } : item.description === 'ROIC' ? Number(item.corporate_annual_target.july).toFixed(1) : (item.corporate_annual_target.july == "" ? item.corporate_annual_target.july : String(item.corporate_annual_target.july).indexOf(".") == -1 ? Number(item.corporate_annual_target.july) : Number(item.corporate_annual_target.july).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.july).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.july, formula: item.corporate_annual_target.july_formula } : item.description === 'ROIC' ? Number(item.corporate_annual_target.july).toFixed(1) : (item.corporate_annual_target.july == "" ? item.corporate_annual_target.july : String(item.corporate_annual_target.july).indexOf(".") == -1 ? Number(item.corporate_annual_target.july) : Number(item.corporate_annual_target.july).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.august).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.august, formula: item.corporate_annual_target.august_formula } : (item.corporate_annual_target.august == "" ? item.corporate_annual_target.august : String(item.corporate_annual_target.august).indexOf(".") == -1 ? Number(item.corporate_annual_target.august) : Number(item.corporate_annual_target.august).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.august).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.august, formula: item.corporate_annual_target.august_formula } : (item.corporate_annual_target.august == "" ? item.corporate_annual_target.august : String(item.corporate_annual_target.august).indexOf(".") == -1 ? Number(item.corporate_annual_target.august) : Number(item.corporate_annual_target.august).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.september).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.september, formula: item.corporate_annual_target.september_formula } : (item.corporate_annual_target.september == "" ? item.corporate_annual_target.september : String(item.corporate_annual_target.september).indexOf(".") == -1 ? Number(item.corporate_annual_target.september) : Number(item.corporate_annual_target.september).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.september).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.september, formula: item.corporate_annual_target.september_formula } : (item.corporate_annual_target.september == "" ? item.corporate_annual_target.september : String(item.corporate_annual_target.september).indexOf(".") == -1 ? Number(item.corporate_annual_target.september) : Number(item.corporate_annual_target.september).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.october).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.october, formula: item.corporate_annual_target.october_formula } : (item.corporate_annual_target.october == "" ? item.corporate_annual_target.october : String(item.corporate_annual_target.october).indexOf(".") == -1 ? Number(item.corporate_annual_target.october) : Number(item.corporate_annual_target.october).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.october).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.october, formula: item.corporate_annual_target.october_formula } : (item.corporate_annual_target.october == "" ? item.corporate_annual_target.october : String(item.corporate_annual_target.october).indexOf(".") == -1 ? Number(item.corporate_annual_target.october) : Number(item.corporate_annual_target.october).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.november).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.november, formula: item.corporate_annual_target.november_formula } : (item.corporate_annual_target.november == "" ? item.corporate_annual_target.november : String(item.corporate_annual_target.november).indexOf(".") == -1 ? Number(item.corporate_annual_target.november) : Number(item.corporate_annual_target.november).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.november).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.november, formula: item.corporate_annual_target.november_formula } : (item.corporate_annual_target.november == "" ? item.corporate_annual_target.november : String(item.corporate_annual_target.november).indexOf(".") == -1 ? Number(item.corporate_annual_target.november) : Number(item.corporate_annual_target.november).toFixed(1)),
item.description === 'ROIC' ? Number(item.corporate_annual_target.december).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.december, formula: item.corporate_annual_target.december_formula } : (item.corporate_annual_target.december == "" ? item.corporate_annual_target.december : String(item.corporate_annual_target.december).indexOf(".") == -1 ? Number(item.corporate_annual_target.december) : Number(item.corporate_annual_target.december).toFixed(1)), // item.description === 'ROIC' ? Number(item.corporate_annual_target.december).toFixed(1) : item.parent_name == "FINANCIAL PERSPECTIVE" ? { value: item.corporate_annual_target.december, formula: item.corporate_annual_target.december_formula } : (item.corporate_annual_target.december == "" ? item.corporate_annual_target.december : String(item.corporate_annual_target.december).indexOf(".") == -1 ? Number(item.corporate_annual_target.december) : Number(item.corporate_annual_target.december).toFixed(1)),
item.corporate_annual_target.total_current_year == "" ? 0 : String(item.corporate_annual_target.total_current_year).indexOf(".") == -1 ? Number(item.corporate_annual_target.total_current_year) : Number(item.corporate_annual_target.total_current_year).toFixed(1), // item.corporate_annual_target.total_current_year == "" ? 0 : String(item.corporate_annual_target.total_current_year).indexOf(".") == -1 ? Number(item.corporate_annual_target.total_current_year) : Number(item.corporate_annual_target.total_current_year).toFixed(1),
item.corporate_annual_target.january == "" ? "0" : item.corporate_annual_target.january,
item.corporate_annual_target.february == "" ? "0" : item.corporate_annual_target.february,
item.corporate_annual_target.march == "" ? "0" : item.corporate_annual_target.march,
item.corporate_annual_target.april == "" ? "0" : item.corporate_annual_target.april,
item.corporate_annual_target.may == "" ? "0" : item.corporate_annual_target.may,
item.corporate_annual_target.june == "" ? "0" : item.corporate_annual_target.june,
item.corporate_annual_target.july == "" ? "0" : item.corporate_annual_target.july,
item.corporate_annual_target.august == "" ? "0" : item.corporate_annual_target.august,
item.corporate_annual_target.september == "" ? "0" : item.corporate_annual_target.september,
item.corporate_annual_target.october == "" ? "0" : item.corporate_annual_target.october,
item.corporate_annual_target.november == "" ? "0" : item.corporate_annual_target.november,
item.corporate_annual_target.december == "" ? "0" : item.corporate_annual_target.december,
item.corporate_annual_target.total_current_year == "" ? "0" : item.corporate_annual_target.total_current_year,
item.corporate_annual_target.strategic, item.corporate_annual_target.strategic,
item.corporate_annual_target.pic, item.corporate_annual_target.pic,
item.order item.order
...@@ -245,7 +271,7 @@ export default class CatRevision extends Component { ...@@ -245,7 +271,7 @@ export default class CatRevision extends Component {
handleGetFor(type) { handleGetFor(type) {
this.setState({ get_for: type }, () => { this.setState({ get_for: type }, () => {
// this.getSettingControl() // this.getSettingControl()
// this.getLatestUpdate() this.getLatestUpdate()
this.getItemHierarki() this.getItemHierarki()
}) })
} }
...@@ -544,10 +570,9 @@ export default class CatRevision extends Component { ...@@ -544,10 +570,9 @@ export default class CatRevision extends Component {
item.error item.error
]) ])
}) })
// console.log(indexCheck)
// console.log(this.state.buttonError) // console.log(this.state.buttonError)
console.log(dataTable) console.log(dataTable)
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true}, () => { this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => {
this.state.dataTable.map(item => { this.state.dataTable.map(item => {
if (item[26].length > 0) { if (item[26].length > 0) {
console.log('masuk') console.log('masuk')
...@@ -583,7 +608,7 @@ export default class CatRevision extends Component { ...@@ -583,7 +608,7 @@ export default class CatRevision extends Component {
if (i[2] !== null) { if (i[2] !== null) {
let indexID = this.state.dataTable.findIndex((val) => val[1] == i[2]) let indexID = this.state.dataTable.findIndex((val) => val[1] == i[2])
if (indexID !== -1) { if (indexID !== -1) {
if (this.state.dataTable[indexID][6] === 'FINANCIAL PERSPECTIVE') { if (this.state.dataTable[indexID][5] === 'FINANCIAL PERSPECTIVE') {
stateFR = true stateFR = true
} else { } else {
stateFR = false stateFR = false
...@@ -666,15 +691,29 @@ export default class CatRevision extends Component { ...@@ -666,15 +691,29 @@ export default class CatRevision extends Component {
"revision": Number(this.props.revision), "revision": Number(this.props.revision),
"periode": this.props.periode, "periode": this.props.periode,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
"submission_id": this.props.submissionID "rolling_outlook_id": this.props.rollingOutlookID,
"quartal": this.props.quarter
} }
api.create().getLastestUpdateMB(payload).then(response => { api.create().getRollingOutlookLastUpdate(payload).then(response => {
// console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update,
notes: response.data.data.notes_update === null ? "" : response.data.data.notes_update
}) })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
} }
})
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
} }
}) })
} }
...@@ -690,6 +729,7 @@ export default class CatRevision extends Component { ...@@ -690,6 +729,7 @@ export default class CatRevision extends Component {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
} }
// const handleValueFormula = (value, tableMeta, column, periode, forecast) => {
const handleValueFormula = (value, tableMeta, column, periode, forecast) => { const handleValueFormula = (value, tableMeta, column, periode, forecast) => {
// loading = true // loading = true
let splitFormula = String(tableMeta.rowData[3]).split(/([()@])/) let splitFormula = String(tableMeta.rowData[3]).split(/([()@])/)
...@@ -710,7 +750,6 @@ export default class CatRevision extends Component { ...@@ -710,7 +750,6 @@ export default class CatRevision 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)
...@@ -726,19 +765,19 @@ export default class CatRevision extends Component { ...@@ -726,19 +765,19 @@ export default class CatRevision extends Component {
let month = column - 1 let month = column - 1
let total = 0 let total = 0
// // // console.log(formulaAwal) // // // console.log(formulaAwal)
if (forecast == undefined) { // if (forecast == undefined) {
dataTable2[tableMeta.rowIndex].map((itemz, indexz) => { // dataTable2[tableMeta.rowIndex].map((itemz, indexz) => {
if (indexz >= columnStart && indexz <= columnStart + month) { // if (indexz >= columnStart && indexz <= columnStart + month) {
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 = Number(value.formula[indexID].value) // let valuezz = Number(value.formula[indexID].value)
total += valuezz // total += valuezz
} // }
} // }
}) // })
} else { // } else {
} // }
anjay.push(String(total)) anjay.push(String(total))
} else if (item.includes('[CM]AVG')) { } else if (item.includes('[CM]AVG')) {
...@@ -755,38 +794,38 @@ export default class CatRevision extends Component { ...@@ -755,38 +794,38 @@ export default class CatRevision extends Component {
let operatorX = String(item).substr(indexX - 1, 1) let operatorX = String(item).substr(indexX - 1, 1)
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) {
// console.log(value); // // console.log(value);
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) {
let valuezz = value.formula[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz)
}
} else {
console.log(dataTable2[tableMeta.rowIndex][27])
let array = dataTable2[tableMeta.rowIndex][27].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) { // 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 {
// console.log(dataTable2[tableMeta.rowIndex][27])
// let array = dataTable2[tableMeta.rowIndex][27].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(operatorX)
anjay.push(nilaiX) anjay.push(nilaiX)
} }
} else { } else {
if (String(item).includes('#')) { if (String(item).includes('#')) {
if (forecast == undefined) { // if (forecast == undefined) {
let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode)) // let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${item}`) && 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 == "" || valuezz == null ? "0" : valuezz) // anjay.push(valuezz == "" || valuezz == null ? "0" : valuezz)
} // }
} // }
} else { } else {
let indexID = dataTable2.findIndex((val) => val[31] == item) let indexID = dataTable2.findIndex((val) => val[31] == item)
...@@ -942,9 +981,9 @@ export default class CatRevision extends Component { ...@@ -942,9 +981,9 @@ export default class CatRevision extends Component {
return total return total
} }
const handleValueForecast = (value, tableMeta, periode) => { // const handleValueForecast = (value, tableMeta, periode) => {
return handleValueFormula(value, tableMeta, periode, periode, 'forecast') // return handleValueFormula(value, tableMeta, periode, periode, 'forecast')
} // }
const handleChangeDropdown = (value, tableMeta) => { const handleChangeDropdown = (value, tableMeta) => {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value
let valz = value.value let valz = value.value
...@@ -1023,8 +1062,6 @@ export default class CatRevision extends Component { ...@@ -1023,8 +1062,6 @@ export default class CatRevision extends Component {
} }
const handleReturnFormula = (idParent, tableMeta) => { const handleReturnFormula = (idParent, tableMeta) => {
// console.log(dataTable2);
// console.log(tableMeta);
if (idParent !== null) { if (idParent !== null) {
let indexsss = dataTable2.findIndex((val) => val[1] == idParent) let indexsss = dataTable2.findIndex((val) => val[1] == idParent)
// console.log(indexsss); // console.log(indexsss);
...@@ -1047,8 +1084,8 @@ export default class CatRevision extends Component { ...@@ -1047,8 +1084,8 @@ export default class CatRevision extends Component {
let total = 0 let total = 0
let lastValz = 0 let lastValz = 0
if (type === 'roic') { if (type === 'roic') {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = tableMeta.rowData[24] dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = tableMeta.rowData[23]
total = Number(tableMeta.rowData[24]) total = Number(tableMeta.rowData[23])
return total return total
} else { } else {
dataTable2[tableMeta.rowIndex].map((item, index) => { dataTable2[tableMeta.rowIndex].map((item, index) => {
...@@ -1161,16 +1198,12 @@ export default class CatRevision extends Component { ...@@ -1161,16 +1198,12 @@ export default class CatRevision extends Component {
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
suffix="%" suffix="%"
style={{ 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={value}
disabled={true} disabled={true}
maxLength={4} maxLength={4}
onBlur={(event) => {
// updateValue(some)
// handleChangePercentage(event.target.value, tableMeta)
}}
/> />
} }
/> />
...@@ -1191,52 +1224,57 @@ export default class CatRevision extends Component { ...@@ -1191,52 +1224,57 @@ export default class CatRevision extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'center' }}> <div style={{ textAlign: 'center' }}>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ? <div style={{ textAlign: 'center', width: 60 }}>
null : {value}
<FormControlLabel </div>
style={{ margin: 0 }} </div>
// value={value} // <div style={{ textAlign: 'center' }}>
control={ // {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
// !handleAction(tableMeta.rowData[2], tableMeta.rowData[0]) ? // null :
<Input // <FormControlLabel
disableUnderline={true} // style={{ margin: 0 }}
style={{ fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginTop: -10 }} // // value={value}
type="text" // control={
placeholder="" // // !handleAction(tableMeta.rowData[2], tableMeta.rowData[0]) ?
defaultValue={value}
color={"#5198ea"}
disabled={true}
onBlur={(event) => {
// // // // console.log(event.target.value)
// updateValue(event.target.value)
// handleChangeText(event.target.value, tableMeta)
// // // // console.log(dataTable2)
}}
/>
// />
// />
// :
// <ThemeProvider theme={theme}>
// <Input // <Input
// disableUnderline={true} // disableUnderline={true}
// style={{ fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -5 }} // style={{ fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginTop: -10 }}
// type="text" // type="text"
// placeholder="" // placeholder=""
// defaultValue={value} // defaultValue={value}
// color={"#5198ea"} // color={"#5198ea"}
// // disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : !handleAction(tableMeta.rowData[2]))} // disabled={true}
// onBlur={(event) => { // onBlur={(event) => {
// // // // // console.log(event.target.value) // // // // // console.log(event.target.value)
// // updateValue(event.target.value) // // updateValue(event.target.value)
// handleChangeText(event.target.value, tableMeta) // // handleChangeText(event.target.value, tableMeta)
// // // // // console.log(dataTable2) // // // // // console.log(dataTable2)
// }} // }}
// /> // />
// </ThemeProvider> // // />
} // // />
/> // // :
} // // <ThemeProvider theme={theme}>
</div> // // <Input
// // disableUnderline={true}
// // style={{ fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -5 }}
// // type="text"
// // placeholder=""
// // defaultValue={value}
// // color={"#5198ea"}
// // // disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : !handleAction(tableMeta.rowData[2]))}
// // onBlur={(event) => {
// // // // // // console.log(event.target.value)
// // // updateValue(event.target.value)
// // handleChangeText(event.target.value, tableMeta)
// // // // // // console.log(dataTable2)
// // }}
// // />
// // </ThemeProvider>
// }
// />
// }
// </div>
) )
} }
} }
...@@ -1642,8 +1680,8 @@ export default class CatRevision extends Component { ...@@ -1642,8 +1680,8 @@ export default class CatRevision 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(handleValueFormula(value, tableMeta, 5)).toFixed(1)} value={Number(handleValueFormula(value, tableMeta, 5)).toFixed(1)}
value={Number(value).toFixed(1)} // value={Number(value).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -1742,8 +1780,8 @@ export default class CatRevision extends Component { ...@@ -1742,8 +1780,8 @@ export default class CatRevision 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(handleValueFormula(value, tableMeta, 6)).toFixed(1)} value={Number(handleValueFormula(value, tableMeta, 6)).toFixed(1)}
value={Number(value).toFixed(1)} // value={Number(value).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -1842,8 +1880,8 @@ export default class CatRevision extends Component { ...@@ -1842,8 +1880,8 @@ export default class CatRevision 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(handleValueFormula(value, tableMeta, 7)).toFixed(1)} value={Number(handleValueFormula(value, tableMeta, 7)).toFixed(1)}
value={Number(value).toFixed(1)} // value={Number(value).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -1942,8 +1980,8 @@ export default class CatRevision extends Component { ...@@ -1942,8 +1980,8 @@ export default class CatRevision 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(handleValueFormula(value, tableMeta, 8)).toFixed(1)} value={Number(handleValueFormula(value, tableMeta, 8)).toFixed(1)}
value={Number(value).toFixed(1)} // value={Number(value).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -2042,8 +2080,8 @@ export default class CatRevision extends Component { ...@@ -2042,8 +2080,8 @@ export default class CatRevision 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(handleValueFormula(value, tableMeta, 9)).toFixed(1)} value={Number(handleValueFormula(value, tableMeta, 9)).toFixed(1)}
value={Number(value).toFixed(1)} // value={Number(value).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -2142,8 +2180,8 @@ export default class CatRevision extends Component { ...@@ -2142,8 +2180,8 @@ export default class CatRevision 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(handleValueFormula(value, tableMeta, 10)).toFixed(1)} value={Number(handleValueFormula(value, tableMeta, 10)).toFixed(1)}
value={Number(value).toFixed(1)} // value={Number(value).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -2242,8 +2280,8 @@ export default class CatRevision extends Component { ...@@ -2242,8 +2280,8 @@ export default class CatRevision 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(handleValueFormula(value, tableMeta, 11)).toFixed(1)} value={Number(handleValueFormula(value, tableMeta, 11)).toFixed(1)}
value={Number(value).toFixed(1)} // value={Number(value).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -2342,8 +2380,8 @@ export default class CatRevision extends Component { ...@@ -2342,8 +2380,8 @@ export default class CatRevision 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(handleValueFormula(value, tableMeta, 12)).toFixed(1)} value={Number(handleValueFormula(value, tableMeta, 12)).toFixed(1)}
value={Number(value).toFixed(1)} // value={Number(value).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -2444,6 +2482,7 @@ export default class CatRevision extends Component { ...@@ -2444,6 +2482,7 @@ export default class CatRevision extends Component {
type="text" type="text"
placeholder="" placeholder=""
// value={Number(handleValueForecast(value, tableMeta, this.props.periode)).toFixed(1)} // value={Number(handleValueForecast(value, tableMeta, this.props.periode)).toFixed(1)}
value={Number(handleTotal(tableMeta)).toFixed(1)}
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
...@@ -2628,7 +2667,7 @@ export default class CatRevision extends Component { ...@@ -2628,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})</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' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
...@@ -2719,6 +2758,7 @@ export default class CatRevision extends Component { ...@@ -2719,6 +2758,7 @@ export default class CatRevision extends Component {
</div> </div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Notes : {this.state.notes}</Typography>
</div> </div>
<div className="grid grid-2x" style={{ padding: 20 }}> <div className="grid grid-2x" style={{ padding: 20 }}>
<div className="col-1" style={{ paddingLeft: 0 }}> <div className="col-1" style={{ paddingLeft: 0 }}>
...@@ -2745,8 +2785,7 @@ export default class CatRevision extends Component { ...@@ -2745,8 +2785,7 @@ export default class CatRevision extends Component {
<div className="col-2"> <div className="col-2">
</div> : </div> :
<div className="" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}> <div className="" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}>
{this.state.get_for == 'view' && {this.state.get_for == 'view' && this.state.viewOnly &&
// this.state.viewOnly &&
<button <button
className="button" className="button"
type="button" type="button"
...@@ -2867,6 +2906,7 @@ export default class CatRevision extends Component { ...@@ -2867,6 +2906,7 @@ export default class CatRevision extends Component {
)} )}
</div> </div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Notes : {this.state.notes}</Typography>
</div> </div>
<div className="grid grid-2x" style={{ padding: 20 }}> <div className="grid grid-2x" style={{ padding: 20 }}>
<div className="col-1" style={{ paddingLeft: 0 }}> <div className="col-1" style={{ paddingLeft: 0 }}>
......
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