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 {
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
)
{
if
(
response
.
data
.
status
===
'success'
)
{
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
.
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
([
item
.
type_report_id
,
item
.
id
,
...
...
@@ -478,82 +539,32 @@ export default class SubHolding extends Component {
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
([
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
)
})
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
}
})
// console.log(dataTable)
// this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
this
.
setState
({
dataTable
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
})
// console.log(dataTable)
// this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
this
.
setState
({
dataTable
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
// this.setState({ dataTable }, () => {
// console.log(this.state.dataTable)
// this.getPLDetailMR(payload)
// })
// this.setState({ dataTable }, () => {
// console.log(this.state.dataTable)
// 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
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
}
...
...
@@ -564,10 +575,72 @@ export default class SubHolding extends Component {
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
)
{
if
(
response
.
data
.
status
===
'success'
)
{
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
,
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
([
item
.
type_report_id
,
item
.
id
,
...
...
@@ -619,80 +692,29 @@ export default class SubHolding extends Component {
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
)
}
)
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
,
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
{
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
);
}
}
})
this
.
setState
({
dataTable
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
// this.setState({ dataTable }, () => {
// console.log(this.state.dataTable)
// this.getBalanceSheetMR(payload)
// })
})
}
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
}
...
...
@@ -718,173 +740,184 @@ export default class SubHolding extends Component {
api
.
create
().
getReportPL
(
payloads
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
let
dataTable
=
[]
console
.
log
(
response
)
let
res
=
response
.
data
.
data
const
handlePushChild
=
(
item
)
=>
{
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.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.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.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.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.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.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.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.december, formula: item.profit_detail.december_formula } : item.profit_detail.december,
// 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_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
.
order
,
item
.
condition_it_should_be
,
item
.
condition_if_wrong
,
[],
""
,
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
(
response
.
data
.
status
===
'success'
)
{
let
dataTable
=
[]
console
.
log
(
response
)
let
res
=
response
.
data
.
data
const
handlePushChild
=
(
item
)
=>
{
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.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.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.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.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.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.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.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.december, formula: item.profit_detail.december_formula } : item.profit_detail.december,
// 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_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
.
order
,
item
.
condition_it_should_be
,
item
.
condition_if_wrong
,
[],
""
,
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
)
})
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
.
profit_loss
.
total_actual_before
===
null
?
"0"
:
item
.
profit_loss
.
total_actual_before
===
""
?
"0"
:
item
.
profit_loss
.
total_actual_before
,
item
.
profit_loss
.
jan
uary
,
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
.
septem
ber
,
item
.
profit_loss
.
octo
ber
,
item
.
profit_loss
.
nov
ember
,
item
.
profit_loss
.
decembe
r
,
item
.
profit_loss
.
total_curren
t_year
,
item
.
profit_loss
.
total_next
_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.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.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.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.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.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.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.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.decembe
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_next
_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
.
order
,
item
.
condition_it_should_be
,
item
.
condition_if_wrong
,
[]
,
""
,
item
.
profit_loss
.
monthly_jan
uary
,
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_septem
ber
,
item
.
profit_loss
.
monthly_octo
ber
,
item
.
profit_loss
.
monthly_nov
ember
,
item
.
profit_loss
.
monthly_december
,
item
.
profit_loss
.
monthly_last_year_jan
uary
,
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_septem
ber
,
item
.
profit_loss
.
monthly_last_year_octo
ber
,
item
.
profit_loss
.
monthly_last_year_nov
ember
,
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
([
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
.
febr
uary
,
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
.
octo
ber
,
item
.
profit_loss
.
novem
ber
,
item
.
profit_loss
.
dec
ember
,
item
.
profit_loss
.
total_current_yea
r
,
item
.
profit_loss
.
total_nex
t_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.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.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.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.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.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.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.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.december, formula: item.profit_detail.december_formula } : item.profit_detail.dec
ember,
// item.profit_detail.total_current_yea
r,
// 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_more
_year,
item
.
orde
r
,
item
.
condition_it_should_be
,
item
.
condition_if_wrong
,
[]
,
""
,
item
.
profit_loss
.
monthly_january
,
item
.
profit_loss
.
monthly_febr
uary
,
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_octo
ber
,
item
.
profit_loss
.
monthly_novem
ber
,
item
.
profit_loss
.
monthly_dec
ember
,
item
.
profit_loss
.
monthly_last_year_january
,
item
.
profit_loss
.
monthly_last_year_febr
uary
,
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_octo
ber
,
item
.
profit_loss
.
monthly_last_year_novem
ber
,
item
.
profit_loss
.
monthly_last_year_dec
ember
,
item
.
profit_loss
.
notes
])
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 , loading: false}, () => {
console
.
log
(
this
.
state
.
dataTable
)
// this.getReportPLMR(payload)
// })
})
this
.
setState
({
dataTable
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
// this.setState({ dataTable , loading: false}, () => {
console
.
log
(
this
.
state
.
dataTable
)
// 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
{
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