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
50dbff9a
Commit
50dbff9a
authored
Feb 23, 2021
by
faisalhamdi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#issue login
parent
dc06a583
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
350 additions
and
317 deletions
+350
-317
SubHolding.js
src/container/Laporan/SubHolding.js
+350
-317
No files found.
src/container/Laporan/SubHolding.js
View file @
50dbff9a
...
@@ -424,10 +424,71 @@ export default class SubHolding extends Component {
...
@@ -424,10 +424,71 @@ export default class SubHolding extends Component {
console
.
log
(
response
);
console
.
log
(
response
);
let
dataTable
=
[]
let
dataTable
=
[]
if
(
response
.
data
)
{
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
if
(
response
.
data
.
status
===
'success'
)
{
const
handlePushChild
=
(
item
)
=>
{
let
res
=
response
.
data
.
data
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
const
handlePushChild
=
(
item
)
=>
{
if
(
indexIDzz
===
-
1
)
{
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
.
profit_loss
.
total_actual_before
===
null
?
"0"
:
item
.
profit_loss
.
total_actual_before
===
""
?
"0"
:
item
.
profit_loss
.
total_actual_before
,
item
.
profit_loss
.
january
,
item
.
profit_loss
.
february
,
item
.
profit_loss
.
march
,
item
.
profit_loss
.
april
,
item
.
profit_loss
.
may
,
item
.
profit_loss
.
june
,
item
.
profit_loss
.
july
,
item
.
profit_loss
.
august
,
item
.
profit_loss
.
september
,
item
.
profit_loss
.
october
,
item
.
profit_loss
.
november
,
item
.
profit_loss
.
december
,
item
.
profit_loss
.
total_current_year
,
item
.
profit_loss
.
total_next_year
,
item
.
profit_loss
.
total_more_year
,
item
.
order
,
item
.
profit_loss
.
monthly_january
,
item
.
profit_loss
.
monthly_february
,
item
.
profit_loss
.
monthly_march
,
item
.
profit_loss
.
monthly_april
,
item
.
profit_loss
.
monthly_may
,
item
.
profit_loss
.
monthly_june
,
item
.
profit_loss
.
monthly_july
,
item
.
profit_loss
.
monthly_august
,
item
.
profit_loss
.
monthly_september
,
item
.
profit_loss
.
monthly_october
,
item
.
profit_loss
.
monthly_november
,
item
.
profit_loss
.
monthly_december
,
item
.
profit_loss
.
monthly_last_year_january
,
item
.
profit_loss
.
monthly_last_year_february
,
item
.
profit_loss
.
monthly_last_year_march
,
item
.
profit_loss
.
monthly_last_year_april
,
item
.
profit_loss
.
monthly_last_year_may
,
item
.
profit_loss
.
monthly_last_year_june
,
item
.
profit_loss
.
monthly_last_year_july
,
item
.
profit_loss
.
monthly_last_year_august
,
item
.
profit_loss
.
monthly_last_year_september
,
item
.
profit_loss
.
monthly_last_year_october
,
item
.
profit_loss
.
monthly_last_year_november
,
item
.
profit_loss
.
monthly_last_year_december
,
item
.
profit_loss
.
notes
])
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
}
res
.
map
((
item
,
index
)
=>
{
dataTable
.
push
([
dataTable
.
push
([
item
.
type_report_id
,
item
.
type_report_id
,
item
.
id
,
item
.
id
,
...
@@ -478,82 +539,32 @@ export default class SubHolding extends Component {
...
@@ -478,82 +539,32 @@ export default class SubHolding extends Component {
item
.
profit_loss
.
monthly_last_year_december
,
item
.
profit_loss
.
monthly_last_year_december
,
item
.
profit_loss
.
notes
item
.
profit_loss
.
notes
])
])
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
handlePushChild
(
items
)
})
})
}
}
}
}
res
.
map
((
item
,
index
)
=>
{
dataTable
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
formula
,
item
.
level
,
item
.
description
,
item
.
profit_loss
.
total_actual_before
===
null
?
"0"
:
item
.
profit_loss
.
total_actual_before
===
""
?
"0"
:
item
.
profit_loss
.
total_actual_before
,
item
.
profit_loss
.
january
,
item
.
profit_loss
.
february
,
item
.
profit_loss
.
march
,
item
.
profit_loss
.
april
,
item
.
profit_loss
.
may
,
item
.
profit_loss
.
june
,
item
.
profit_loss
.
july
,
item
.
profit_loss
.
august
,
item
.
profit_loss
.
september
,
item
.
profit_loss
.
october
,
item
.
profit_loss
.
november
,
item
.
profit_loss
.
december
,
item
.
profit_loss
.
total_current_year
,
item
.
profit_loss
.
total_next_year
,
item
.
profit_loss
.
total_more_year
,
item
.
order
,
item
.
profit_loss
.
monthly_january
,
item
.
profit_loss
.
monthly_february
,
item
.
profit_loss
.
monthly_march
,
item
.
profit_loss
.
monthly_april
,
item
.
profit_loss
.
monthly_may
,
item
.
profit_loss
.
monthly_june
,
item
.
profit_loss
.
monthly_july
,
item
.
profit_loss
.
monthly_august
,
item
.
profit_loss
.
monthly_september
,
item
.
profit_loss
.
monthly_october
,
item
.
profit_loss
.
monthly_november
,
item
.
profit_loss
.
monthly_december
,
item
.
profit_loss
.
monthly_last_year_january
,
item
.
profit_loss
.
monthly_last_year_february
,
item
.
profit_loss
.
monthly_last_year_march
,
item
.
profit_loss
.
monthly_last_year_april
,
item
.
profit_loss
.
monthly_last_year_may
,
item
.
profit_loss
.
monthly_last_year_june
,
item
.
profit_loss
.
monthly_last_year_july
,
item
.
profit_loss
.
monthly_last_year_august
,
item
.
profit_loss
.
monthly_last_year_september
,
item
.
profit_loss
.
monthly_last_year_october
,
item
.
profit_loss
.
monthly_last_year_november
,
item
.
profit_loss
.
monthly_last_year_december
,
item
.
profit_loss
.
notes
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
}
})
})
// console.log(dataTable)
// console.log(dataTable)
// this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
// this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
this
.
setState
({
dataTable
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
this
.
setState
({
dataTable
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
// this.setState({ dataTable }, () => {
// this.setState({ dataTable }, () => {
// console.log(this.state.dataTable)
// console.log(this.state.dataTable)
// this.getPLDetailMR(payload)
// this.getPLDetailMR(payload)
// })
// })
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
}
}
...
@@ -564,10 +575,72 @@ export default class SubHolding extends Component {
...
@@ -564,10 +575,72 @@ export default class SubHolding extends Component {
console
.
log
(
response
);
console
.
log
(
response
);
let
dataTable
=
[]
let
dataTable
=
[]
if
(
response
.
data
)
{
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
if
(
response
.
data
.
status
===
'success'
)
{
const
handlePushChild
=
(
item
)
=>
{
let
res
=
response
.
data
.
data
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
const
handlePushChild
=
(
item
)
=>
{
if
(
indexIDzz
===
-
1
)
{
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
,
item
.
balance_sheet
.
monthly_january
,
item
.
balance_sheet
.
monthly_february
,
item
.
balance_sheet
.
monthly_march
,
item
.
balance_sheet
.
monthly_april
,
item
.
balance_sheet
.
monthly_may
,
item
.
balance_sheet
.
monthly_june
,
item
.
balance_sheet
.
monthly_july
,
item
.
balance_sheet
.
monthly_august
,
item
.
balance_sheet
.
monthly_september
,
item
.
balance_sheet
.
monthly_october
,
item
.
balance_sheet
.
monthly_november
,
item
.
balance_sheet
.
monthly_december
,
item
.
balance_sheet
.
monthly_last_year_january
,
item
.
balance_sheet
.
monthly_last_year_february
,
item
.
balance_sheet
.
monthly_last_year_march
,
item
.
balance_sheet
.
monthly_last_year_april
,
item
.
balance_sheet
.
monthly_last_year_may
,
item
.
balance_sheet
.
monthly_last_year_june
,
item
.
balance_sheet
.
monthly_last_year_july
,
item
.
balance_sheet
.
monthly_last_year_august
,
item
.
balance_sheet
.
monthly_last_year_september
,
item
.
balance_sheet
.
monthly_last_year_october
,
item
.
balance_sheet
.
monthly_last_year_november
,
item
.
balance_sheet
.
monthly_last_year_december
])
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
}
res
.
map
((
item
,
index
)
=>
{
dataTable
.
push
([
dataTable
.
push
([
item
.
type_report_id
,
item
.
type_report_id
,
item
.
id
,
item
.
id
,
...
@@ -619,80 +692,29 @@ export default class SubHolding extends Component {
...
@@ -619,80 +692,29 @@ export default class SubHolding extends Component {
item
.
balance_sheet
.
monthly_last_year_november
,
item
.
balance_sheet
.
monthly_last_year_november
,
item
.
balance_sheet
.
monthly_last_year_december
item
.
balance_sheet
.
monthly_last_year_december
])
])
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
handlePushChild
(
items
)
}
)
}
)
}
}
}
}
})
}
this
.
setState
({
dataTable
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
res
.
map
((
item
,
index
)
=>
{
// this.setState({ dataTable }, () => {
dataTable
.
push
([
// console.log(this.state.dataTable)
item
.
type_report_id
,
// this.getBalanceSheetMR(payload)
item
.
id
,
// })
item
.
parent
,
}
else
{
item
.
formula
,
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
item
.
level
,
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
item
.
description
,
setTimeout
(()
=>
{
item
.
balance_sheet
.
total_actual_before
===
null
?
"0.0"
:
item
.
balance_sheet
.
total_actual_before
===
""
?
"0.0"
:
item
.
balance_sheet
.
total_actual_before
,
localStorage
.
removeItem
(
Constant
.
TOKEN
)
Number
(
item
.
balance_sheet
.
january
).
toFixed
(
1
),
window
.
location
.
reload
();
Number
(
item
.
balance_sheet
.
february
).
toFixed
(
1
),
},
1000
);
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
,
item
.
balance_sheet
.
monthly_january
,
item
.
balance_sheet
.
monthly_february
,
item
.
balance_sheet
.
monthly_march
,
item
.
balance_sheet
.
monthly_april
,
item
.
balance_sheet
.
monthly_may
,
item
.
balance_sheet
.
monthly_june
,
item
.
balance_sheet
.
monthly_july
,
item
.
balance_sheet
.
monthly_august
,
item
.
balance_sheet
.
monthly_september
,
item
.
balance_sheet
.
monthly_october
,
item
.
balance_sheet
.
monthly_november
,
item
.
balance_sheet
.
monthly_december
,
item
.
balance_sheet
.
monthly_last_year_january
,
item
.
balance_sheet
.
monthly_last_year_february
,
item
.
balance_sheet
.
monthly_last_year_march
,
item
.
balance_sheet
.
monthly_last_year_april
,
item
.
balance_sheet
.
monthly_last_year_may
,
item
.
balance_sheet
.
monthly_last_year_june
,
item
.
balance_sheet
.
monthly_last_year_july
,
item
.
balance_sheet
.
monthly_last_year_august
,
item
.
balance_sheet
.
monthly_last_year_september
,
item
.
balance_sheet
.
monthly_last_year_october
,
item
.
balance_sheet
.
monthly_last_year_november
,
item
.
balance_sheet
.
monthly_last_year_december
])
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
})
// this.setState({ dataTable }, () => {
// console.log(this.state.dataTable)
// this.getBalanceSheetMR(payload)
// })
}
else
{
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
}
}
...
@@ -718,173 +740,184 @@ export default class SubHolding extends Component {
...
@@ -718,173 +740,184 @@ export default class SubHolding extends Component {
api
.
create
().
getReportPL
(
payloads
).
then
(
response
=>
{
api
.
create
().
getReportPL
(
payloads
).
then
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
let
dataTable
=
[]
if
(
response
.
data
.
status
===
'success'
)
{
console
.
log
(
response
)
let
dataTable
=
[]
let
res
=
response
.
data
.
data
console
.
log
(
response
)
const
handlePushChild
=
(
item
)
=>
{
let
res
=
response
.
data
.
data
dataTable
.
push
([
const
handlePushChild
=
(
item
)
=>
{
item
.
type_report_id
,
dataTable
.
push
([
item
.
id
,
item
.
type_report_id
,
item
.
parent
,
item
.
id
,
item
.
formula
,
item
.
parent
,
item
.
level
,
item
.
formula
,
item
.
description
,
item
.
level
,
item
.
profit_loss
.
total_actual_before
===
null
?
"0"
:
item
.
profit_loss
.
total_actual_before
===
""
?
"0"
:
item
.
profit_loss
.
total_actual_before
,
item
.
description
,
item
.
profit_loss
.
january
,
item
.
profit_loss
.
total_actual_before
===
null
?
"0"
:
item
.
profit_loss
.
total_actual_before
===
""
?
"0"
:
item
.
profit_loss
.
total_actual_before
,
item
.
profit_loss
.
february
,
item
.
profit_loss
.
january
,
item
.
profit_loss
.
march
,
item
.
profit_loss
.
february
,
item
.
profit_loss
.
april
,
item
.
profit_loss
.
march
,
item
.
profit_loss
.
may
,
item
.
profit_loss
.
april
,
item
.
profit_loss
.
june
,
item
.
profit_loss
.
may
,
item
.
profit_loss
.
july
,
item
.
profit_loss
.
june
,
item
.
profit_loss
.
august
,
item
.
profit_loss
.
july
,
item
.
profit_loss
.
september
,
item
.
profit_loss
.
august
,
item
.
profit_loss
.
october
,
item
.
profit_loss
.
september
,
item
.
profit_loss
.
november
,
item
.
profit_loss
.
october
,
item
.
profit_loss
.
december
,
item
.
profit_loss
.
november
,
item
.
profit_loss
.
total_current_year
,
item
.
profit_loss
.
december
,
item
.
profit_loss
.
total_next_year
,
item
.
profit_loss
.
total_current_year
,
item
.
profit_loss
.
total_more_year
,
item
.
profit_loss
.
total_next_year
,
// item.profit_detail.total_actual_before === null ? "0" : item.profit_detail.total_actual_before === "" ? "0" : item.profit_detail.total_actual_before,
item
.
profit_loss
.
total_more_year
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.january, formula: item.profit_detail.january_formula } : item.profit_detail.january,
// item.profit_detail.total_actual_before === null ? "0" : item.profit_detail.total_actual_before === "" ? "0" : item.profit_detail.total_actual_before,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.february, formula: item.profit_detail.february_formula } : item.profit_detail.february,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.january, formula: item.profit_detail.january_formula } : item.profit_detail.january,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.march, formula: item.profit_detail.march_formula } : item.profit_detail.march,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.february, formula: item.profit_detail.february_formula } : item.profit_detail.february,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.april, formula: item.profit_detail.april_formula } : item.profit_detail.april,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.march, formula: item.profit_detail.march_formula } : item.profit_detail.march,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.may, formula: item.profit_detail.may_formula } : item.profit_detail.may,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.april, formula: item.profit_detail.april_formula } : item.profit_detail.april,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.june, formula: item.profit_detail.june_formula } : item.profit_detail.june,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.may, formula: item.profit_detail.may_formula } : item.profit_detail.may,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.july, formula: item.profit_detail.july_formula } : item.profit_detail.july,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.june, formula: item.profit_detail.june_formula } : item.profit_detail.june,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.august, formula: item.profit_detail.august_formula } : item.profit_detail.august,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.july, formula: item.profit_detail.july_formula } : item.profit_detail.july,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.september, formula: item.profit_detail.september_formula } : item.profit_detail.september,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.august, formula: item.profit_detail.august_formula } : item.profit_detail.august,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.october, formula: item.profit_detail.october_formula } : item.profit_detail.october,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.september, formula: item.profit_detail.september_formula } : item.profit_detail.september,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.november, formula: item.profit_detail.november_formula } : item.profit_detail.november,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.october, formula: item.profit_detail.october_formula } : item.profit_detail.october,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.december, formula: item.profit_detail.december_formula } : item.profit_detail.december,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.november, formula: item.profit_detail.november_formula } : item.profit_detail.november,
// item.profit_detail.total_current_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.december, formula: item.profit_detail.december_formula } : item.profit_detail.december,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_next_year,
// item.profit_detail.total_current_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_more_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_next_year,
item
.
order
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_more_year,
item
.
condition_it_should_be
,
item
.
order
,
item
.
condition_if_wrong
,
item
.
condition_it_should_be
,
[],
item
.
condition_if_wrong
,
""
,
[],
item
.
profit_loss
.
monthly_january
,
""
,
item
.
profit_loss
.
monthly_february
,
item
.
profit_loss
.
monthly_january
,
item
.
profit_loss
.
monthly_march
,
item
.
profit_loss
.
monthly_february
,
item
.
profit_loss
.
monthly_april
,
item
.
profit_loss
.
monthly_march
,
item
.
profit_loss
.
monthly_may
,
item
.
profit_loss
.
monthly_april
,
item
.
profit_loss
.
monthly_june
,
item
.
profit_loss
.
monthly_may
,
item
.
profit_loss
.
monthly_july
,
item
.
profit_loss
.
monthly_june
,
item
.
profit_loss
.
monthly_august
,
item
.
profit_loss
.
monthly_july
,
item
.
profit_loss
.
monthly_september
,
item
.
profit_loss
.
monthly_august
,
item
.
profit_loss
.
monthly_october
,
item
.
profit_loss
.
monthly_september
,
item
.
profit_loss
.
monthly_november
,
item
.
profit_loss
.
monthly_october
,
item
.
profit_loss
.
monthly_december
,
item
.
profit_loss
.
monthly_november
,
item
.
profit_loss
.
monthly_last_year_january
,
item
.
profit_loss
.
monthly_december
,
item
.
profit_loss
.
monthly_last_year_february
,
item
.
profit_loss
.
monthly_last_year_january
,
item
.
profit_loss
.
monthly_last_year_march
,
item
.
profit_loss
.
monthly_last_year_february
,
item
.
profit_loss
.
monthly_last_year_april
,
item
.
profit_loss
.
monthly_last_year_march
,
item
.
profit_loss
.
monthly_last_year_may
,
item
.
profit_loss
.
monthly_last_year_april
,
item
.
profit_loss
.
monthly_last_year_june
,
item
.
profit_loss
.
monthly_last_year_may
,
item
.
profit_loss
.
monthly_last_year_july
,
item
.
profit_loss
.
monthly_last_year_june
,
item
.
profit_loss
.
monthly_last_year_august
,
item
.
profit_loss
.
monthly_last_year_july
,
item
.
profit_loss
.
monthly_last_year_september
,
item
.
profit_loss
.
monthly_last_year_august
,
item
.
profit_loss
.
monthly_last_year_october
,
item
.
profit_loss
.
monthly_last_year_september
,
item
.
profit_loss
.
monthly_last_year_november
,
item
.
profit_loss
.
monthly_last_year_october
,
item
.
profit_loss
.
monthly_last_year_december
,
item
.
profit_loss
.
monthly_last_year_november
,
item
.
profit_loss
.
notes
item
.
profit_loss
.
monthly_last_year_december
,
])
item
.
profit_loss
.
notes
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
handlePushChild
(
items
)
})
})
}
}
}
}
}
}
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
dataTable
.
push
([
dataTable
.
push
([
item
.
type_report_id
,
item
.
type_report_
id
,
item
.
id
,
item
.
id
,
item
.
parent
,
item
.
parent
,
item
.
formula
,
item
.
formula
,
item
.
level
,
item
.
level
,
item
.
description
,
item
.
description
,
item
.
profit_loss
.
total_actual_before
===
null
?
"0"
:
item
.
profit_loss
.
total_actual_before
===
""
?
"0"
:
item
.
profit_loss
.
total_actual_before
,
item
.
profit_loss
.
total_actual_before
===
null
?
"0"
:
item
.
profit_loss
.
total_actual_before
===
""
?
"0"
:
item
.
profit_loss
.
total_actual_before
,
item
.
profit_loss
.
january
,
item
.
profit_loss
.
jan
uary
,
item
.
profit_loss
.
febr
uary
,
item
.
profit_loss
.
february
,
item
.
profit_loss
.
march
,
item
.
profit_loss
.
march
,
item
.
profit_loss
.
april
,
item
.
profit_loss
.
april
,
item
.
profit_loss
.
may
,
item
.
profit_loss
.
may
,
item
.
profit_loss
.
june
,
item
.
profit_loss
.
june
,
item
.
profit_loss
.
july
,
item
.
profit_loss
.
july
,
item
.
profit_loss
.
august
,
item
.
profit_loss
.
august
,
item
.
profit_loss
.
september
,
item
.
profit_loss
.
septem
ber
,
item
.
profit_loss
.
octo
ber
,
item
.
profit_loss
.
octo
ber
,
item
.
profit_loss
.
novem
ber
,
item
.
profit_loss
.
nov
ember
,
item
.
profit_loss
.
dec
ember
,
item
.
profit_loss
.
decembe
r
,
item
.
profit_loss
.
total_current_yea
r
,
item
.
profit_loss
.
total_curren
t_year
,
item
.
profit_loss
.
total_nex
t_year
,
item
.
profit_loss
.
total_next
_year
,
item
.
profit_loss
.
total_more
_year
,
item
.
profit_loss
.
total_more_year
,
// item.profit_detail.total_actual_before === null ? "0" : item.profit_detail.total_actual_before === "" ? "0" : item.profit_detail.total_actual_before
,
// item.profit_detail.total_actual_before === null ? "0" : item.profit_detail.total_actual_before === "" ? "0" : item.profit_detail.total_actual_before
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.january, formula: item.profit_detail.january_formula } : item.profit_detail.january
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.january, formula: item.profit_detail.january_formula } : item.profit_detail.jan
uary,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.february, formula: item.profit_detail.february_formula } : item.profit_detail.febr
uary,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.february, formula: item.profit_detail.february_formula } : item.profit_detail.february
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.march, formula: item.profit_detail.march_formula } : item.profit_detail.march
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.march, formula: item.profit_detail.march_formula } : item.profit_detail.march
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.april, formula: item.profit_detail.april_formula } : item.profit_detail.april
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.april, formula: item.profit_detail.april_formula } : item.profit_detail.april
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.may, formula: item.profit_detail.may_formula } : item.profit_detail.may
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.may, formula: item.profit_detail.may_formula } : item.profit_detail.may
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.june, formula: item.profit_detail.june_formula } : item.profit_detail.june
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.june, formula: item.profit_detail.june_formula } : item.profit_detail.june
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.july, formula: item.profit_detail.july_formula } : item.profit_detail.july
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.july, formula: item.profit_detail.july_formula } : item.profit_detail.july
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.august, formula: item.profit_detail.august_formula } : item.profit_detail.august
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.august, formula: item.profit_detail.august_formula } : item.profit_detail.august
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.september, formula: item.profit_detail.september_formula } : item.profit_detail.september
,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.september, formula: item.profit_detail.september_formula } : item.profit_detail.septem
ber,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.october, formula: item.profit_detail.october_formula } : item.profit_detail.octo
ber,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.october, formula: item.profit_detail.october_formula } : item.profit_detail.octo
ber,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.november, formula: item.profit_detail.november_formula } : item.profit_detail.novem
ber,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.november, formula: item.profit_detail.november_formula } : item.profit_detail.nov
ember,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.december, formula: item.profit_detail.december_formula } : item.profit_detail.dec
ember,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? { value: item.profit_detail.december, formula: item.profit_detail.december_formula } : item.profit_detail.decembe
r,
// item.profit_detail.total_current_yea
r,
// item.profit_detail.total_curren
t_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_nex
t_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_next
_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_more
_year,
// item.type_report_id == 5 || item.type_report_id == 6 || item.type_report_id == 7 ? 0 : item.profit_detail.total_more_yea
r,
item
.
orde
r
,
item
.
order
,
item
.
condition_it_should_be
,
item
.
condition_it_should_be
,
item
.
condition_if_wrong
,
item
.
condition_if_wrong
,
[]
,
[]
,
""
,
""
,
item
.
profit_loss
.
monthly_january
,
item
.
profit_loss
.
monthly_jan
uary
,
item
.
profit_loss
.
monthly_febr
uary
,
item
.
profit_loss
.
monthly_february
,
item
.
profit_loss
.
monthly_march
,
item
.
profit_loss
.
monthly_march
,
item
.
profit_loss
.
monthly_april
,
item
.
profit_loss
.
monthly_april
,
item
.
profit_loss
.
monthly_may
,
item
.
profit_loss
.
monthly_may
,
item
.
profit_loss
.
monthly_june
,
item
.
profit_loss
.
monthly_june
,
item
.
profit_loss
.
monthly_july
,
item
.
profit_loss
.
monthly_july
,
item
.
profit_loss
.
monthly_august
,
item
.
profit_loss
.
monthly_august
,
item
.
profit_loss
.
monthly_september
,
item
.
profit_loss
.
monthly_septem
ber
,
item
.
profit_loss
.
monthly_octo
ber
,
item
.
profit_loss
.
monthly_octo
ber
,
item
.
profit_loss
.
monthly_novem
ber
,
item
.
profit_loss
.
monthly_nov
ember
,
item
.
profit_loss
.
monthly_dec
ember
,
item
.
profit_loss
.
monthly_december
,
item
.
profit_loss
.
monthly_last_year_january
,
item
.
profit_loss
.
monthly_last_year_jan
uary
,
item
.
profit_loss
.
monthly_last_year_febr
uary
,
item
.
profit_loss
.
monthly_last_year_february
,
item
.
profit_loss
.
monthly_last_year_march
,
item
.
profit_loss
.
monthly_last_year_march
,
item
.
profit_loss
.
monthly_last_year_april
,
item
.
profit_loss
.
monthly_last_year_april
,
item
.
profit_loss
.
monthly_last_year_may
,
item
.
profit_loss
.
monthly_last_year_may
,
item
.
profit_loss
.
monthly_last_year_june
,
item
.
profit_loss
.
monthly_last_year_june
,
item
.
profit_loss
.
monthly_last_year_july
,
item
.
profit_loss
.
monthly_last_year_july
,
item
.
profit_loss
.
monthly_last_year_august
,
item
.
profit_loss
.
monthly_last_year_august
,
item
.
profit_loss
.
monthly_last_year_september
,
item
.
profit_loss
.
monthly_last_year_septem
ber
,
item
.
profit_loss
.
monthly_last_year_octo
ber
,
item
.
profit_loss
.
monthly_last_year_octo
ber
,
item
.
profit_loss
.
monthly_last_year_novem
ber
,
item
.
profit_loss
.
monthly_last_year_nov
ember
,
item
.
profit_loss
.
monthly_last_year_dec
ember
,
item
.
profit_loss
.
monthly_last_year_december
,
item
.
profit_loss
.
notes
item
.
profit_loss
.
notes
])
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
handlePushChild
(
items
)
}
)
}
)
}
}
}
}
})
})
this
.
setState
({
dataTable
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
this
.
setState
({
dataTable
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
// this.setState({ dataTable , loading: false}, () => {
// this.setState({ dataTable , loading: false}, () => {
console
.
log
(
this
.
state
.
dataTable
)
console
.
log
(
this
.
state
.
dataTable
)
// this.getReportPLMR(payload)
// this.getReportPLMR(payload)
// })
// })
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
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