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
10f664a8
Commit
10f664a8
authored
Jan 26, 2021
by
Riri Novita
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'riri' into 'master'
pl banyak See merge request
!1043
parents
23735252
35a4d78c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
797 additions
and
192 deletions
+797
-192
SubHolding.js
src/container/Laporan/SubHolding.js
+74
-32
TableSubHolding.js
src/container/Laporan/TableSubHolding.js
+682
-119
ProfitLossMR.js
src/container/MonthlyReport/ProfitLossMR.js
+41
-41
No files found.
src/container/Laporan/SubHolding.js
View file @
10f664a8
...
...
@@ -1434,34 +1434,56 @@ export default class SubHolding extends Component {
let
ytd_actual
=
item
.
profit_loss
.
ytd_actual
==
''
?
0
:
item
.
profit_loss
.
ytd_actual
let
ytd_mb
=
item
.
profit_loss
.
ytd_mb
==
''
?
0
:
item
.
profit_loss
.
ytd_mb
let
persenYtd
=
Number
(
ytd_actual
/
ytd_mb
)
let
ytd_last_year
=
item
.
profit_loss
.
ytd_last_year
==
''
?
0
:
item
.
profit_loss
.
ytd_last_year
let
persenYtdMB
=
Number
(
ytd_actual
/
ytd_mb
)
let
persenYtdLY
=
Number
(
ytd_actual
/
ytd_last_year
)
let
q1_actual
=
item
.
profit_loss
.
q1_actual
==
''
?
0
:
item
.
profit_loss
.
q1_actual
let
q1_mb
=
item
.
profit_loss
.
q1_mb
==
''
?
0
:
item
.
profit_loss
.
q1_mb
let
persenQuarter
=
Number
(
q1_actual
/
q1_mb
)
let
q1_last_year
=
item
.
profit_loss
.
q1_last_year
==
''
?
0
:
item
.
profit_loss
.
q1_last_year
let
persenQuarterMB
=
Number
(
q1_actual
/
q1_mb
)
let
persenQuarterLY
=
Number
(
q1_actual
/
q1_last_year
)
let
fy_actual
=
item
.
profit_loss
.
fy_actual
==
''
?
0
:
item
.
profit_loss
.
fy_actual
let
fy_mb
=
item
.
profit_loss
.
fy_mb
==
''
?
0
:
item
.
profit_loss
.
fy_mb
let
persenFy
=
Number
(
fy_actual
/
fy_mb
)
let
fy_ol
=
item
.
profit_loss
.
fy_ol
==
''
?
0
:
item
.
profit_loss
.
fy_ol
let
fy_last_year
=
item
.
profit_loss
.
fy_last_year
==
''
?
0
:
item
.
profit_loss
.
fy_last_year
let
persenFyMB
=
Number
(
fy_actual
/
fy_mb
)
let
persenFyOL
=
Number
(
fy_actual
/
fy_ol
)
let
persenFyLY
=
Number
(
fy_actual
/
fy_last_year
)
let
persenFyOLMB
=
Number
(
fy_ol
/
fy_mb
)
dbSumaPL
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
formula
,
item
.
level
,
item
.
description
,
item
.
profit_loss
.
mtd_actual
,
item
.
profit_loss
.
mtd
,
isNaN
(
persenMtd
)
?
0
:
persenMtd
*
100
,
item
.
profit_loss
.
mtd
_mb
,
isNaN
(
persenMtd
)
||
persenMtd
==
'Infinity'
||
persenMtd
==
'-Infinity'
?
(
item
.
profit_loss
.
mtd_mb
==
''
||
item
.
profit_loss
.
mtd_mb
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
mtd_mb
==
''
||
item
.
profit_loss
.
mtd_mb
==
0
?
persenMtd
*
-
100
:
persenMtd
*
100
)
,
item
.
profit_loss
.
mtd_last_year
,
item
.
profit_loss
.
ytd_actual
,
item
.
profit_loss
.
ytd
,
isNaN
(
persenYtd
)?
0
:
persenYtd
*
100
,
item
.
profit_loss
.
ytd
_mb
,
isNaN
(
persenYtd
MB
)
||
persenYtdMB
==
'Infinity'
||
persenYtdMB
==
'-Infinity'
?
(
item
.
profit_loss
.
ytd_mb
==
''
||
item
.
profit_loss
.
ytd_mb
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
ytd_mb
==
''
||
item
.
profit_loss
.
ytd_mb
==
0
?
persenYtdMB
*
-
100
:
persenYtdMB
*
100
)
,
item
.
profit_loss
.
ytd_last_year
,
item
.
profit_loss
.
quarter_actual
,
item
.
profit_loss
.
quarter
,
isNaN
(
persenQuarter
)?
0
:
persenQuarter
*
100
,
item
.
profit_loss
.
quarter_last_year
,
isNaN
(
persenYtdLY
)
||
persenYtdLY
==
'Infinity'
||
persenYtdLY
==
'-Infinity'
?
(
item
.
profit_loss
.
ytd_last_year
==
''
||
item
.
profit_loss
.
ytd_last_year
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
ytd_last_year
==
''
||
item
.
profit_loss
.
ytd_last_year
==
0
?
persenYtdLY
*
-
100
:
persenYtdLY
*
100
),
item
.
profit_loss
.
q1_actual
,
item
.
profit_loss
.
q1_mb
,
isNaN
(
persenQuarterMB
)
||
persenQuarterMB
==
'Infinity'
||
persenQuarterMB
==
'-Infinity'
?
(
item
.
profit_loss
.
q1_mb
==
''
||
item
.
profit_loss
.
q1_mb
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
q1_mb
==
''
||
item
.
profit_loss
.
q1_mb
==
0
?
persenQuarterMB
*
-
100
:
persenQuarterMB
*
100
),
item
.
profit_loss
.
q1_last_year
,
isNaN
(
persenQuarterLY
)
||
persenQuarterLY
==
'Infinity'
||
persenQuarterLY
==
'-Infinity'
?
(
item
.
profit_loss
.
q1_last_year
==
''
||
item
.
profit_loss
.
q1_last_year
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
q1_last_year
==
''
||
item
.
profit_loss
.
q1_last_year
==
0
?
persenQuarterLY
*
-
100
:
persenQuarterLY
*
100
),
item
.
profit_loss
.
fy_actual
,
item
.
profit_loss
.
fy
,
isNaN
(
persenFy
)?
0
:
persenFy
*
100
,
item
.
profit_loss
.
fy_mb
,
isNaN
(
persenFyMB
)
||
persenFyMB
==
'Infinity'
||
persenFyMB
==
'-Infinity'
?
(
item
.
profit_loss
.
fy_mb
==
''
||
item
.
profit_loss
.
fy_mb
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
fy_mb
==
''
||
item
.
profit_loss
.
fy_mb
==
0
?
persenFyMB
*
-
100
:
persenFyMB
*
100
),
item
.
profit_loss
.
fy_ol
,
isNaN
(
persenFyOL
)
||
persenFyOL
==
'Infinity'
||
persenFyOL
==
'-Infinity'
?
(
item
.
profit_loss
.
fy_ol
==
''
||
item
.
profit_loss
.
fy_ol
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
fy_ol
==
''
||
item
.
profit_loss
.
fy_ol
==
0
?
persenFyOL
*
-
100
:
persenFyOL
*
100
),
item
.
profit_loss
.
fy_last_year
,
isNaN
(
persenFyLY
)
||
persenFyLY
==
'Infinity'
||
persenFyLY
==
'-Infinity'
?
(
item
.
profit_loss
.
fy_last_year
==
''
||
item
.
profit_loss
.
fy_last_year
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
fy_last_year
==
''
||
item
.
profit_loss
.
fy_last_year
==
0
?
persenFyLY
*
-
100
:
persenFyLY
*
100
),
isNaN
(
persenFyOLMB
)
||
persenFyOLMB
==
'Infinity'
||
persenFyOLMB
==
'-Infinity'
?
(
item
.
profit_loss
.
fy_percent_ach_ol_to_mb
==
''
||
item
.
profit_loss
.
fy_percent_ach_ol_to_mb
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
fy_percent_ach_ol_to_mb
==
''
||
item
.
profit_loss
.
fy_percent_ach_ol_to_mb
==
0
?
persenFyOLMB
*
-
100
:
persenFyOLMB
*
100
),
item
.
profit_loss
.
forecast_next_year
,
item
.
profit_loss
.
forecast_more_year
])
}
if
(
item
.
children
!==
null
)
{
...
...
@@ -1474,39 +1496,59 @@ export default class SubHolding extends Component {
}
res
.
map
((
item
,
index
)
=>
{
let
mtd_actual
=
item
.
profit_loss
.
mtd_actual
==
''
?
0
:
item
.
profit_loss
.
mtd_actual
let
mtd
=
item
.
profit_loss
.
mtd
==
''
?
0
:
item
.
profit_loss
.
mtd
let
persenMtd
=
Number
(
mtd_actual
/
mtd
)
console
.
log
(
persenMtd
)
let
mtd
_mb
=
item
.
profit_loss
.
mtd_mb
==
''
?
0
:
item
.
profit_loss
.
mtd_mb
let
persenMtd
=
Number
(
mtd_actual
/
mtd
_mb
)
let
ytd_actual
=
item
.
profit_loss
.
ytd_actual
==
''
?
0
:
item
.
profit_loss
.
ytd_actual
let
ytd
=
item
.
profit_loss
.
ytd
==
''
?
0
:
item
.
profit_loss
.
ytd
let
persenYtd
=
Number
(
ytd_actual
/
ytd
)
let
ytd_mb
=
item
.
profit_loss
.
ytd_mb
==
''
?
0
:
item
.
profit_loss
.
ytd_mb
let
ytd_last_year
=
item
.
profit_loss
.
ytd_last_year
==
''
?
0
:
item
.
profit_loss
.
ytd_last_year
let
persenYtdMB
=
Number
(
ytd_actual
/
ytd_mb
)
let
persenYtdLY
=
Number
(
ytd_actual
/
ytd_last_year
)
let
quarter_actual
=
item
.
profit_loss
.
quarter_actual
==
''
?
0
:
item
.
profit_loss
.
quarter_actual
let
quarter
=
item
.
profit_loss
.
quarter
==
''
?
0
:
item
.
profit_loss
.
quarter
let
persenQuarter
=
Number
(
quarter_actual
/
quarter
)
let
q1_actual
=
item
.
profit_loss
.
q1_actual
==
''
?
0
:
item
.
profit_loss
.
q1_actual
let
q1_mb
=
item
.
profit_loss
.
q1_mb
==
''
?
0
:
item
.
profit_loss
.
q1_mb
let
q1_last_year
=
item
.
profit_loss
.
q1_last_year
==
''
?
0
:
item
.
profit_loss
.
q1_last_year
let
persenQuarterMB
=
Number
(
q1_actual
/
q1_mb
)
let
persenQuarterLY
=
Number
(
q1_actual
/
q1_last_year
)
let
fy_actual
=
item
.
profit_loss
.
fy_actual
==
''
?
0
:
item
.
profit_loss
.
fy_actual
let
fy
=
item
.
profit_loss
.
fy
==
''
?
0
:
item
.
profit_loss
.
fy
let
persenFy
=
Number
(
fy_actual
/
fy
)
let
fy_mb
=
item
.
profit_loss
.
fy_mb
==
''
?
0
:
item
.
profit_loss
.
fy_mb
let
fy_ol
=
item
.
profit_loss
.
fy_ol
==
''
?
0
:
item
.
profit_loss
.
fy_ol
let
fy_last_year
=
item
.
profit_loss
.
fy_last_year
==
''
?
0
:
item
.
profit_loss
.
fy_last_year
let
persenFyMB
=
Number
(
fy_actual
/
fy_mb
)
let
persenFyOL
=
Number
(
fy_actual
/
fy_ol
)
let
persenFyLY
=
Number
(
fy_actual
/
fy_last_year
)
let
persenFyOLMB
=
Number
(
fy_ol
/
fy_mb
)
dbSumaPL
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
formula
,
item
.
level
,
item
.
description
,
item
.
profit_loss
.
mtd_actual
,
item
.
profit_loss
.
mtd_mb
,
isNaN
(
persenMtd
)
||
persenMtd
==
'Infinity'
||
persenMtd
==
'-Infinity'
?
(
item
.
profit_loss
.
mtd
==
''
||
item
.
profit_loss
.
mtd
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
mtd
==
''
||
item
.
profit_loss
.
mtd
==
0
?
persenMtd
*
-
100
:
persenMtd
*
100
),
isNaN
(
persenMtd
)
||
persenMtd
==
'Infinity'
||
persenMtd
==
'-Infinity'
?
(
item
.
profit_loss
.
mtd
_mb
==
''
||
item
.
profit_loss
.
mtd_mb
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
mtd_mb
==
''
||
item
.
profit_loss
.
mtd_mb
==
0
?
persenMtd
*
-
100
:
persenMtd
*
100
),
item
.
profit_loss
.
mtd_last_year
,
item
.
profit_loss
.
ytd_actual
,
item
.
profit_loss
.
ytd
,
isNaN
(
persenYtd
)
||
persenYtd
==
'Infinity'
||
persenYtd
==
'-Infinity'
?
(
item
.
profit_loss
.
ytd
==
''
||
item
.
profit_loss
.
ytd
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
ytd
==
''
||
item
.
profit_loss
.
ytd
==
0
?
persenYtd
*
-
100
:
persenYtd
*
100
),
item
.
profit_loss
.
ytd
_mb
,
isNaN
(
persenYtd
MB
)
||
persenYtdMB
==
'Infinity'
||
persenYtdMB
==
'-Infinity'
?
(
item
.
profit_loss
.
ytd_mb
==
''
||
item
.
profit_loss
.
ytd_mb
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
ytd_mb
==
''
||
item
.
profit_loss
.
ytd_mb
==
0
?
persenYtdMB
*
-
100
:
persenYtdMB
*
100
),
item
.
profit_loss
.
ytd_last_year
,
item
.
profit_loss
.
quarter_actual
,
item
.
profit_loss
.
quarter
,
isNaN
(
persenQuarter
)
||
persenQuarter
==
'Infinity'
||
persenQuarter
==
'-Infinity'
?
(
item
.
profit_loss
.
quarter
==
''
||
item
.
profit_loss
.
quarter
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
quarter
==
''
||
item
.
profit_loss
.
quarter
==
0
?
persenQuarter
*
-
100
:
persenQuarter
*
100
),
item
.
profit_loss
.
quarter_last_year
,
isNaN
(
persenYtdLY
)
||
persenYtdLY
==
'Infinity'
||
persenYtdLY
==
'-Infinity'
?
(
item
.
profit_loss
.
ytd_last_year
==
''
||
item
.
profit_loss
.
ytd_last_year
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
ytd_last_year
==
''
||
item
.
profit_loss
.
ytd_last_year
==
0
?
persenYtdLY
*
-
100
:
persenYtdLY
*
100
),
item
.
profit_loss
.
q1_actual
,
item
.
profit_loss
.
q1_mb
,
isNaN
(
persenQuarterMB
)
||
persenQuarterMB
==
'Infinity'
||
persenQuarterMB
==
'-Infinity'
?
(
item
.
profit_loss
.
q1_mb
==
''
||
item
.
profit_loss
.
q1_mb
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
q1_mb
==
''
||
item
.
profit_loss
.
q1_mb
==
0
?
persenQuarterMB
*
-
100
:
persenQuarterMB
*
100
),
item
.
profit_loss
.
q1_last_year
,
isNaN
(
persenQuarterLY
)
||
persenQuarterLY
==
'Infinity'
||
persenQuarterLY
==
'-Infinity'
?
(
item
.
profit_loss
.
q1_last_year
==
''
||
item
.
profit_loss
.
q1_last_year
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
q1_last_year
==
''
||
item
.
profit_loss
.
q1_last_year
==
0
?
persenQuarterLY
*
-
100
:
persenQuarterLY
*
100
),
item
.
profit_loss
.
fy_actual
,
item
.
profit_loss
.
fy
,
isNaN
(
persenFy
)
||
persenFy
==
'Infinity'
||
persenFy
==
'-Infinity'
?
(
item
.
profit_loss
.
fy
==
''
||
item
.
profit_loss
.
fy
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
fy
==
''
||
item
.
profit_loss
.
fy
==
0
?
persenFy
*
-
100
:
persenFy
*
100
),
item
.
profit_loss
.
fy_mb
,
isNaN
(
persenFyMB
)
||
persenFyMB
==
'Infinity'
||
persenFyMB
==
'-Infinity'
?
(
item
.
profit_loss
.
fy_mb
==
''
||
item
.
profit_loss
.
fy_mb
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
fy_mb
==
''
||
item
.
profit_loss
.
fy_mb
==
0
?
persenFyMB
*
-
100
:
persenFyMB
*
100
),
item
.
profit_loss
.
fy_ol
,
isNaN
(
persenFyOL
)
||
persenFyOL
==
'Infinity'
||
persenFyOL
==
'-Infinity'
?
(
item
.
profit_loss
.
fy_ol
==
''
||
item
.
profit_loss
.
fy_ol
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
fy_ol
==
''
||
item
.
profit_loss
.
fy_ol
==
0
?
persenFyOL
*
-
100
:
persenFyOL
*
100
),
item
.
profit_loss
.
fy_last_year
,
isNaN
(
persenFyLY
)
||
persenFyLY
==
'Infinity'
||
persenFyLY
==
'-Infinity'
?
(
item
.
profit_loss
.
fy_last_year
==
''
||
item
.
profit_loss
.
fy_last_year
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
fy_last_year
==
''
||
item
.
profit_loss
.
fy_last_year
==
0
?
persenFyLY
*
-
100
:
persenFyLY
*
100
),
isNaN
(
persenFyOLMB
)
||
persenFyOLMB
==
'Infinity'
||
persenFyOLMB
==
'-Infinity'
?
(
item
.
profit_loss
.
fy_percent_ach_ol_to_mb
==
''
||
item
.
profit_loss
.
fy_percent_ach_ol_to_mb
==
0
?
-
0
:
0
)
:
(
item
.
profit_loss
.
fy_percent_ach_ol_to_mb
==
''
||
item
.
profit_loss
.
fy_percent_ach_ol_to_mb
==
0
?
persenFyOLMB
*
-
100
:
persenFyOLMB
*
100
),
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
...
...
src/container/Laporan/TableSubHolding.js
View file @
10f664a8
...
...
@@ -15324,6 +15324,31 @@ export default class TableSubHolding extends Component {
const columnSummaryPL = [
{
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "Account",
options: {
customHeadRender: (columnMeta) => (
...
...
@@ -15335,13 +15360,20 @@ export default class TableSubHolding extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ width: 300 }}>
{ val }
{
tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
:
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div>
}
</div>
)
}
}
}, {
name: `MTD
2021
`,
name: `MTD
${this.props.periode}
`,
options: {
customHeadRender: (columnMeta) => (
<th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
...
...
@@ -15366,32 +15398,101 @@ export default class TableSubHolding extends Component {
),
setCellProps: () => ({ style2 }),
customBodyRender: (val, tableMeta, updateValue) => {
console.log(tableMeta)
console.log(val)
return (
<div>
<div className="grid grid-1x content-center">
<div className="grid grid-4x content-center">
<div className="col-1">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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(1)}
/>
}
/>
</div>
}
</div>
<div className="col-2">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[7]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-3">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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(1)}
/>
}
/>
</div>
}
</div>
<div className="col-4">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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(1)}
/>
}
/>
</div>
}
</div>
</div>
</div>
...
...
@@ -15400,13 +15501,13 @@ export default class TableSubHolding extends Component {
}
}
}, {
name: `YTD
2021
`,
name: `YTD
${this.props.periode}
`,
options: {
customHeadRender: (columnMeta) => (
<th style={{ ...style2, backgroundColor: '#1c71b8', 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, height: 50 }}>{columnMeta.name}</div>
<div className="grid grid-1x" style={{ ...style2, backgroundColor: '#37b5e6', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1 grid grid-
4
x" style={{ placeSelf: 'center', textAlign: 'center' }}>
<div className="column-1 grid grid-
5
x" style={{ placeSelf: 'center', textAlign: 'center' }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"Actual"}</span>
</div>
...
...
@@ -15419,38 +15520,133 @@ export default class TableSubHolding extends Component {
<div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d06' }}>
<span>{"Last Year"}</span>
</div>
<div className="column-5" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d06' }}>
<span>{"% of LY"}</span>
</div>
</div>
</div>
</th>
),
setCellProps: () => ({ style2 }),
customBodyRender: (val, tableMeta, updateValue) => {
console.log(tableMeta)
console.log(val)
return (
<div>
<div className="grid grid-1x content-center">
<div className="grid grid-
4
x content-center">
<div className="grid grid-
5
x content-center">
<div className="col-1">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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(1)}
/>
}
/>
</div>
}
</div>
<div className="col-2">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[11]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-3">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[12]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-4">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[13]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-5">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[14]).toFixed(1)}
/>
}
/>
</div>
}
</div>
</div>
</div>
...
...
@@ -15459,13 +15655,13 @@ export default class TableSubHolding extends Component {
}
}
}, {
name: `Q1
2021
`,
name: `Q1
${this.props.periode}
`,
options: {
customHeadRender: (columnMeta) => (
<th style={{ ...style2, backgroundColor: '#1c71b8', 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, height: 50 }}>{columnMeta.name}</div>
<div className="grid grid-1x" style={{ ...style2, backgroundColor: '#37b5e6', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1 grid grid-
4
x" style={{ placeSelf: 'center', textAlign: 'center' }}>
<div className="column-1 grid grid-
5
x" style={{ placeSelf: 'center', textAlign: 'center' }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"Actual"}</span>
</div>
...
...
@@ -15478,38 +15674,133 @@ export default class TableSubHolding extends Component {
<div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d06' }}>
<span>{"Last Year"}</span>
</div>
<div className="column-5" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d06' }}>
<span>{"% of LY"}</span>
</div>
</div>
</div>
</th>
),
setCellProps: () => ({ style2 }),
customBodyRender: (val, tableMeta, updateValue) => {
console.log(tableMeta)
console.log(val)
return (
<div>
<div className="grid grid-1x content-center">
<div className="grid grid-
4
x content-center">
<div className="grid grid-
5
x content-center">
<div className="col-1">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[15]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-2">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
</div>
</div>
<div className="col-3">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[16]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-3">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[17]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-4">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[18]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-5">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[19]).toFixed(1)}
/>
}
/>
</div>
}
</div>
</div>
</div>
...
...
@@ -15518,7 +15809,7 @@ export default class TableSubHolding extends Component {
}
}
}, {
name: `FY
2021
`,
name: `FY
${this.props.periode}
`,
options: {
customHeadRender: (columnMeta) => (
<th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
...
...
@@ -15557,57 +15848,198 @@ export default class TableSubHolding 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="col-1">
<div className="grid grid-4x content-center">
<div className="col-1">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[20]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-2">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[21]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-3">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[22]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-4">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[23]).toFixed(1)}
/>
}
/>
</div>
}
</div>
</div>
</div>
<div className="col-2">
<div className="grid grid-4x content-center">
<div className="col-1">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[24]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-2">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[25]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-3">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[26]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-4">
<div style={{ textAlign: 'center', width: 90 }}>
0.0
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[27]).toFixed(1)}
/>
}
/>
</div>
}
</div>
</div>
</div>
...
...
@@ -15617,7 +16049,7 @@ export default class TableSubHolding extends Component {
}
}
}, {
name:
"2022"
,
name:
`${Number(this.props.periode) + 1}`
,
options: {
customHeadRender: (columnMeta) => (
<th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', fontSize: 13, top: 0, zIndex: 102, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
...
...
@@ -15626,7 +16058,7 @@ export default class TableSubHolding extends Component {
</TableCell> */}
<div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, height: 50 }}>{columnMeta.name}</div>
<div className="grid grid-1x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#1c71b8', width:
96
}}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#1c71b8', width:
145
}}>
<span>{"ForeCast"}</span>
</div>
</div>
...
...
@@ -15636,13 +16068,33 @@ export default class TableSubHolding extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[28]).toFixed(1)}
/>
}
/>
</div>
}
</div>
)
}
}
}, {
name:
"2023"
,
name:
`${Number(this.props.periode) + 2}`
,
options: {
customHeadRender: (columnMeta) => (
<th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', fontSize: 13, top: 0, zIndex: 102, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
...
...
@@ -15651,7 +16103,7 @@ export default class TableSubHolding extends Component {
</TableCell> */}
<div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, height: 50 }}>{columnMeta.name}</div>
<div className="grid grid-1x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#1c71b8', width:
96
}}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#1c71b8', width:
145
}}>
<span>{"ForeCast"}</span>
</div>
</div>
...
...
@@ -15661,12 +16113,123 @@ export default class TableSubHolding extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<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[29]).toFixed(1)}
/>
}
/>
</div>
}
</div>
)
}
}
}, {
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: "",
options: {
display: false
}
}, {
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: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}
]
const columnSummaryFR = [
...
...
@@ -16161,7 +16724,7 @@ export default class TableSubHolding 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 ===
8 ? dataSummaryPL : this.props.type ===
9 ? dataSummaryFR : dataTable2}
data={this.props.type === 9 ? dataSummaryFR : dataTable2}
columns={this.props.type === 2 ? columnDBBS : this.props.type === 1 ? columnDBPLDetail : this.props.type === 3 ? columnDBPL : this.props.type === 4 ? columnDBFR : this.props.type === 5 ? columnDBTP : this.props.type === 7 ? columnSummaryBS : this.props.type === 21 ? columnDBOI : this.props.type === 6? columnDBCF : this.props.type === 8 ? columnSummaryPL : this.props.type === 9 ? columnSummaryFR : columns}
options={options}
/>
src/container/MonthlyReport/ProfitLossMR.js
View file @
10f664a8
...
...
@@ -376,22 +376,22 @@ export default class ProfitLossMR extends Component {
this
.
state
.
dataTable
.
map
(
i
=>
{
data
.
push
({
"item_report_id"
:
i
[
1
],
"notes"
:
i
[
6
]
,
"rolling_outlook"
:
i
[
7
]
,
"master_budget"
:
i
[
8
]
,
"rolling_budget"
:
i
[
9
]
,
"actual"
:
i
[
10
]
,
"ytd_actual"
:
i
[
11
]
,
"actual_previous_month"
:
i
[
12
]
,
"amount_act_vs_previous_month"
:
i
[
13
]
,
"percent_act_vs_previous_month"
:
i
[
14
]
,
"amount_act_vs_mb"
:
i
[
15
]
,
"percent_act_vs_mb"
:
i
[
16
]
,
"amount_act_vs_rb"
:
i
[
17
]
,
"percent_act_vs_rb"
:
i
[
18
]
,
"mtd_vs_mb"
:
i
[
19
]
,
"mtd_vs_rb"
:
i
[
20
]
,
"mtd_vs_previous_month"
:
i
[
21
]
,
"notes"
:
String
(
i
[
6
])
,
"rolling_outlook"
:
String
(
Number
(
i
[
7
]).
toFixed
(
1
))
,
"master_budget"
:
String
(
Number
(
i
[
8
]).
toFixed
(
1
))
,
"rolling_budget"
:
String
(
Number
(
i
[
9
]).
toFixed
(
1
))
,
"actual"
:
String
(
Number
(
i
[
10
]).
toFixed
(
1
))
,
"ytd_actual"
:
String
(
Number
(
i
[
11
]).
toFixed
(
1
))
,
"actual_previous_month"
:
String
(
Number
(
i
[
12
]).
toFixed
(
1
))
,
"amount_act_vs_previous_month"
:
String
(
Number
(
i
[
13
]).
toFixed
(
1
))
,
"percent_act_vs_previous_month"
:
String
(
Number
(
i
[
14
]).
toFixed
(
1
))
,
"amount_act_vs_mb"
:
String
(
Number
(
i
[
15
]).
toFixed
(
1
))
,
"percent_act_vs_mb"
:
String
(
Number
(
i
[
16
]).
toFixed
(
1
))
,
"amount_act_vs_rb"
:
String
(
Number
(
i
[
17
]).
toFixed
(
1
))
,
"percent_act_vs_rb"
:
String
(
Number
(
i
[
18
]).
toFixed
(
1
))
,
"mtd_vs_mb"
:
String
(
i
[
19
])
,
"mtd_vs_rb"
:
String
(
i
[
20
])
,
"mtd_vs_previous_month"
:
String
(
i
[
21
])
,
})
})
let
payload
=
{
...
...
@@ -405,31 +405,31 @@ export default class ProfitLossMR extends Component {
}
console
.
log
(
payload
);
// console.log(JSON.stringify(payload));
api
.
create
(
'UPLOAD'
).
createMonthlyReportPL
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
type
==
'submitted'
)
{
this
.
props
.
saveToMonthlyReport
(
'PL'
)
}
else
{
this
.
props
.
saveToMonthlyReport
()
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
,
handleTekTekTek
:
0
},
()
=>
{
document
.
body
.
style
.
overflow
=
'unset'
;
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
this
.
props
.
saveToMonthlyReport
()
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
,
handleTekTekTek
:
0
})
}
})
//
api.create('UPLOAD').createMonthlyReportPL(payload).then(response => {
//
console.log(response);
//
if (response.data) {
//
if (response.data.status === "success") {
//
if (type == 'submitted') {
//
this.props.saveToMonthlyReport('PL')
//
} else {
//
this.props.saveToMonthlyReport()
//
}
//
} else {
//
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 }, () => {
//
document.body.style.overflow = 'unset';
//
if (response.data.message.includes("Someone Logged In")) {
//
setTimeout(() => {
//
localStorage.removeItem(Constant.TOKEN)
//
window.location.reload();
//
}, 1000);
//
}
//
this.props.saveToMonthlyReport()
//
})
//
}
//
} else {
//
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 })
//
}
//
})
}
fileHandler
=
(
event
)
=>
{
...
...
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