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
dd197b84
Commit
dd197b84
authored
Nov 23, 2020
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ilangin object
parent
e34859c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
65 deletions
+54
-65
ProfitLossMR.js
src/container/MonthlyReport/ProfitLossMR.js
+54
-65
No files found.
src/container/MonthlyReport/ProfitLossMR.js
View file @
dd197b84
...
...
@@ -65,7 +65,7 @@ export default class ProfitLossMR extends Component {
"periode"
:
this
.
props
.
periode
,
"company_id"
:
this
.
props
.
company
.
company_id
,
"monthly_report_id"
:
this
.
props
.
monthlyReportId
,
"month"
:
this
.
props
.
month
.
month_id
"month
s
"
:
this
.
props
.
month
.
month_id
}
api
.
create
().
getHierarkiMontlyReportPL
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
...
...
@@ -84,26 +84,20 @@ export default class ProfitLossMR extends Component {
item
.
description
,
item
.
profit_loss
.
notes
===
""
?
null
:
item
.
profit_loss
.
notes
,
item
.
profit_loss
.
rolling_outlook
===
null
?
"0.0"
:
item
.
profit_loss
.
rolling_outlook
===
""
?
"0.0"
:
item
.
profit_loss
.
rolling_outlook
,
{
mb
:
item
.
profit_loss
.
master_budget
===
""
?
"0.0"
:
item
.
profit_loss
.
master_budget
,
rb
:
item
.
profit_loss
.
rolling_budget
===
""
?
"0.0"
:
item
.
profit_loss
.
rolling_budget
,
actual
:
item
.
profit_loss
.
actual
===
""
?
"0.0"
:
item
.
profit_loss
.
actual
},
item
.
profit_loss
.
master_budget
===
null
?
"0.0"
:
item
.
profit_loss
.
master_budget
===
""
?
"0.0"
:
item
.
profit_loss
.
master_budget
,
item
.
profit_loss
.
rolling_budget
===
null
?
"0.0"
:
item
.
profit_loss
.
rolling_budget
===
""
?
"0.0"
:
item
.
profit_loss
.
rolling_budget
,
item
.
profit_loss
.
actual
===
null
?
"0.0"
:
item
.
profit_loss
.
actual
===
""
?
"0.0"
:
item
.
profit_loss
.
actual
,
item
.
profit_loss
.
ytd_actual
===
null
?
"0.0"
:
item
.
profit_loss
.
ytd_actual
===
""
?
"0.0"
:
item
.
profit_loss
.
ytd_actual
,
item
.
profit_loss
.
actual_previous_month
===
null
?
"0.0"
:
item
.
profit_loss
.
actual_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
actual_previous_month
,
{
aavpm
:
item
.
profit_loss
.
amount_act_vs_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_previous_month
,
pavpm
:
item
.
profit_loss
.
percent_act_vs_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_previous_month
,
aavmb
:
item
.
profit_loss
.
amount_act_vs_mb
===
""
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_mb
,
pavmb
:
item
.
profit_loss
.
percent_act_vs_mb
===
""
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_mb
,
aavrb
:
item
.
profit_loss
.
amount_act_vs_rb
===
""
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_rb
,
pavrb
:
item
.
profit_loss
.
percent_act_vs_rb
===
""
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_rb
,
},
{
mtdvpm
:
item
.
profit_loss
.
mtd_vs_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_previous_month
,
mtdvmb
:
item
.
profit_loss
.
mtd_vs_mb
===
""
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_mb
,
mtdvrb
:
item
.
profit_loss
.
mtd_vs_rb
===
""
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_rb
,
}
item
.
profit_loss
.
amount_act_vs_previous_month
===
null
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_previous_month
,
item
.
profit_loss
.
percent_act_vs_previous_month
===
null
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_previous_month
,
item
.
profit_loss
.
amount_act_vs_mb
===
null
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_mb
===
""
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_mb
,
item
.
profit_loss
.
percent_act_vs_mb
===
null
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_mb
===
""
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_mb
,
item
.
profit_loss
.
amount_act_vs_rb
===
null
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_rb
===
""
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_rb
,
item
.
profit_loss
.
percent_act_vs_rb
===
null
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_rb
===
""
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_rb
,
item
.
profit_loss
.
mtd_vs_previous_month
===
null
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_previous_month
,
item
.
profit_loss
.
mtd_vs_mb
===
null
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_mb
===
""
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_mb
,
item
.
profit_loss
.
mtd_vs_rb
===
null
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_rb
===
""
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_rb
,
])
}
if
(
item
.
children
!==
null
)
{
...
...
@@ -124,26 +118,20 @@ export default class ProfitLossMR extends Component {
item
.
description
,
item
.
profit_loss
.
notes
===
""
?
null
:
item
.
profit_loss
.
notes
,
item
.
profit_loss
.
rolling_outlook
===
null
?
"0.0"
:
item
.
profit_loss
.
rolling_outlook
===
""
?
"0.0"
:
item
.
profit_loss
.
rolling_outlook
,
{
mb
:
item
.
profit_loss
.
master_budget
===
""
?
"0.0"
:
item
.
profit_loss
.
master_budget
,
rb
:
item
.
profit_loss
.
rolling_budget
===
""
?
"0.0"
:
item
.
profit_loss
.
rolling_budget
,
actual
:
item
.
profit_loss
.
actual
===
""
?
"0.0"
:
item
.
profit_loss
.
actual
},
item
.
profit_loss
.
master_budget
===
null
?
"0.0"
:
item
.
profit_loss
.
master_budget
===
""
?
"0.0"
:
item
.
profit_loss
.
master_budget
,
item
.
profit_loss
.
rolling_budget
===
null
?
"0.0"
:
item
.
profit_loss
.
rolling_budget
===
""
?
"0.0"
:
item
.
profit_loss
.
rolling_budget
,
item
.
profit_loss
.
actual
===
null
?
"0.0"
:
item
.
profit_loss
.
actual
===
""
?
"0.0"
:
item
.
profit_loss
.
actual
,
item
.
profit_loss
.
ytd_actual
===
null
?
"0.0"
:
item
.
profit_loss
.
ytd_actual
===
""
?
"0.0"
:
item
.
profit_loss
.
ytd_actual
,
item
.
profit_loss
.
actual_previous_month
===
null
?
"0.0"
:
item
.
profit_loss
.
actual_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
actual_previous_month
,
{
aavpm
:
item
.
profit_loss
.
amount_act_vs_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_previous_month
,
pavpm
:
item
.
profit_loss
.
percent_act_vs_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_previous_month
,
aavmb
:
item
.
profit_loss
.
amount_act_vs_mb
===
""
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_mb
,
pavmb
:
item
.
profit_loss
.
percent_act_vs_mb
===
""
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_mb
,
aavrb
:
item
.
profit_loss
.
amount_act_vs_rb
===
""
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_rb
,
pavrb
:
item
.
profit_loss
.
percent_act_vs_rb
===
""
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_rb
,
},
{
mtdvpm
:
item
.
profit_loss
.
mtd_vs_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_previous_month
,
mtdvmb
:
item
.
profit_loss
.
mtd_vs_mb
===
""
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_mb
,
mtdvrb
:
item
.
profit_loss
.
mtd_vs_rb
===
""
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_rb
,
}
item
.
profit_loss
.
amount_act_vs_previous_month
===
null
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_previous_month
,
item
.
profit_loss
.
percent_act_vs_previous_month
===
null
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_previous_month
,
item
.
profit_loss
.
amount_act_vs_mb
===
null
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_mb
===
""
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_mb
,
item
.
profit_loss
.
percent_act_vs_mb
===
null
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_mb
===
""
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_mb
,
item
.
profit_loss
.
amount_act_vs_rb
===
null
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_rb
===
""
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_rb
,
item
.
profit_loss
.
percent_act_vs_rb
===
null
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_rb
===
""
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_rb
,
item
.
profit_loss
.
mtd_vs_previous_month
===
null
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_previous_month
,
item
.
profit_loss
.
mtd_vs_mb
===
null
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_mb
===
""
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_mb
,
item
.
profit_loss
.
mtd_vs_rb
===
null
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_rb
===
""
?
"0.0"
:
item
.
profit_loss
.
mtd_vs_rb
,
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
...
...
@@ -168,15 +156,16 @@ export default class ProfitLossMR extends Component {
const
handleChange
=
(
value
,
tableMeta
,
indexChilds
)
=>
{
console
.
log
(
dataTable2
)
let
val
=
String
(
value
).
split
(
","
).
join
(
""
)
if
(
indexChilds
==
0
)
{
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
].
mb
=
Number
(
val
)
}
else
if
(
indexChilds
==
1
)
{
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
].
rb
=
Number
(
val
)
}
else
if
(
indexChilds
==
2
)
{
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
].
actual
=
Number
(
val
)
}
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
val
)
// if (indexChilds == 0) {
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
// }
// else if (indexChilds == 1) {
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
// }
// else if (indexChilds == 2) {
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
// }
}
let
columns
=
[
{
...
...
@@ -368,7 +357,7 @@ export default class ProfitLossMR extends Component {
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
.
mb
}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
...
...
@@ -376,7 +365,7 @@ export default class ProfitLossMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
value
.
mb
).
toFixed
(
1
)}
value
=
{
Number
(
value
).
toFixed
(
1
)}
/
>
}
/
>
...
...
@@ -391,7 +380,7 @@ export default class ProfitLossMR extends Component {
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
.
rb
}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
...
...
@@ -399,7 +388,7 @@ export default class ProfitLossMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
value
.
rb
).
toFixed
(
1
)}
value
=
{
Number
(
value
).
toFixed
(
1
)}
/
>
}
/
>
...
...
@@ -415,7 +404,7 @@ export default class ProfitLossMR extends Component {
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
.
actual
}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
...
...
@@ -423,7 +412,7 @@ export default class ProfitLossMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
value
.
actual
).
toFixed
(
1
)}
value
=
{
Number
(
value
).
toFixed
(
1
)}
/
>
}
/
>
...
...
@@ -432,7 +421,7 @@ export default class ProfitLossMR extends Component {
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
.
actual
}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
...
...
@@ -440,7 +429,7 @@ export default class ProfitLossMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
value
.
actual
).
toFixed
(
1
)}
value
=
{
Number
(
value
).
toFixed
(
1
)}
/
>
}
/
>
...
...
@@ -451,14 +440,14 @@ export default class ProfitLossMR extends Component {
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
.
actual
}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
value
.
actual
).
toFixed
(
1
)}
value
=
{
Number
(
value
).
toFixed
(
1
)}
onBlur
=
{(
event
)
=>
{
handleChange
(
event
.
target
.
value
,
tableMeta
,
2
)
// console.log(dataTable2)
...
...
@@ -583,7 +572,7 @@ export default class ProfitLossMR extends Component {
<
div
style
=
{{
textAlign
:
'right'
,
width
:
90
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
val
.
aavpm
val
}
<
/div
>
<
/div
>
...
...
@@ -591,7 +580,7 @@ export default class ProfitLossMR extends Component {
<
div
style
=
{{
textAlign
:
'right'
,
width
:
90
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
val
.
pavpm
val
}
<
/div
>
<
/div
>
...
...
@@ -603,7 +592,7 @@ export default class ProfitLossMR extends Component {
<
div
style
=
{{
textAlign
:
'right'
,
width
:
90
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
val
.
aavmb
val
}
<
/div
>
<
/div
>
...
...
@@ -611,7 +600,7 @@ export default class ProfitLossMR extends Component {
<
div
style
=
{{
textAlign
:
'right'
,
width
:
90
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
val
.
pavmb
val
}
<
/div
>
<
/div
>
...
...
@@ -623,7 +612,7 @@ export default class ProfitLossMR extends Component {
<
div
style
=
{{
textAlign
:
'right'
,
width
:
90
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
val
.
aavrb
val
}
<
/div
>
<
/div
>
...
...
@@ -631,7 +620,7 @@ export default class ProfitLossMR extends Component {
<
div
style
=
{{
textAlign
:
'right'
,
width
:
90
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
val
.
pavrb
val
}
<
/div
>
<
/div
>
...
...
@@ -679,7 +668,7 @@ export default class ProfitLossMR extends Component {
<
div
style
=
{{
textAlign
:
'right'
,
width
:
90
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
val
.
mtdvpm
val
}
<
/div
>
<
/div
>
...
...
@@ -687,7 +676,7 @@ export default class ProfitLossMR extends Component {
<
div
style
=
{{
textAlign
:
'right'
,
width
:
90
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
val
.
mtdvmb
val
}
<
/div
>
<
/div
>
...
...
@@ -695,7 +684,7 @@ export default class ProfitLossMR extends Component {
<
div
style
=
{{
textAlign
:
'right'
,
width
:
90
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
val
.
mtdvrb
val
}
<
/div
>
<
/div
>
...
...
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