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
d7030da5
Commit
d7030da5
authored
Nov 25, 2020
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benerin formula
parent
c0050637
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
141 additions
and
179 deletions
+141
-179
ProfitLossMR.js
src/container/MonthlyReport/ProfitLossMR.js
+141
-179
No files found.
src/container/MonthlyReport/ProfitLossMR.js
View file @
d7030da5
...
...
@@ -85,21 +85,21 @@ export default class ProfitLossMR extends Component {
item
.
level
,
item
.
description
,
item
.
profit_loss
.
notes
===
""
?
null
:
item
.
profit_loss
.
notes
,
item
.
profit_loss
.
rolling_outlook
===
null
?
"
1.0"
:
item
.
profit_loss
.
rolling_outlook
===
""
?
"1
.0"
:
item
.
profit_loss
.
rolling_outlook
,
item
.
profit_loss
.
master_budget
===
null
?
"
2.0"
:
item
.
profit_loss
.
master_budget
===
""
?
"2
.0"
:
item
.
profit_loss
.
master_budget
,
item
.
profit_loss
.
rolling_budget
===
null
?
"
3.0"
:
item
.
profit_loss
.
rolling_budget
===
""
?
"3
.0"
:
item
.
profit_loss
.
rolling_budget
,
item
.
profit_loss
.
actual
===
null
?
"
4.0"
:
item
.
profit_loss
.
actual
===
""
?
"4
.0"
:
item
.
profit_loss
.
actual
,
item
.
profit_loss
.
ytd_actual
===
null
?
"
5.0"
:
item
.
profit_loss
.
ytd_actual
===
""
?
"5
.0"
:
item
.
profit_loss
.
ytd_actual
,
item
.
profit_loss
.
actual_previous_month
===
null
?
"
6.0"
:
item
.
profit_loss
.
actual_previous_month
===
""
?
"6
.0"
:
item
.
profit_loss
.
actual_previous_month
,
item
.
profit_loss
.
amount_act_vs_previous_month
===
null
?
"
7.0"
:
item
.
profit_loss
.
amount_act_vs_previous_month
===
""
?
"7
.0"
:
item
.
profit_loss
.
amount_act_vs_previous_month
,
item
.
profit_loss
.
percent_act_vs_previous_month
===
null
?
"
8.0"
:
item
.
profit_loss
.
percent_act_vs_previous_month
===
""
?
"8
.0"
:
item
.
profit_loss
.
percent_act_vs_previous_month
,
item
.
profit_loss
.
amount_act_vs_mb
===
null
?
"
9.0"
:
item
.
profit_loss
.
amount_act_vs_mb
===
""
?
"9
.0"
:
item
.
profit_loss
.
amount_act_vs_mb
,
item
.
profit_loss
.
percent_act_vs_mb
===
null
?
"
10.0"
:
item
.
profit_loss
.
percent_act_vs_mb
===
""
?
"1
0.0"
:
item
.
profit_loss
.
percent_act_vs_mb
,
item
.
profit_loss
.
amount_act_vs_rb
===
null
?
"
11.0"
:
item
.
profit_loss
.
amount_act_vs_rb
===
""
?
"11
.0"
:
item
.
profit_loss
.
amount_act_vs_rb
,
item
.
profit_loss
.
percent_act_vs_rb
===
null
?
"
12.0"
:
item
.
profit_loss
.
percent_act_vs_rb
===
""
?
"12
.0"
:
item
.
profit_loss
.
percent_act_vs_rb
,
item
.
profit_loss
.
mtd_vs_previous_month
===
null
?
"
13.0"
:
item
.
profit_loss
.
mtd_vs_previous_month
===
""
?
"13
.0"
:
item
.
profit_loss
.
mtd_vs_previous_month
,
item
.
profit_loss
.
mtd_vs_mb
===
null
?
"
14.0"
:
item
.
profit_loss
.
mtd_vs_mb
===
""
?
"14
.0"
:
item
.
profit_loss
.
mtd_vs_mb
,
item
.
profit_loss
.
mtd_vs_rb
===
null
?
"
15.0"
:
item
.
profit_loss
.
mtd_vs_rb
===
""
?
"15
.0"
:
item
.
profit_loss
.
mtd_vs_rb
,
item
.
profit_loss
.
rolling_outlook
===
null
?
"
0.0"
:
item
.
profit_loss
.
rolling_outlook
===
""
?
"0
.0"
:
item
.
profit_loss
.
rolling_outlook
,
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
,
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
,
item
.
order
])
}
...
...
@@ -120,21 +120,21 @@ export default class ProfitLossMR extends Component {
item
.
level
,
item
.
description
,
item
.
profit_loss
.
notes
===
""
?
null
:
item
.
profit_loss
.
notes
,
item
.
profit_loss
.
rolling_outlook
===
null
?
"
1.0"
:
item
.
profit_loss
.
rolling_outlook
===
""
?
"1
.0"
:
item
.
profit_loss
.
rolling_outlook
,
item
.
profit_loss
.
master_budget
===
null
?
"2.0"
:
item
.
profit_loss
.
master_budget
===
""
?
"2
.0"
:
item
.
profit_loss
.
master_budget
,
item
.
profit_loss
.
rolling_budget
===
null
?
"3.0"
:
item
.
profit_loss
.
rolling_budget
===
""
?
"3
.0"
:
item
.
profit_loss
.
rolling_budget
,
item
.
profit_loss
.
actual
===
null
?
"4.0"
:
item
.
profit_loss
.
actual
===
""
?
"4
.0"
:
item
.
profit_loss
.
actual
,
item
.
profit_loss
.
ytd_actual
===
null
?
"5.0"
:
item
.
profit_loss
.
ytd_actual
===
""
?
"5
.0"
:
item
.
profit_loss
.
ytd_actual
,
item
.
profit_loss
.
actual_previous_month
===
null
?
"6.0"
:
item
.
profit_loss
.
actual_previous_month
===
""
?
"6
.0"
:
item
.
profit_loss
.
actual_previous_month
,
item
.
profit_loss
.
amount_act_vs_previous_month
===
null
?
"7.0"
:
item
.
profit_loss
.
amount_act_vs_previous_month
===
""
?
"7
.0"
:
item
.
profit_loss
.
amount_act_vs_previous_month
,
item
.
profit_loss
.
percent_act_vs_previous_month
===
null
?
"8.0"
:
item
.
profit_loss
.
percent_act_vs_previous_month
===
""
?
"8
.0"
:
item
.
profit_loss
.
percent_act_vs_previous_month
,
item
.
profit_loss
.
amount_act_vs_mb
===
null
?
"9.0"
:
item
.
profit_loss
.
amount_act_vs_mb
===
""
?
"9
.0"
:
item
.
profit_loss
.
amount_act_vs_mb
,
item
.
profit_loss
.
percent_act_vs_mb
===
null
?
"10.0"
:
item
.
profit_loss
.
percent_act_vs_mb
===
""
?
"1
0.0"
:
item
.
profit_loss
.
percent_act_vs_mb
,
item
.
profit_loss
.
amount_act_vs_rb
===
null
?
"11.0"
:
item
.
profit_loss
.
amount_act_vs_rb
===
""
?
"11
.0"
:
item
.
profit_loss
.
amount_act_vs_rb
,
item
.
profit_loss
.
percent_act_vs_rb
===
null
?
"12.0"
:
item
.
profit_loss
.
percent_act_vs_rb
===
""
?
"12
.0"
:
item
.
profit_loss
.
percent_act_vs_rb
,
item
.
profit_loss
.
mtd_vs_previous_month
===
null
?
"13.0"
:
item
.
profit_loss
.
mtd_vs_previous_month
===
""
?
"13
.0"
:
item
.
profit_loss
.
mtd_vs_previous_month
,
item
.
profit_loss
.
mtd_vs_mb
===
null
?
"14.0"
:
item
.
profit_loss
.
mtd_vs_mb
===
""
?
"14
.0"
:
item
.
profit_loss
.
mtd_vs_mb
,
item
.
profit_loss
.
mtd_vs_rb
===
null
?
"15.0"
:
item
.
profit_loss
.
mtd_vs_rb
===
""
?
"15
.0"
:
item
.
profit_loss
.
mtd_vs_rb
,
item
.
profit_loss
.
rolling_outlook
===
null
?
"
0.0"
:
item
.
profit_loss
.
rolling_outlook
===
""
?
"0
.0"
:
item
.
profit_loss
.
rolling_outlook
,
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
,
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
,
item
.
order
,
])
if
(
item
.
children
!==
null
)
{
...
...
@@ -241,6 +241,7 @@ export default class ProfitLossMR extends Component {
// console.log(dataTable2[tableMeta.rowIndex]);
}
const
handleChange
=
(
value
,
tableMeta
,
type
)
=>
{
console
.
log
(
dataTable2
);
let
val
=
String
(
value
).
split
(
","
).
join
(
""
)
if
(
type
===
"actual"
)
{
dataTable2
[
tableMeta
.
rowIndex
][
10
]
=
Number
(
val
).
toFixed
(
1
)
...
...
@@ -259,13 +260,12 @@ export default class ProfitLossMR extends Component {
const
handleValue
=
(
data
,
type
)
=>
{
let
total
=
0
dataTable2
.
map
((
item
,
index
)
=>
{
if
(
data
.
rowData
[
1
]
===
item
[
2
])
{
let
itemVal
=
item
[
data
.
columnIndex
+
type
].
value
!==
undefined
?
Number
(
item
[
data
.
columnIndex
+
type
].
value
)
:
Number
(
item
[
data
.
columnIndex
+
type
])
total
=
item
[
data
.
columnIndex
+
type
]
===
undefined
?
Number
(
total
)
+
0
:
Number
(
total
)
+
itemVal
if
(
data
.
rowData
[
1
]
==
item
[
2
])
{
total
=
item
[
data
.
columnIndex
+
type
]
==
undefined
?
(
Number
(
total
)
+
0
)
:
(
Number
(
total
)
+
Number
(
item
[
data
.
columnIndex
+
type
]))
}
})
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
=
dataTable2
[
data
.
rowIndex
][
2
])
let
a
=
dataTable2
[
data
.
rowIndex
][
data
.
columnIndex
+
type
]
=
Number
(
total
)
.
toFixed
(
1
)
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
dataTable2
[
data
.
rowIndex
][
2
])
let
a
=
dataTable2
[
data
.
rowIndex
][
data
.
columnIndex
+
type
]
=
Number
(
total
)
// console.log(indexParent);
return
a
}
...
...
@@ -318,12 +318,12 @@ export default class ProfitLossMR extends Component {
total
=
Number
(
total
)
-
Number
(
item
)
}
else
if
(
opt
==
"kali"
)
{
if
(
tableMeta
.
rowData
[
22
]
===
3
)
{
console
.
log
(
arrayFormula
);
console
.
log
(
array
);
console
.
log
(
total
);
console
.
log
(
item
);
}
//
if (tableMeta.rowData[22] === 3) {
//
console.log(arrayFormula);
//
console.log(array);
//
console.log(total);
//
console.log(item);
//
}
total
=
Number
(
total
)
*
Number
(
item
)
// if (tableMeta.rowData[22] === 3) {
// console.log(dataTable2[tableMeta.rowIndex]);
...
...
@@ -971,25 +971,6 @@ export default class ProfitLossMR extends Component {
{
tableMeta
.
rowData
[
0
]
===
4
||
tableMeta
.
rowData
[
0
]
===
1
?
null
:
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"
suffix
=
{
'%'
}
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleFormula
(
val
,
tableMeta
,
0
)).
toFixed
(
1
)}
/
>
}
/
>
<
/div>
:
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
...
...
@@ -1014,25 +995,6 @@ export default class ProfitLossMR extends Component {
{
tableMeta
.
rowData
[
0
]
===
4
||
tableMeta
.
rowData
[
0
]
===
1
?
null
:
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
=
""
suffix
=
{
'%'
}
disabled
=
{
true
}
value
=
{
Number
(
handleFormula
(
val
,
tableMeta
,
1
)).
toFixed
(
1
)}
/
>
}
/
>
<
/div>
:
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
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