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
e064b3bb
Commit
e064b3bb
authored
Nov 05, 2020
by
faisalhamdi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update report FR
parent
6e8de3dc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
85 deletions
+87
-85
index.js
src/api/index.js
+3
-1
SubHolding.js
src/container/Laporan/SubHolding.js
+84
-84
No files found.
src/api/index.js
View file @
e064b3bb
...
...
@@ -224,6 +224,7 @@ const create = (type = "") => {
const
getLastestUpdateOI
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/get_latest_update'
,
body
)
const
getLastPeriodeOI
=
(
idCompany
)
=>
api
.
post
(
`transaction/master_budget/get_last_periode/
${
idCompany
}
`
)
const
getReportHierarkiPL
=
(
body
)
=>
api
.
post
(
'transaction/db_report_detail/get_report_hierarki'
,
body
)
const
getReportHierarkiFR
=
(
body
)
=>
api
.
post
(
'transaction/db_ratio/get_report_hierarki'
,
body
)
//CASH FLOW
const
getDetailReportCF
=
(
body
)
=>
api
.
post
(
'/transaction/cash_flow/get_report_hierarki'
,
body
)
...
...
@@ -431,7 +432,8 @@ const create = (type = "") => {
getLastPeriodOI
,
getDashboardUser
,
getDetailReportCF
,
getReportHierarkiPL
getReportHierarkiPL
,
getReportHierarkiFR
}
}
...
...
src/container/Laporan/SubHolding.js
View file @
e064b3bb
...
...
@@ -451,91 +451,91 @@ export default class SubHolding extends Component {
}
})
}
else
if
(
this
.
state
.
report
.
value
===
4
)
{
api
.
create
().
get
DetailReportMB
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
api
.
create
().
get
ReportHierarkiFR
(
payload
).
then
(
response
=>
{
//
console.log(payload);
console
.
log
(
response
);
//
let dataTable = []
//
if (response.data) {
//
let res = response.data.data
//
const handlePushChild = (item) => {
//
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
//
if (indexIDzz === -1) {
//
dataTable.push([
//
item.type_report_id,
//
item.id,
//
item.parent,
//
item.formula,
//
item.level,
//
item.description,
// item.balance_sheet.total_actual_before === null ? "0.0" : item.balance_sheet.total_actual_before === "" ? "0.0" : item.balance_sheet
.total_actual_before,
// Number(item.balance_sheet
.january).toFixed(1),
// Number(item.balance_sheet
.february).toFixed(1),
// Number(item.balance_sheet
.march).toFixed(1),
// Number(item.balance_sheet
.april).toFixed(1),
// Number(item.balance_sheet
.may).toFixed(1),
// Number(item.balance_sheet
.june).toFixed(1),
// Number(item.balance_sheet
.july).toFixed(1),
// Number(item.balance_sheet
.august).toFixed(1),
// Number(item.balance_sheet
.september).toFixed(1),
// Number(item.balance_sheet
.october).toFixed(1),
// Number(item.balance_sheet
.november).toFixed(1),
// Number(item.balance_sheet
.december).toFixed(1),
// Number(item.balance_sheet
.total_current_year).toFixed(1),
// Number(item.balance_sheet
.total_next_year).toFixed(1),
// Number(item.balance_sheet
.total_more_year).toFixed(1),
//
item.order,
//
item.condition_it_should_be,
//
item.condition_if_wrong
//
])
//
}
//
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.balance_sheet.total_actual_before === null ? "0.0" : item.balance_sheet.total_actual_before === "" ? "0.0" : item.balance_sheet
.total_actual_before,
// Number(item.balance_sheet
.january).toFixed(1),
// Number(item.balance_sheet
.february).toFixed(1),
// Number(item.balance_sheet
.march).toFixed(1),
// Number(item.balance_sheet
.april).toFixed(1),
// Number(item.balance_sheet
.may).toFixed(1),
// Number(item.balance_sheet
.june).toFixed(1),
// Number(item.balance_sheet
.july).toFixed(1),
// Number(item.balance_sheet
.august).toFixed(1),
// Number(item.balance_sheet
.september).toFixed(1),
// Number(item.balance_sheet
.october).toFixed(1),
// Number(item.balance_sheet
.november).toFixed(1),
// Number(item.balance_sheet
.december).toFixed(1),
// Number(item.balance_sheet
.total_current_year).toFixed(1),
// Number(item.balance_sheet
.total_next_year).toFixed(1),
// Number(item.balance_sheet
.total_more_year).toFixed(1),
//
item.order,
//
item.condition_it_should_be,
//
item.condition_if_wrong
//
])
//
if (item.children !== null) {
//
if (item.children.length > 0) {
//
item.children.map((items, indexs) => {
//
handlePushChild(items)
//
})
//
}
//
}
//
})
//
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
//
} else {
//
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
//
}
let
dataTable
=
[]
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
const
handlePushChild
=
(
item
)
=>
{
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
if
(
indexIDzz
===
-
1
)
{
dataTable
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
formula
,
item
.
level
,
item
.
description
,
item
.
ratio
.
total_actual_before
===
null
?
"0.0"
:
item
.
ratio
.
total_actual_before
===
""
?
"0.0"
:
item
.
ratio
.
total_actual_before
,
Number
(
item
.
ratio
.
january
).
toFixed
(
1
),
Number
(
item
.
ratio
.
february
).
toFixed
(
1
),
Number
(
item
.
ratio
.
march
).
toFixed
(
1
),
Number
(
item
.
ratio
.
april
).
toFixed
(
1
),
Number
(
item
.
ratio
.
may
).
toFixed
(
1
),
Number
(
item
.
ratio
.
june
).
toFixed
(
1
),
Number
(
item
.
ratio
.
july
).
toFixed
(
1
),
Number
(
item
.
ratio
.
august
).
toFixed
(
1
),
Number
(
item
.
ratio
.
september
).
toFixed
(
1
),
Number
(
item
.
ratio
.
october
).
toFixed
(
1
),
Number
(
item
.
ratio
.
november
).
toFixed
(
1
),
Number
(
item
.
ratio
.
december
).
toFixed
(
1
),
Number
(
item
.
ratio
.
total_current_year
).
toFixed
(
1
),
Number
(
item
.
ratio
.
total_next_year
).
toFixed
(
1
),
Number
(
item
.
ratio
.
total_more_year
).
toFixed
(
1
),
item
.
order
,
item
.
condition_it_should_be
,
item
.
condition_if_wrong
])
}
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
.
ratio
.
total_actual_before
===
null
?
"0.0"
:
item
.
ratio
.
total_actual_before
===
""
?
"0.0"
:
item
.
ratio
.
total_actual_before
,
Number
(
item
.
ratio
.
january
).
toFixed
(
1
),
Number
(
item
.
ratio
.
february
).
toFixed
(
1
),
Number
(
item
.
ratio
.
march
).
toFixed
(
1
),
Number
(
item
.
ratio
.
april
).
toFixed
(
1
),
Number
(
item
.
ratio
.
may
).
toFixed
(
1
),
Number
(
item
.
ratio
.
june
).
toFixed
(
1
),
Number
(
item
.
ratio
.
july
).
toFixed
(
1
),
Number
(
item
.
ratio
.
august
).
toFixed
(
1
),
Number
(
item
.
ratio
.
september
).
toFixed
(
1
),
Number
(
item
.
ratio
.
october
).
toFixed
(
1
),
Number
(
item
.
ratio
.
november
).
toFixed
(
1
),
Number
(
item
.
ratio
.
december
).
toFixed
(
1
),
Number
(
item
.
ratio
.
total_current_year
).
toFixed
(
1
),
Number
(
item
.
ratio
.
total_next_year
).
toFixed
(
1
),
Number
(
item
.
ratio
.
total_more_year
).
toFixed
(
1
),
item
.
order
,
item
.
condition_it_should_be
,
item
.
condition_if_wrong
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
})
this
.
setState
({
dataTable
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
}
})
}
}
...
...
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