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
d4d7e0a5
Commit
d4d7e0a5
authored
Feb 09, 2021
by
Riri Novita
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'riri' into 'master'
push See merge request
!1133
parents
53ea4ea1
c76483de
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1049 additions
and
773 deletions
+1049
-773
index.js
src/api/index.js
+2
-0
ProfitLossMR.js
src/container/MonthlyReport/ProfitLossMR.js
+20
-141
SummaryOfTriputra.js
src/container/SummaryTriputra/SummaryOfTriputra.js
+144
-85
TableSummaryTriputra.js
src/container/SummaryTriputra/TableSummaryTriputra.js
+883
-547
No files found.
src/api/index.js
View file @
d4d7e0a5
...
...
@@ -274,6 +274,7 @@ const create = (type = "") => {
const
getHierarkiReportYtd
=
(
body
)
=>
api
.
post
(
'/transaction/summary_ytd/summary/get_report_hierarki'
,
body
)
const
getHierarkiReportHistorical
=
(
body
)
=>
api
.
post
(
'/transaction/summary_historical/summary/get_report_hierarki'
,
body
)
const
getHierarkiReportMTD
=
(
body
)
=>
api
.
post
(
'/transaction/summary_mtd/summary/get_report_hierarki'
,
body
)
const
getHierarkiReportCPSM
=
(
body
)
=>
api
.
post
(
'/transaction/summary_cpsm/summary/get_report_hierarki'
,
body
)
const
getFullApproveMB
=
(
body
)
=>
api
.
post
(
'/transaction/master_budget/get_approved_submit'
,
body
)
const
getFullApproveMonthly
=
(
body
)
=>
api
.
post
(
'/transaction/monthly_report/get_approved_submit'
,
body
)
...
...
@@ -655,6 +656,7 @@ const create = (type = "") => {
getHierarkiReportHistorical
,
getHierarkiReportMTD
,
getHierarkiReportYtd
,
getHierarkiReportCPSM
,
getHierarkiCreateReportFRMB
,
getHierarkiCreateReportFRMR
,
createReportFRMB
,
...
...
src/container/MonthlyReport/ProfitLossMR.js
View file @
d4d7e0a5
...
...
@@ -634,7 +634,7 @@ export default class ProfitLossMR extends Component {
})
})
console
.
log
(
this
.
state
.
dataTable
);
// console.log(JSON.stringify(data))
let
payload
=
{
"monthly_report_id"
:
this
.
props
.
monthlyReportId
,
...
...
@@ -690,28 +690,31 @@ export default class ProfitLossMR extends Component {
if
(
type
===
"actual"
)
{
// console.log(val);
dataTable2
[
tableMeta
.
rowIndex
][
10
]
=
Number
(
val
).
toFixed
(
1
)
}
else
{
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
===
dataTable2
[
tableMeta
.
rowIndex
][
2
])
if
(
indexParent
>
0
)
{
dataTable2
[
tableMeta
.
rowIndex
][
10
]
=
Number
(
val
).
toFixed
(
1
)
let
jagain
=
Number
(
dataTable2
[
indexParent
][
10
]).
toFixed
(
1
)
dataTable2
[
indexParent
][
10
]
=
jagain
===
undefined
?
(
0
+
Number
(
val
)).
toFixed
(
1
)
:
Number
(
Number
(
jagain
)
+
Number
(
val
)).
toFixed
(
1
)
}
else
{
dataTable2
[
tableMeta
.
rowIndex
][
10
]
=
Number
(
val
).
toFixed
(
1
)
}
}
// else {
// let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[tableMeta.rowIndex][2])
// if (indexParent > 0) {
// dataTable2[tableMeta.rowIndex][10] = Number(val).toFixed(1)
// let jagain = Number(dataTable2[indexParent][10]).toFixed(1)
// dataTable2[indexParent][10] = jagain === undefined ? (0 + Number(val)).toFixed(1) : Number(Number(jagain) + Number(val)).toFixed(1)
// } else {
// dataTable2[tableMeta.rowIndex][10] = Number(val).toFixed(1)
// }
// }
}
const
handleValue
=
(
data
,
type
)
=>
{
const
handleValue
=
(
value
,
data
)
=>
{
let
total
=
0
dataTable2
.
map
((
item
,
index
)
=>
{
if
(
data
.
rowData
[
1
]
==
item
[
2
])
{
total
=
item
[
data
.
columnIndex
+
type
]
==
undefined
?
(
Number
(
total
)
+
0
)
:
(
Number
(
total
)
+
Number
(
String
(
item
[
data
.
columnIndex
+
type
]).
includes
(
'-'
)
?
Number
(
String
(
item
[
data
.
columnIndex
+
type
]).
substr
(
1
,
String
(
item
[
data
.
columnIndex
+
type
]).
length
))
*
-
1
:
Number
(
item
[
data
.
columnIndex
+
type
])))
total
=
item
[
10
]
==
undefined
?
(
Number
(
total
)
+
0
)
:
(
Number
(
total
)
+
Number
(
String
(
item
[
10
]).
includes
(
'-'
)
?
Number
(
String
(
item
[
10
]).
substr
(
1
,
String
(
item
[
10
]).
length
))
*
-
1
:
Number
(
item
[
10
])))
}
})
// if (data.rowData[5] == 'Revenue') {
// console.log(total)
// }
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
dataTable2
[
data
.
rowIndex
][
2
])
let
a
=
dataTable2
[
data
.
rowIndex
][
data
.
columnIndex
+
type
]
=
Number
(
total
)
// console.log(indexParent);
let
a
=
dataTable2
[
data
.
rowIndex
][
10
]
=
Number
(
total
)
return
a
}
const
handleFormula
=
(
data
,
tableMeta
,
type
)
=>
{
...
...
@@ -1079,38 +1082,6 @@ export default class ProfitLossMR extends Component {
decimalScale
=
{
1
}
/
>
:
// tableMeta.rowData[0] === 2 ?
// <span style={{ fontSize: 12, textAlign: 'right' }}>
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValue(tableMeta, 0)).toFixed(1)}
// decimalScale={1}
// />
// </span>
// :
// tableMeta.rowData[0] === 6 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={tableMeta.rowData[8]}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleFormula(value, tableMeta, 0)).toFixed(1)}
// decimalScale={1}
// />
// }
// />
// </div>
// :
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
...
...
@@ -1146,37 +1117,6 @@ export default class ProfitLossMR extends Component {
decimalScale
=
{
1
}
/
>
:
// tableMeta.rowData[0] === 2 ?
// <span style={{ fontSize: 12, textAlign: 'right' }}>
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValue(tableMeta, 1)).toFixed(1)}
// decimalScale={1}
// />
// </span> :
// tableMeta.rowData[0] === 6 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={tableMeta.rowData[9]}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleFormula(value, tableMeta, 1)).toFixed(1)}
// decimalScale={1}
// />
// }
// />
// </div>
// :
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
...
...
@@ -1244,7 +1184,8 @@ export default class ProfitLossMR extends Component {
placeholder
=
""
disabled
=
{
true
}
decimalScale
=
{
1
}
value
=
{
Number
(
handleValue
(
tableMeta
,
2
)).
toFixed
(
1
)}
value
=
{
Number
(
handleValue
(
value
,
tableMeta
)).
toFixed
(
1
)}
// value={Number(handleValue(tableMeta, 2)).toFixed(1)}
/
>
<
/span>
:
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
5
?
...
...
@@ -1328,36 +1269,6 @@ export default class ProfitLossMR extends Component {
decimalScale
=
{
1
}
/
>
:
// tableMeta.rowData[0] === 2 ?
// <span style={{ fontSize: 12, textAlign: 'right' }}>
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValue(tableMeta, 0)).toFixed(1)}
// />
// </span>
// :
// tableMeta.rowData[0] === 6 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={Number(tableMeta.rowData[11]).toFixed(1)}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleFormula(val, tableMeta, 0)).toFixed(1)}
// />
// }
// />
// </div>
// :
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
...
...
@@ -1406,38 +1317,6 @@ export default class ProfitLossMR extends Component {
decimalScale
=
{
1
}
/
>
:
// tableMeta.rowData[0] === 2 ?
// <span style={{ fontSize: 12, textAlign: 'right' }}>
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValue(tableMeta, 0)).toFixed(1)}
// decimalScale={1}
// />
// </span>
// :
// tableMeta.rowData[0] === 6 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={Number(tableMeta.rowData[12]).toFixed(1)}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleFormula(val, tableMeta, 0)).toFixed(1)}
// decimalScale={1}
// />
// }
// />
// </div>
// :
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
...
...
src/container/SummaryTriputra/SummaryOfTriputra.js
View file @
d4d7e0a5
...
...
@@ -892,92 +892,151 @@ export default class SummaryOfTriputra extends Component {
}
})
}
else
if
(
this
.
state
.
report
.
value
===
3
)
{
// api.create().getReportHierarkiPL
(payload).then(response => {
// // console.log(response
);
// if (response.data) {
api
.
create
().
getHierarkiReportCPSM
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
response
);
let
dataTable
=
[]
// console.log(response)
// let res = response.data.data
// const handlePushChild = (item) => {
// dataTable.push([
// item.type_report_id,
// item.id,
// item.parent,
// item.formula,
// item.level,
// item.description,
// item.profit_detail.total_actual_before === null ? "0" : item.profit_detail.total_actual_before === "" ? "0" : item.profit_detail.total_actual_before,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.january, formula: item.profit_detail.january_formula } : item.profit_detail.january,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.february, formula: item.profit_detail.february_formula } : item.profit_detail.february,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.march, formula: item.profit_detail.march_formula } : item.profit_detail.march,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.april, formula: item.profit_detail.april_formula } : item.profit_detail.april,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.may, formula: item.profit_detail.may_formula } : item.profit_detail.may,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.june, formula: item.profit_detail.june_formula } : item.profit_detail.june,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.july, formula: item.profit_detail.july_formula } : item.profit_detail.july,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.august, formula: item.profit_detail.august_formula } : item.profit_detail.august,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.september, formula: item.profit_detail.september_formula } : item.profit_detail.september,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.october, formula: item.profit_detail.october_formula } : item.profit_detail.october,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.november, formula: item.profit_detail.november_formula } : item.profit_detail.november,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.december, formula: item.profit_detail.december_formula } : item.profit_detail.december,
// item.profit_detail.total_current_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_next_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_more_year,
// item.order,
// item.condition_it_should_be,
// item.condition_if_wrong,
// item.profit_detail.forecast_formula == null ? [] : item.profit_detail.forecast_formula
// ])
// if (item.children !== null) {
// if (item.children.length > 0) {
// item.children.map((items, indexs) => {
// handlePushChild(items)
// })
// }
// }
// }
// res.map((item, index) => {
// dataTable.push([
// item.type_report_id,
// item.id,
// item.parent,
// item.formula,
// item.level,
// item.description,
// item.profit_detail.total_actual_before === null ? "0" : item.profit_detail.total_actual_before === "" ? "0" : item.profit_detail.total_actual_before,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.january, formula: item.profit_detail.january_formula } : item.profit_detail.january,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.february, formula: item.profit_detail.february_formula } : item.profit_detail.february,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.march, formula: item.profit_detail.march_formula } : item.profit_detail.march,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.april, formula: item.profit_detail.april_formula } : item.profit_detail.april,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.may, formula: item.profit_detail.may_formula } : item.profit_detail.may,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.june, formula: item.profit_detail.june_formula } : item.profit_detail.june,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.july, formula: item.profit_detail.july_formula } : item.profit_detail.july,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.august, formula: item.profit_detail.august_formula } : item.profit_detail.august,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.september, formula: item.profit_detail.september_formula } : item.profit_detail.september,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.october, formula: item.profit_detail.october_formula } : item.profit_detail.october,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.november, formula: item.profit_detail.november_formula } : item.profit_detail.november,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.december, formula: item.profit_detail.december_formula } : item.profit_detail.december,
// item.profit_detail.total_current_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_next_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_more_year,
// item.order,
// item.condition_it_should_be,
// item.condition_if_wrong,
// item.profit_detail.forecast_formula == null ? [] : item.profit_detail.forecast_formula
// ])
// if (item.children !== null) {
// if (item.children.length > 0) {
// item.children.map((items, indexs) => {
// handlePushChild(items)
// })
// }
// }
// })
if
(
response
.
data
)
{
let
res
=
[
response
.
data
.
data
]
const
handlePushChild
=
(
item
)
=>
{
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
0
]
===
item
.
company_id
)
if
(
indexIDzz
===
-
1
)
{
dataTable
.
push
([
// item.company_id,
0
,
item
.
parent
,
item
.
level
,
item
.
item_name
,
item
.
revenue_last_year
,
item
.
revenue_ol
,
item
.
revenue_mb
,
item
.
revenue_percent_of_mb
,
item
.
revenue_next_year
,
item
.
revenue_next_two_year
,
item
.
ebitda_last_year
,
item
.
ebitda_ol
,
item
.
ebitda_mb
,
item
.
ebitda_percent_of_mb
,
item
.
ebitda_next_year
,
item
.
ebitda_next_two_year
,
item
.
tpat_last_year
,
item
.
tpat_ol
,
item
.
tpat_mb
,
item
.
tpat_percent_of_mb
,
item
.
tpat_next_year
,
item
.
tpat_next_two_year
,
item
.
npat_last_year
,
item
.
npat_ol
,
item
.
npat_mb
,
item
.
npat_percent_of_mb
,
item
.
npat_next_year
,
item
.
npat_next_two_year
,
item
.
roic_ol
,
item
.
roic_next_year
,
item
.
roic_next_two_year
,
item
.
ebitda_margin_ol
,
item
.
ebitda_margin_next_year
,
item
.
ebitda_margin_next_two_year
,
item
.
tpat_margin_ol
,
item
.
tpat_margin_next_year
,
item
.
tpat_margin_next_two_year
,
item
.
percent_revenue_yoy_ol
,
item
.
percent_revenue_yoy_next_year
,
item
.
percent_revenue_yoy_next_two_year
,
item
.
percent_ebitda_yoy_ol
,
item
.
percent_ebitda_yoy_next_year
,
item
.
percent_ebitda_yoy_next_two_year
,
item
.
percent_tpat_yoy_ol
,
item
.
percent_tpat_yoy_next_year
,
item
.
percent_tpat_yoy_next_two_year
,
item
.
percent_npat_yoy_ol
,
item
.
percent_npat_yoy_next_year
,
item
.
percent_npat_yoy_next_two_year
,
// item.npat_margin_ol,
// item.npat_margin_next_year,
// item.npat_margin_next_two_year,
item
.
order
,
])
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
}
res
.
map
((
item
,
index
)
=>
{
dataTable
.
push
([
// item.company_id,
0
,
item
.
parent
,
item
.
level
,
item
.
item_name
,
item
.
revenue_last_year
,
item
.
revenue_ol
,
item
.
revenue_mb
,
item
.
revenue_percent_of_mb
,
item
.
revenue_next_year
,
item
.
revenue_next_two_year
,
item
.
ebitda_last_year
,
item
.
ebitda_ol
,
item
.
ebitda_mb
,
item
.
ebitda_percent_of_mb
,
item
.
ebitda_next_year
,
item
.
ebitda_next_two_year
,
item
.
tpat_last_year
,
item
.
tpat_ol
,
item
.
tpat_mb
,
item
.
tpat_percent_of_mb
,
item
.
tpat_next_year
,
item
.
tpat_next_two_year
,
item
.
npat_last_year
,
item
.
npat_ol
,
item
.
npat_mb
,
item
.
npat_percent_of_mb
,
item
.
npat_next_year
,
item
.
npat_next_two_year
,
item
.
roic_ol
,
item
.
roic_next_year
,
item
.
roic_next_two_year
,
item
.
ebitda_margin_ol
,
item
.
ebitda_margin_next_year
,
item
.
ebitda_margin_next_two_year
,
item
.
tpat_margin_ol
,
item
.
tpat_margin_next_year
,
item
.
tpat_margin_next_two_year
,
item
.
percent_revenue_yoy_ol
,
item
.
percent_revenue_yoy_next_year
,
item
.
percent_revenue_yoy_next_two_year
,
item
.
percent_ebitda_yoy_ol
,
item
.
percent_ebitda_yoy_next_year
,
item
.
percent_ebitda_yoy_next_two_year
,
item
.
percent_tpat_yoy_ol
,
item
.
percent_tpat_yoy_next_year
,
item
.
percent_tpat_yoy_next_two_year
,
item
.
percent_npat_yoy_ol
,
item
.
percent_npat_yoy_next_year
,
item
.
percent_npat_yoy_next_two_year
,
// item.npat_margin_ol,
// item.npat_margin_next_year,
// item.npat_margin_next_two_year,
item
.
order
,
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
})
console
.
log
(
dataTable
);
this
.
setState
({
dataTable
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
//
} else {
//
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
//
}
//
})
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
}
})
}
else
if
(
this
.
state
.
report
.
value
===
4
)
{
api
.
create
().
getHierarkiReportHistorical
(
newPayload
).
then
(
response
=>
{
console
.
log
(
newPayload
);
...
...
src/container/SummaryTriputra/TableSummaryTriputra.js
View file @
d4d7e0a5
...
...
@@ -4350,6 +4350,21 @@ export default class TableSummaryTriputra extends Component {
const
columnCPSM
=
[
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
"Company"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
...
...
@@ -4361,7 +4376,14 @@ export default class TableSummaryTriputra extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
width
:
300
}}
>
{
val
}
{
tableMeta
.
rowData
[
2
]
==
0
?
<
span
style
=
{{
fontSize
:
12
,
fontWeight
:
'bold'
}}
>
{
String
(
val
).
toUpperCase
()}
<
/span
>
:
<
div
style
=
{{
paddingLeft
:
20
*
Number
(
tableMeta
.
rowData
[
2
])
}}
>
<
span
style
=
{{
fontSize
:
12
}}
>
{
val
}
<
/span
>
<
/div
>
}
<
/div
>
)
}
...
...
@@ -4370,7 +4392,7 @@ export default class TableSummaryTriputra extends Component {
name
:
`Revenue`
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
th
style
=
{{
...
style2
,
backgroundColor
:
'#1c71b8'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
}}
>
<
th
style
=
{{
...
style2
,
backgroundColor
:
'#1c71b8'
,
top
:
0
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
}}
>
<
div
style
=
{{
borderBottom
:
"1px #fff solid"
,
textAlign
:
'center'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
padding
:
5
}}
>
{
columnMeta
.
name
}
<
/div
>
<
div
className
=
"grid grid-2x"
style
=
{{
...
style2
,
backgroundColor
:
'#37b5e6'
,
color
:
'#fff'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
position
:
"sticky"
}}
>
<
div
className
=
"column-1 grid grid-3x"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
}}
>
...
...
@@ -4400,43 +4422,119 @@ export default class TableSummaryTriputra extends Component {
),
setCellProps
:
()
=>
({
style2
}),
customBodyRender
:
(
val
,
tableMeta
,
updateValue
)
=>
{
console
.
log
(
tableMeta
)
console
.
log
(
val
)
return
(
<
div
>
<
div
className
=
"grid grid-2x content-center"
>
<
div
className
=
"grid grid-3x content-center"
>
<
div
className
=
"col-1"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
{
val
.
a
}
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
val
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
4
]).
toFixed
(
2
)}
/
>
}
/
>
<
/div
>
<
/div
>
<
div
className
=
"col-2"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
{
val
.
b
}
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
val
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
5
]).
toFixed
(
2
)}
/
>
}
/
>
<
/div
>
<
/div
>
<
div
className
=
"col-3"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
{
val
.
c
}
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
val
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
6
]).
toFixed
(
2
)}
/
>
}
/
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"grid grid-3x content-center"
>
<
div
className
=
"col-1"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
{
val
.
d
}
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
val
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
suffix
=
{
'%'
}
value
=
{
tableMeta
.
rowData
[
7
]}
/
>
}
/
>
<
/div
>
<
/div
>
<
div
className
=
"col-2"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
{
val
.
e
}
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
val
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
8
]).
toFixed
(
2
)}
/
>
}
/
>
<
/div
>
<
/div
>
<
div
className
=
"col-3"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
{
val
.
f
}
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
val
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
9
]).
toFixed
(
2
)}
/
>
}
/
>
<
/div
>
<
/div
>
<
/div
>
...
...
@@ -4445,6 +4543,36 @@ export default class TableSummaryTriputra extends Component {
)
}
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
`EBITDA`
,
options
:
{
...
...
@@ -4484,8 +4612,21 @@ export default class TableSummaryTriputra extends Component {
<
div
className
=
"grid grid-2x content-center"
>
<
div
className
=
"grid grid-3x content-center"
>
<
div
className
=
"col-1"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
{
val
.
a
}
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
val
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
tableMeta
.
rowData
[
10
]).
toFixed
(
2
)}
/
>
}
/
>
<
/div
>
<
/div
>
<
div
className
=
"col-2"
>
...
...
@@ -4522,7 +4663,37 @@ export default class TableSummaryTriputra extends Component {
}
}
},
{
name
:
`NPAT`
,
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
`TPAT`
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
th
style
=
{{
...
style2
,
backgroundColor
:
'#1c71b8'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
}}
>
...
...
@@ -4598,7 +4769,37 @@ export default class TableSummaryTriputra extends Component {
}
}
},
{
name
:
`TPAT`
,
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
`NPAT`
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
th
style
=
{{
...
style2
,
backgroundColor
:
'#1c71b8'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
}}
>
...
...
@@ -4674,7 +4875,37 @@ export default class TableSummaryTriputra extends Component {
}
}
},
{
name
:
`TPAT`
,
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
`ROIC`
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
th
style
=
{{
...
style2
,
backgroundColor
:
'#1c71b8'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
}}
>
...
...
@@ -4717,6 +4948,21 @@ export default class TableSummaryTriputra extends Component {
)
}
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
`EBITDA Margin`
,
options
:
{
...
...
@@ -4761,6 +5007,21 @@ export default class TableSummaryTriputra extends Component {
)
}
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
`TPAT Margin`
,
options
:
{
...
...
@@ -4805,6 +5066,21 @@ export default class TableSummaryTriputra extends Component {
)
}
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
`% Revenue YoY`
,
options
:
{
...
...
@@ -4849,6 +5125,21 @@ export default class TableSummaryTriputra extends Component {
)
}
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
`% EBITDA YoY`
,
options
:
{
...
...
@@ -4894,7 +5185,22 @@ export default class TableSummaryTriputra extends Component {
}
}
},
{
name
:
`TPAT Margin`
,
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
`% TPAT YoY`
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
th
style
=
{{
...
style2
,
backgroundColor
:
'#1c71b8'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
}}
>
...
...
@@ -4937,6 +5243,21 @@ export default class TableSummaryTriputra extends Component {
)
}
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
`% NPAT YoY`
,
options
:
{
...
...
@@ -4981,7 +5302,22 @@ export default class TableSummaryTriputra extends Component {
)
}
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
]
const
columns
=
[]
...
...
@@ -4991,7 +5327,7 @@ export default class TableSummaryTriputra extends Component {
<
div
style
=
{{
padding
:
'0px 20px 20px 20px'
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
350
:
100
)
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
data
=
{
this
.
props
.
type
===
3
?
datas
:
dataTable2
}
data
=
{
dataTable2
}
columns
=
{
this
.
props
.
type
===
1
?
columnMTD
:
this
.
props
.
type
===
2
?
columnYTD
:
this
.
props
.
type
===
3
?
columnCPSM
:
this
.
props
.
type
===
4
?
columnHistorical
:
columns
}
options
=
{
options
}
/
>
...
...
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