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
a4c770a0
Commit
a4c770a0
authored
Jan 29, 2021
by
Rifka Kurnia
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rifka' into 'master'
formula dan blank cf See merge request
!1074
parents
9ab9eaed
891972bd
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
98 additions
and
40 deletions
+98
-40
SubHolding.js
src/container/Laporan/SubHolding.js
+69
-11
TableSubHolding.js
src/container/Laporan/TableSubHolding.js
+29
-29
No files found.
src/container/Laporan/SubHolding.js
View file @
a4c770a0
...
@@ -1124,13 +1124,49 @@ export default class SubHolding extends Component {
...
@@ -1124,13 +1124,49 @@ export default class SubHolding extends Component {
const
handlePushChild
=
(
item
)
=>
{
const
handlePushChild
=
(
item
)
=>
{
let
indexIDzz
=
dbSumaCF
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
let
indexIDzz
=
dbSumaCF
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
if
(
indexIDzz
===
-
1
)
{
if
(
indexIDzz
===
-
1
)
{
let
mtd_actual
=
item
.
cash_flow
.
mtd_actual
==
''
?
0
:
item
.
cash_flow
.
mtd_actual
let
mtd_actual
=
item
.
cash_flow
.
mtd_actual
==
''
?
0
:
Number
(
item
.
cash_flow
.
mtd_actual
)
let
mtd
=
item
.
cash_flow
.
mtd
==
''
?
0
:
item
.
cash_flow
.
mtd
let
mtd
=
item
.
cash_flow
.
mtd
==
''
?
0
:
Number
(
item
.
cash_flow
.
mtd
)
let
persenMtd
=
Number
(
mtd_actual
/
mtd
)
// let persenMtd = Number(mtd_actual / mtd)
let
persenMtd
=
0
if
(
mtd
<
0
)
{
if
(
mtd_actual
>=
mtd
)
{
persenMtd
=
((
mtd
-
mtd_actual
)
/
mtd
+
1
)
}
else
{
persenMtd
=
((
mtd
-
mtd_actual
)
/
mtd
)
}
}
else
{
persenMtd
=
Number
(
mtd_actual
/
mtd
)
}
let
ytd_actual
=
item
.
cash_flow
.
ytd_actual
==
''
?
0
:
item
.
cash_flow
.
ytd_actual
let
ytd_actual
=
item
.
cash_flow
.
ytd_actual
==
''
?
0
:
Number
(
item
.
cash_flow
.
ytd_actual
)
let
ytd
=
item
.
cash_flow
.
ytd
==
''
?
0
:
item
.
cash_flow
.
ytd
let
ytd
=
item
.
cash_flow
.
ytd
==
''
?
0
:
Number
(
item
.
cash_flow
.
ytd
)
let
persenYtd
=
Number
(
ytd_actual
/
ytd
)
// let ytd_last_year = item.cash_flow.ytd_last_year == ''? 0 : Number(item.cash_flow.ytd_last_year)
// let persenYtd = Number(ytd_actual / ytd)
let
persenYtd
=
0
if
(
ytd
<
0
)
{
if
(
ytd_actual
>=
ytd
)
{
persenYtd
=
((
ytd
-
ytd_actual
)
/
ytd
+
1
)
}
else
{
persenYtd
=
((
ytd
-
ytd_actual
)
/
ytd
)
}
}
else
{
persenYtd
=
Number
(
ytd_actual
/
ytd
)
}
// let persenYtdLY = 0
// if (ytd_last_year < 0) {
// if (ytd_actual >= ytd_last_year) {
// persenYtdLY = ((ytd_last_year - ytd_actual) / ytd_last_year + 1 )
// } else {
// persenYtdLY = (ytd_last_year - ytd_actual) / ytd_last_year
// }
// }
// else {
// persenYtdLY = Number(ytd_actual/ytd_last_year)
// }
let
quarter_actual
=
item
.
cash_flow
.
quarter_actual
==
''
?
0
:
item
.
cash_flow
.
quarter_actual
let
quarter_actual
=
item
.
cash_flow
.
quarter_actual
==
''
?
0
:
item
.
cash_flow
.
quarter_actual
let
quarter
=
item
.
cash_flow
.
quarter
==
''
?
0
:
item
.
cash_flow
.
quarter
let
quarter
=
item
.
cash_flow
.
quarter
==
''
?
0
:
item
.
cash_flow
.
quarter
...
@@ -1174,11 +1210,33 @@ export default class SubHolding extends Component {
...
@@ -1174,11 +1210,33 @@ export default class SubHolding extends Component {
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
let
mtd_actual
=
item
.
cash_flow
.
mtd_actual
==
''
?
0
:
item
.
cash_flow
.
mtd_actual
let
mtd_actual
=
item
.
cash_flow
.
mtd_actual
==
''
?
0
:
item
.
cash_flow
.
mtd_actual
let
mtd
=
item
.
cash_flow
.
mtd
==
''
?
0
:
item
.
cash_flow
.
mtd
let
mtd
=
item
.
cash_flow
.
mtd
==
''
?
0
:
item
.
cash_flow
.
mtd
let
persenMtd
=
Number
(
mtd_actual
/
mtd
)
// let persenMtd = Number(mtd_actual / mtd)
console
.
log
(
persenMtd
)
let
persenMtd
=
0
let
ytd_actual
=
item
.
cash_flow
.
ytd_actual
==
''
?
0
:
item
.
cash_flow
.
ytd_actual
if
(
mtd
<
0
)
{
let
ytd
=
item
.
cash_flow
.
ytd
==
''
?
0
:
item
.
cash_flow
.
ytd
if
(
mtd_actual
>=
mtd
)
{
let
persenYtd
=
Number
(
ytd_actual
/
ytd
)
persenMtd
=
((
mtd
-
mtd_actual
)
/
mtd
+
1
)
}
else
{
persenMtd
=
((
mtd
-
mtd_actual
)
/
mtd
)
}
}
else
{
persenMtd
=
Number
(
mtd_actual
/
mtd
)
}
let
ytd_actual
=
item
.
cash_flow
.
ytd_actual
==
''
?
0
:
Number
(
item
.
cash_flow
.
ytd_actual
)
let
ytd
=
item
.
cash_flow
.
ytd
==
''
?
0
:
Number
(
item
.
cash_flow
.
ytd
)
// let persenYtd = Number(ytd_actual / ytd)
let
persenYtd
=
0
if
(
ytd
<
0
)
{
if
(
ytd_actual
>=
ytd
)
{
persenYtd
=
((
ytd
-
ytd_actual
)
/
ytd
+
1
)
}
else
{
persenYtd
=
((
ytd
-
ytd_actual
)
/
ytd
)
}
}
else
{
persenYtd
=
Number
(
ytd_actual
/
ytd
)
}
let
quarter_actual
=
item
.
cash_flow
.
quarter_actual
==
''
?
0
:
item
.
cash_flow
.
quarter_actual
let
quarter_actual
=
item
.
cash_flow
.
quarter_actual
==
''
?
0
:
item
.
cash_flow
.
quarter_actual
let
quarter
=
item
.
cash_flow
.
quarter
==
''
?
0
:
item
.
cash_flow
.
quarter
let
quarter
=
item
.
cash_flow
.
quarter
==
''
?
0
:
item
.
cash_flow
.
quarter
...
...
src/container/Laporan/TableSubHolding.js
View file @
a4c770a0
This diff is collapsed.
Click to expand it.
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