Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
1377de56
Commit
1377de56
authored
Mar 25, 2021
by
Faisal Hamdi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'faisal' into 'master'
update! See merge request
!1337
parents
10befa0d
a0cc9a67
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
214 additions
and
174 deletions
+214
-174
CatRevision.js
src/container/RollingOutlook/CatRevision.js
+214
-174
No files found.
src/container/RollingOutlook/CatRevision.js
View file @
1377de56
...
...
@@ -150,22 +150,35 @@ export default class CatRevision extends Component {
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
))
+
'%'
),
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
.
formula
==
""
?
null
:
{
value
:
item
.
corporate_annual_target
.
formula
}
:
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
.
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
.
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
.
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
.
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
.
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
.
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
),
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.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.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.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.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.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.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
.
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
.
pic
,
item
.
order
...
...
@@ -192,19 +205,32 @@ export default class CatRevision extends Component {
item
.
kpi_type
==
""
?
null
:
{
value
:
item
.
kpi_type
},
item
.
max_ach
==
""
?
null
:
{
value
:
titleCase
(
item
.
max_ach
)
},
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
.
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
.
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
.
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
.
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
.
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
.
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.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.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.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.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.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.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.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
.
pic
,
item
.
order
...
...
@@ -245,7 +271,7 @@ export default class CatRevision extends Component {
handleGetFor
(
type
)
{
this
.
setState
({
get_for
:
type
},
()
=>
{
// this.getSettingControl()
//
this.getLatestUpdate()
this
.
getLatestUpdate
()
this
.
getItemHierarki
()
})
}
...
...
@@ -544,10 +570,9 @@ export default class CatRevision extends Component {
item
.
error
])
})
// console.log(indexCheck)
// console.log(this.state.buttonError)
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
=>
{
if
(
item
[
26
].
length
>
0
)
{
console
.
log
(
'masuk'
)
...
...
@@ -583,7 +608,7 @@ export default class CatRevision extends Component {
if
(
i
[
2
]
!==
null
)
{
let
indexID
=
this
.
state
.
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
==
i
[
2
])
if
(
indexID
!==
-
1
)
{
if
(
this
.
state
.
dataTable
[
indexID
][
6
]
===
'FINANCIAL PERSPECTIVE'
)
{
if
(
this
.
state
.
dataTable
[
indexID
][
5
]
===
'FINANCIAL PERSPECTIVE'
)
{
stateFR
=
true
}
else
{
stateFR
=
false
...
...
@@ -666,15 +691,29 @@ export default class CatRevision extends Component {
"revision"
:
Number
(
this
.
props
.
revision
),
"periode"
:
this
.
props
.
periode
,
"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
.
status
===
"success"
)
{
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 {
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
val
)
}
// const handleValueFormula = (value, tableMeta, column, periode, forecast) => {
const
handleValueFormula
=
(
value
,
tableMeta
,
column
,
periode
,
forecast
)
=>
{
// loading = true
let
splitFormula
=
String
(
tableMeta
.
rowData
[
3
]).
split
(
/
([
()@
])
/
)
...
...
@@ -710,7 +750,6 @@ export default class CatRevision extends Component {
}
})
baru
.
map
((
item
,
index
)
=>
{
if
(
item
==
'-'
||
item
==
'+'
||
item
==
'/'
||
item
==
'*'
||
item
==
'('
||
item
==
')'
)
{
anjay
.
push
(
item
)
...
...
@@ -726,19 +765,19 @@ export default class CatRevision extends Component {
let
month
=
column
-
1
let
total
=
0
// // // console.log(formulaAwal)
if
(
forecast
==
undefined
)
{
dataTable2
[
tableMeta
.
rowIndex
].
map
((
itemz
,
indexz
)
=>
{
if
(
indexz
>=
columnStart
&&
indexz
<=
columnStart
+
month
)
{
let
indexID
=
value
.
formula
.
findIndex
((
val
)
=>
val
.
item_formula
==
String
(
`@
${
formulaAwal
}
`
)
&&
val
.
periode
==
Number
(
this
.
props
.
periode
))
if
(
indexID
!==
-
1
)
{
let
valuezz
=
Number
(
value
.
formula
[
indexID
].
value
)
total
+=
valuezz
}
}
})
}
else
{
//
if (forecast == undefined) {
//
dataTable2[tableMeta.rowIndex].map((itemz, indexz) => {
//
if (indexz >= columnStart && indexz <= columnStart + month) {
//
let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${formulaAwal}`) && val.periode == Number(this.props.periode))
//
if (indexID !== -1) {
//
let valuezz = Number(value.formula[indexID].value)
//
total += valuezz
//
}
//
}
//
})
//
} else {
}
//
}
anjay
.
push
(
String
(
total
))
}
else
if
(
item
.
includes
(
'[CM]AVG'
))
{
...
...
@@ -755,38 +794,38 @@ export default class CatRevision extends Component {
let
operatorX
=
String
(
item
).
substr
(
indexX
-
1
,
1
)
let
nilaiX
=
String
(
item
).
substr
(
indexX
+
1
,
String
(
item
).
length
)
if
(
forecast
==
undefined
)
{
// console.log(value);
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 (forecast == undefined) {
// // console.log(value);
// 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) {
// // let valuezz = value.formula[indexID].value
// // anjay.push(valuezz == "" ? 0 : valuezz)
// // }
// }
anjay
.
push
(
operatorX
)
anjay
.
push
(
nilaiX
)
}
}
else
{
if
(
String
(
item
).
includes
(
'#'
))
{
if
(
forecast
==
undefined
)
{
let
indexID
=
value
.
formula
.
findIndex
((
val
)
=>
val
.
item_formula
==
String
(
`@
${
item
}
`
)
&&
val
.
periode
==
Number
(
this
.
props
.
periode
))
if
(
indexID
!==
-
1
)
{
let
valuezz
=
value
.
formula
[
indexID
].
value
anjay
.
push
(
valuezz
==
""
||
valuezz
==
null
?
"0"
:
valuezz
)
}
}
//
if (forecast == undefined) {
//
let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode))
//
if (indexID !== -1) {
//
let valuezz = value.formula[indexID].value
//
anjay.push(valuezz == "" || valuezz == null ? "0" : valuezz)
//
}
//
}
}
else
{
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
31
]
==
item
)
...
...
@@ -942,9 +981,9 @@ export default class CatRevision extends Component {
return
total
}
const
handleValueForecast
=
(
value
,
tableMeta
,
periode
)
=>
{
return
handleValueFormula
(
value
,
tableMeta
,
periode
,
periode
,
'forecast'
)
}
//
const handleValueForecast = (value, tableMeta, periode) => {
//
return handleValueFormula(value, tableMeta, periode, periode, 'forecast')
//
}
const
handleChangeDropdown
=
(
value
,
tableMeta
)
=>
{
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
value
let
valz
=
value
.
value
...
...
@@ -1023,8 +1062,6 @@ export default class CatRevision extends Component {
}
const
handleReturnFormula
=
(
idParent
,
tableMeta
)
=>
{
// console.log(dataTable2);
// console.log(tableMeta);
if
(
idParent
!==
null
)
{
let
indexsss
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
idParent
)
// console.log(indexsss);
...
...
@@ -1047,8 +1084,8 @@ export default class CatRevision extends Component {
let
total
=
0
let
lastValz
=
0
if
(
type
===
'roic'
)
{
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
tableMeta
.
rowData
[
2
4
]
total
=
Number
(
tableMeta
.
rowData
[
2
4
])
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
tableMeta
.
rowData
[
2
3
]
total
=
Number
(
tableMeta
.
rowData
[
2
3
])
return
total
}
else
{
dataTable2
[
tableMeta
.
rowIndex
].
map
((
item
,
index
)
=>
{
...
...
@@ -1161,16 +1198,12 @@ export default class CatRevision extends Component {
<
NumberFormat
thousandSeparator
=
{
true
}
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"
placeholder
=
""
value
=
{
value
}
disabled
=
{
true
}
maxLength
=
{
4
}
onBlur
=
{(
event
)
=>
{
// updateValue(some)
// handleChangePercentage(event.target.value, tableMeta)
}}
/
>
}
/
>
...
...
@@ -1191,52 +1224,57 @@ export default class CatRevision extends Component {
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
return
(
<
div
style
=
{{
textAlign
:
'center'
}}
>
{
tableMeta
.
rowData
[
0
]
===
1
||
tableMeta
.
rowData
[
0
]
===
2
||
tableMeta
.
rowData
[
0
]
===
4
?
null
:
<
FormControlLabel
style
=
{{
margin
:
0
}}
// value={value}
control
=
{
// !handleAction(tableMeta.rowData[2], tableMeta.rowData[0]) ?
<
Input
disableUnderline
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'center'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
,
marginTop
:
-
10
}}
type
=
"text"
placeholder
=
""
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}>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
60
}}
>
{
value
}
<
/div
>
<
/div
>
// <div style={{ textAlign: 'center' }}>
// {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
// null :
// <FormControlLabel
// style={{ margin: 0 }}
// // value={value}
// control={
// // !handleAction(tableMeta.rowData[2], tableMeta.rowData[0]) ?
// <Input
// 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"
// 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]))
}
// disabled={true
}
// onBlur={(event) => {
// // // // // console.log(event.target.value)
// // updateValue(event.target.value)
//
handleChangeText(event.target.value, tableMeta)
// //
handleChangeText(event.target.value, tableMeta)
// // // // // console.log(dataTable2)
// }}
// />
// </ThemeProvider>
}
/
>
}
<
/div
>
// // />
// // />
// // :
// // <ThemeProvider theme={theme}>
// // <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 {
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
//
value={Number(handleValueFormula(value, tableMeta, 5)).toFixed(1)}
value
=
{
Number
(
value
).
toFixed
(
1
)}
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
5
)).
toFixed
(
1
)}
//
value={Number(value).toFixed(1)}
disabled
=
{
true
}
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
...
...
@@ -1742,8 +1780,8 @@ export default class CatRevision extends Component {
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
//
value={Number(handleValueFormula(value, tableMeta, 6)).toFixed(1)}
value
=
{
Number
(
value
).
toFixed
(
1
)}
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
6
)).
toFixed
(
1
)}
//
value={Number(value).toFixed(1)}
disabled
=
{
true
}
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
...
...
@@ -1842,8 +1880,8 @@ export default class CatRevision extends Component {
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
//
value={Number(handleValueFormula(value, tableMeta, 7)).toFixed(1)}
value
=
{
Number
(
value
).
toFixed
(
1
)}
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
7
)).
toFixed
(
1
)}
//
value={Number(value).toFixed(1)}
disabled
=
{
true
}
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
...
...
@@ -1942,8 +1980,8 @@ export default class CatRevision extends Component {
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
//
value={Number(handleValueFormula(value, tableMeta, 8)).toFixed(1)}
value
=
{
Number
(
value
).
toFixed
(
1
)}
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
8
)).
toFixed
(
1
)}
//
value={Number(value).toFixed(1)}
disabled
=
{
true
}
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
...
...
@@ -2042,8 +2080,8 @@ export default class CatRevision extends Component {
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
//
value={Number(handleValueFormula(value, tableMeta, 9)).toFixed(1)}
value
=
{
Number
(
value
).
toFixed
(
1
)}
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
9
)).
toFixed
(
1
)}
//
value={Number(value).toFixed(1)}
disabled
=
{
true
}
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
...
...
@@ -2142,8 +2180,8 @@ export default class CatRevision extends Component {
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
//
value={Number(handleValueFormula(value, tableMeta, 10)).toFixed(1)}
value
=
{
Number
(
value
).
toFixed
(
1
)}
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
10
)).
toFixed
(
1
)}
//
value={Number(value).toFixed(1)}
disabled
=
{
true
}
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
...
...
@@ -2242,8 +2280,8 @@ export default class CatRevision extends Component {
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
//
value={Number(handleValueFormula(value, tableMeta, 11)).toFixed(1)}
value
=
{
Number
(
value
).
toFixed
(
1
)}
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
11
)).
toFixed
(
1
)}
//
value={Number(value).toFixed(1)}
disabled
=
{
true
}
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
...
...
@@ -2342,8 +2380,8 @@ export default class CatRevision extends Component {
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
//
value={Number(handleValueFormula(value, tableMeta, 12)).toFixed(1)}
value
=
{
Number
(
value
).
toFixed
(
1
)}
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
12
)).
toFixed
(
1
)}
//
value={Number(value).toFixed(1)}
disabled
=
{
true
}
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
...
...
@@ -2444,6 +2482,7 @@ export default class CatRevision extends Component {
type
=
"text"
placeholder
=
""
// value={Number(handleValueForecast(value, tableMeta, this.props.periode)).toFixed(1)}
value
=
{
Number
(
handleTotal
(
tableMeta
)).
toFixed
(
1
)}
disabled
=
{
true
}
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
...
...
@@ -2628,7 +2667,7 @@ export default class CatRevision extends Component {
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
}}
>
<
div
>
<
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
>
<
/div
>
<
div
style
=
{{
width
:
'50%'
}}
>
...
...
@@ -2719,6 +2758,7 @@ export default class CatRevision extends Component {
<
/div
>
<
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
className
=
"grid grid-2x"
style
=
{{
padding
:
20
}}
>
<
div
className
=
"col-1"
style
=
{{
paddingLeft
:
0
}}
>
...
...
@@ -2745,8 +2785,7 @@ export default class CatRevision extends Component {
<
div
className
=
"col-2"
>
<
/div>
:
<
div
className
=
""
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
,
paddingRight
:
5
}}
>
{
this
.
state
.
get_for
==
'view'
&&
// this.state.viewOnly &&
{
this
.
state
.
get_for
==
'view'
&&
this
.
state
.
viewOnly
&&
<
button
className
=
"button"
type
=
"button"
...
...
@@ -2867,6 +2906,7 @@ export default class CatRevision extends Component {
)}
<
/div
>
<
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
className
=
"grid grid-2x"
style
=
{{
padding
:
20
}}
>
<
div
className
=
"col-1"
style
=
{{
paddingLeft
:
0
}}
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment