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
2981e5e7
Commit
2981e5e7
authored
Jan 26, 2021
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
8a0c59b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
270 additions
and
270 deletions
+270
-270
SubHolding.js
src/container/Laporan/SubHolding.js
+270
-270
No files found.
src/container/Laporan/SubHolding.js
View file @
2981e5e7
...
...
@@ -205,13 +205,13 @@ export default class SubHolding extends Component {
let
index
=
data
.
findIndex
((
val
)
=>
val
.
month_name
==
month
)
let
listQuarter
=
[
{
name
:
'Q1'
,
value
:
'3'
},
{
name
:
'Q2'
,
value
:
'6'
},
{
name
:
'Q3'
,
value
:
'9'
},
{
name
:
'Q4'
,
value
:
'12'
},
{
name
:
'Q1'
,
value
:
'3'
},
{
name
:
'Q2'
,
value
:
'6'
},
{
name
:
'Q3'
,
value
:
'9'
},
{
name
:
'Q4'
,
value
:
'12'
},
]
let
listUom
=
[{
value
:
'Mio IDR'
}]
let
listUom
=
[{
value
:
'Mio IDR'
}]
let
defaultPropsQuarter
=
{
options
:
listQuarter
,
...
...
@@ -235,8 +235,8 @@ export default class SubHolding extends Component {
// this.getPeriode()
this
.
getReportType
()
// } else {
// this.getLastPeriod()
// this.getPeriode()
// this.getLastPeriod()
// this.getPeriode()
// }
})
}
else
{
...
...
@@ -268,7 +268,7 @@ export default class SubHolding extends Component {
if
(
this
.
state
.
report
.
value
===
2
)
{
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
report_name
===
'Balance Sheet'
)
{
this
.
setState
({
revisionType
:
item
.
revision
},
()
=>
{
this
.
setState
({
revisionType
:
item
.
revision
},
()
=>
{
this
.
getSubmission
()
})
}
...
...
@@ -276,7 +276,7 @@ export default class SubHolding extends Component {
}
else
if
(
this
.
state
.
report
.
value
===
1
)
{
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
report_name
===
'Profit Loss'
)
{
this
.
setState
({
revisionType
:
item
.
revision
},
()
=>
{
this
.
setState
({
revisionType
:
item
.
revision
},
()
=>
{
this
.
getSubmission
()
})
}
...
...
@@ -284,13 +284,13 @@ export default class SubHolding extends Component {
}
else
if
(
this
.
state
.
report
.
value
===
5
)
{
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
report_name
===
'Tax Planning'
)
{
this
.
setState
({
revisionType
:
item
.
revision
},
()
=>
{
this
.
setState
({
revisionType
:
item
.
revision
},
()
=>
{
this
.
getSubmission
()
})
}
})
}
else
{
this
.
setState
({
revisionType
:
0
},
()
=>
{
this
.
setState
({
revisionType
:
0
},
()
=>
{
this
.
getSubmission
()
})
}
...
...
@@ -305,7 +305,7 @@ export default class SubHolding extends Component {
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
})
}
...
...
@@ -821,7 +821,7 @@ export default class SubHolding extends Component {
console
.
log
(
this
.
state
.
dataTable
)
this
.
getRatioMR
(
payload
)
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
...
...
@@ -830,7 +830,7 @@ export default class SubHolding extends Component {
},
1000
);
}
})
}
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
...
...
@@ -917,7 +917,7 @@ export default class SubHolding extends Component {
this
.
setState
({
dataTable
},
()
=>
{
this
.
getTaxPlanMR
(
payload
)
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
...
...
@@ -926,7 +926,7 @@ export default class SubHolding extends Component {
},
1000
);
}
})
}
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
...
...
@@ -944,16 +944,16 @@ export default class SubHolding extends Component {
if
(
response
.
data
.
data
)
{
OPID
=
response
.
data
.
data
.
operating_indicator_id
}
else
{
OPID
=
null
OPID
=
null
}
this
.
setState
({
OPID
},
()
=>
{
this
.
setState
({
OPID
},
()
=>
{
let
payloadOI
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"operating_indicator_id"
:
this
.
state
.
OPID
,
"periode"
:
this
.
state
.
periode
.
periode
,
"report_id"
:
21
}
api
.
create
().
getAllReportOI
(
payloadOI
).
then
(
response
=>
{
// console.log(payload);
console
.
log
(
response
);
...
...
@@ -1061,7 +1061,7 @@ export default class SubHolding extends Component {
// console.log(this.state.dataTable)
// this.getOIMR(payloadOI)
// })
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
...
...
@@ -1070,7 +1070,7 @@ export default class SubHolding extends Component {
},
1000
);
}
})
}
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
...
...
@@ -1078,52 +1078,52 @@ export default class SubHolding extends Component {
})
}
})
}
else
if
(
this
.
state
.
report
.
value
===
6
)
{
}
else
if
(
this
.
state
.
report
.
value
===
6
)
{
let
dbSumaCF
=
[]
let
paylodCF
=
{
...
payload
,
months
:
this
.
state
.
month
.
month_id
}
let
paylodCF
=
{
...
payload
,
months
:
this
.
state
.
month
.
month_id
}
api
.
create
().
getReportCFSuma
(
paylodCF
).
then
(
response
=>
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
res
=
response
.
data
.
data
console
.
log
(
res
)
console
.
log
(
res
)
const
handlePushChild
=
(
item
)
=>
{
let
indexIDzz
=
dbSumaCF
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
if
(
indexIDzz
===
-
1
)
{
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
persenMtd
=
Number
(
mtd_actual
/
mtd
)
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
persenMtd
=
Number
(
mtd_actual
/
mtd
)
let
ytd_actual
=
item
.
cash_flow
.
ytd_actual
==
''
?
0
:
item
.
cash_flow
.
ytd_actual
let
ytd
=
item
.
cash_flow
.
ytd
==
''
?
0
:
item
.
cash_flow
.
ytd
let
persenYtd
=
Number
(
ytd_actual
/
ytd
)
let
ytd_actual
=
item
.
cash_flow
.
ytd_actual
==
''
?
0
:
item
.
cash_flow
.
ytd_actual
let
ytd
=
item
.
cash_flow
.
ytd
==
''
?
0
:
item
.
cash_flow
.
ytd
let
persenYtd
=
Number
(
ytd_actual
/
ytd
)
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
persenQuarter
=
Number
(
quarter_actual
/
quarter
)
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
persenQuarter
=
Number
(
quarter_actual
/
quarter
)
let
fy_actual
=
item
.
cash_flow
.
fy_actual
==
''
?
0
:
item
.
cash_flow
.
fy_actual
let
fy
=
item
.
cash_flow
.
fy
==
''
?
0
:
item
.
cash_flow
.
fy
let
persenFy
=
Number
(
fy_actual
/
fy
)
let
fy_actual
=
item
.
cash_flow
.
fy_actual
==
''
?
0
:
item
.
cash_flow
.
fy_actual
let
fy
=
item
.
cash_flow
.
fy
==
''
?
0
:
item
.
cash_flow
.
fy
let
persenFy
=
Number
(
fy_actual
/
fy
)
dbSumaCF
.
push
([
item
.
id
,
item
.
cash_flow
.
mtd_actual
,
item
.
cash_flow
.
mtd
,
isNaN
(
persenMtd
)
||
persenMtd
==
'Infinity'
||
persenMtd
==
'-Infinity'
?
(
item
.
cash_flow
.
mtd
==
''
||
item
.
cash_flow
.
mtd
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
mtd
==
''
||
item
.
cash_flow
.
mtd
==
0
?
persenMtd
*
-
100
:
persenMtd
*
100
),
isNaN
(
persenMtd
)
||
persenMtd
==
'Infinity'
||
persenMtd
==
'-Infinity'
?
(
item
.
cash_flow
.
mtd
==
''
||
item
.
cash_flow
.
mtd
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
mtd
==
''
||
item
.
cash_flow
.
mtd
==
0
?
persenMtd
*
-
100
:
persenMtd
*
100
),
item
.
cash_flow
.
mtd_last_year
,
item
.
cash_flow
.
ytd_actual
,
item
.
cash_flow
.
ytd
,
isNaN
(
persenYtd
)
||
persenYtd
==
'Infinity'
||
persenYtd
==
'-Infinity'
?
(
item
.
cash_flow
.
ytd
==
''
||
item
.
cash_flow
.
ytd
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
ytd
==
''
||
item
.
cash_flow
.
ytd
==
0
?
persenYtd
*
-
100
:
persenYtd
*
100
),
isNaN
(
persenYtd
)
||
persenYtd
==
'Infinity'
||
persenYtd
==
'-Infinity'
?
(
item
.
cash_flow
.
ytd
==
''
||
item
.
cash_flow
.
ytd
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
ytd
==
''
||
item
.
cash_flow
.
ytd
==
0
?
persenYtd
*
-
100
:
persenYtd
*
100
),
// isNaN(persenYtd)? 0 : persenYtd * 100,
item
.
cash_flow
.
ytd_last_year
,
item
.
cash_flow
.
quarter_actual
,
item
.
cash_flow
.
quarter
,
isNaN
(
persenQuarter
)
||
persenQuarter
==
'Infinity'
||
persenQuarter
==
'-Infinity'
?
(
item
.
cash_flow
.
quarter
==
''
||
item
.
cash_flow
.
quarter
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
quarter
==
''
||
item
.
cash_flow
.
quarter
==
0
?
persenQuarter
*
-
100
:
persenQuarter
*
100
),
isNaN
(
persenQuarter
)
||
persenQuarter
==
'Infinity'
||
persenQuarter
==
'-Infinity'
?
(
item
.
cash_flow
.
quarter
==
''
||
item
.
cash_flow
.
quarter
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
quarter
==
''
||
item
.
cash_flow
.
quarter
==
0
?
persenQuarter
*
-
100
:
persenQuarter
*
100
),
// isNaN(persenQuarter)? 0 : persenQuarter * 100,
item
.
cash_flow
.
quarter_last_year
,
item
.
cash_flow
.
fy_actual
,
item
.
cash_flow
.
fy
,
isNaN
(
persenFy
)
||
persenFy
==
'Infinity'
||
persenFy
==
'-Infinity'
?
(
item
.
cash_flow
.
fy
==
''
||
item
.
cash_flow
.
fy
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
fy
==
''
||
item
.
cash_flow
.
fy
==
0
?
persenFy
*
-
100
:
persenFy
*
100
),
isNaN
(
persenFy
)
||
persenFy
==
'Infinity'
||
persenFy
==
'-Infinity'
?
(
item
.
cash_flow
.
fy
==
''
||
item
.
cash_flow
.
fy
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
fy
==
''
||
item
.
cash_flow
.
fy
==
0
?
persenFy
*
-
100
:
persenFy
*
100
),
// isNaN(persenFy)? 0 : persenFy * 100,
item
.
cash_flow
.
fy_last_year
,
])
...
...
@@ -1136,42 +1136,42 @@ export default class SubHolding extends Component {
}
}
}
res
.
map
((
item
,
index
)
=>
{
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
persenMtd
=
Number
(
mtd_actual
/
mtd
)
res
.
map
((
item
,
index
)
=>
{
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
persenMtd
=
Number
(
mtd_actual
/
mtd
)
console
.
log
(
persenMtd
)
let
ytd_actual
=
item
.
cash_flow
.
ytd_actual
==
''
?
0
:
item
.
cash_flow
.
ytd_actual
let
ytd
=
item
.
cash_flow
.
ytd
==
''
?
0
:
item
.
cash_flow
.
ytd
let
persenYtd
=
Number
(
ytd_actual
/
ytd
)
let
ytd_actual
=
item
.
cash_flow
.
ytd_actual
==
''
?
0
:
item
.
cash_flow
.
ytd_actual
let
ytd
=
item
.
cash_flow
.
ytd
==
''
?
0
:
item
.
cash_flow
.
ytd
let
persenYtd
=
Number
(
ytd_actual
/
ytd
)
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
persenQuarter
=
Number
(
quarter_actual
/
quarter
)
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
persenQuarter
=
Number
(
quarter_actual
/
quarter
)
let
fy_actual
=
item
.
cash_flow
.
fy_actual
==
''
?
0
:
item
.
cash_flow
.
fy_actual
let
fy
=
item
.
cash_flow
.
fy
==
''
?
0
:
item
.
cash_flow
.
fy
let
persenFy
=
Number
(
fy_actual
/
fy
)
let
fy_actual
=
item
.
cash_flow
.
fy_actual
==
''
?
0
:
item
.
cash_flow
.
fy_actual
let
fy
=
item
.
cash_flow
.
fy
==
''
?
0
:
item
.
cash_flow
.
fy
let
persenFy
=
Number
(
fy_actual
/
fy
)
dbSumaCF
.
push
([
item
.
id
,
item
.
cash_flow
.
mtd_actual
,
item
.
cash_flow
.
mtd
,
isNaN
(
persenMtd
)
||
persenMtd
==
'Infinity'
||
persenMtd
==
'-Infinity'
?
(
item
.
cash_flow
.
mtd
==
''
||
item
.
cash_flow
.
mtd
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
mtd
==
''
||
item
.
cash_flow
.
mtd
==
0
?
persenMtd
*
-
100
:
persenMtd
*
100
),
isNaN
(
persenMtd
)
||
persenMtd
==
'Infinity'
||
persenMtd
==
'-Infinity'
?
(
item
.
cash_flow
.
mtd
==
''
||
item
.
cash_flow
.
mtd
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
mtd
==
''
||
item
.
cash_flow
.
mtd
==
0
?
persenMtd
*
-
100
:
persenMtd
*
100
),
item
.
cash_flow
.
mtd_last_year
,
item
.
cash_flow
.
ytd_actual
,
item
.
cash_flow
.
ytd
,
isNaN
(
persenYtd
)
||
persenYtd
==
'Infinity'
||
persenYtd
==
'-Infinity'
?
(
item
.
cash_flow
.
ytd
==
''
||
item
.
cash_flow
.
ytd
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
ytd
==
''
||
item
.
cash_flow
.
ytd
==
0
?
persenYtd
*
-
100
:
persenYtd
*
100
),
isNaN
(
persenYtd
)
||
persenYtd
==
'Infinity'
||
persenYtd
==
'-Infinity'
?
(
item
.
cash_flow
.
ytd
==
''
||
item
.
cash_flow
.
ytd
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
ytd
==
''
||
item
.
cash_flow
.
ytd
==
0
?
persenYtd
*
-
100
:
persenYtd
*
100
),
// isNaN(persenYtd)? 0 : persenYtd * 100,
item
.
cash_flow
.
ytd_last_year
,
item
.
cash_flow
.
quarter_actual
,
item
.
cash_flow
.
quarter
,
isNaN
(
persenQuarter
)
||
persenQuarter
==
'Infinity'
||
persenQuarter
==
'-Infinity'
?
(
item
.
cash_flow
.
quarter
==
''
||
item
.
cash_flow
.
quarter
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
quarter
==
''
||
item
.
cash_flow
.
quarter
==
0
?
persenQuarter
*
-
100
:
persenQuarter
*
100
),
isNaN
(
persenQuarter
)
||
persenQuarter
==
'Infinity'
||
persenQuarter
==
'-Infinity'
?
(
item
.
cash_flow
.
quarter
==
''
||
item
.
cash_flow
.
quarter
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
quarter
==
''
||
item
.
cash_flow
.
quarter
==
0
?
persenQuarter
*
-
100
:
persenQuarter
*
100
),
// isNaN(persenQuarter)? 0 : persenQuarter * 100,
item
.
cash_flow
.
quarter_last_year
,
item
.
cash_flow
.
fy_actual
,
item
.
cash_flow
.
fy
,
isNaN
(
persenFy
)
||
persenFy
==
'Infinity'
||
persenFy
==
'-Infinity'
?
(
item
.
cash_flow
.
fy
==
''
||
item
.
cash_flow
.
fy
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
fy
==
''
||
item
.
cash_flow
.
fy
==
0
?
persenFy
*
-
100
:
persenFy
*
100
),
isNaN
(
persenFy
)
||
persenFy
==
'Infinity'
||
persenFy
==
'-Infinity'
?
(
item
.
cash_flow
.
fy
==
''
||
item
.
cash_flow
.
fy
==
0
?
-
0
:
0
)
:
(
item
.
cash_flow
.
fy
==
''
||
item
.
cash_flow
.
fy
==
0
?
persenFy
*
-
100
:
persenFy
*
100
),
// isNaN(persenFy)? 0 : persenFy * 100,
item
.
cash_flow
.
fy_last_year
,
])
...
...
@@ -1184,7 +1184,7 @@ export default class SubHolding extends Component {
}
})
console
.
log
(
dbSumaCF
)
this
.
setState
({
dbSumaCF
},
()
=>
{
this
.
setState
({
dbSumaCF
},
()
=>
{
api
.
create
().
getReportCFSumaMB
(
payload
).
then
(
response
=>
{
// console.log(payload);
console
.
log
(
response
);
...
...
@@ -1192,7 +1192,7 @@ export default class SubHolding extends Component {
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
res
=
response
.
data
.
data
console
.
log
(
res
)
console
.
log
(
res
)
const
handlePushChild
=
(
item
)
=>
{
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
if
(
indexIDzz
===
-
1
)
{
...
...
@@ -1274,7 +1274,7 @@ export default class SubHolding extends Component {
console
.
log
(
this
.
state
.
dataTable
)
this
.
getCFSumaMR
(
paylodCF
,
dbSumaCF
)
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
...
...
@@ -1283,13 +1283,13 @@ export default class SubHolding extends Component {
},
1000
);
}
})
}
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
})
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
...
...
@@ -1298,7 +1298,7 @@ export default class SubHolding extends Component {
},
1000
);
}
})
}
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
...
...
@@ -1477,7 +1477,7 @@ export default class SubHolding extends Component {
this
.
setState
({
previewTable
:
true
,
loading
:
false
,
previewDownload
:
false
})
})
}
else
if
(
this
.
state
.
report
.
value
===
9
)
{
let
paylodFR
=
{
...
payload
,
months
:
this
.
state
.
month
.
month_id
}
let
paylodFR
=
{
...
payload
,
months
:
this
.
state
.
month
.
month_id
}
api
.
create
().
getReportFRMB
(
paylodFR
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
response
);
...
...
@@ -1609,7 +1609,7 @@ export default class SubHolding extends Component {
}
getCFSumaMR
(
payload
,
dbSumaCF
)
{
let
payloadLast
=
{
...
payload
,
"periode"
:
Number
(
this
.
state
.
periode
.
periode
)
-
1
}
let
payloadLast
=
{
...
payload
,
"periode"
:
Number
(
this
.
state
.
periode
.
periode
)
-
1
}
// let payloadLast = {
// "report_id": this.state.report.value,
// "revision": this.state.revisionType,
...
...
@@ -1625,7 +1625,7 @@ export default class SubHolding extends Component {
let
dataTable2
=
[]
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
...
...
@@ -1633,18 +1633,18 @@ export default class SubHolding extends Component {
// console.log(indexIDzz)
if
(
indexIDzz
!=
-
1
)
{
dataTable2
.
push
([...
dataTable
[
indexIDzz
],
items
.
cash_flow
.
january
,
items
.
cash_flow
.
february
,
items
.
cash_flow
.
march
,
items
.
cash_flow
.
april
,
items
.
cash_flow
.
may
,
items
.
cash_flow
.
june
,
items
.
cash_flow
.
july
,
items
.
cash_flow
.
august
,
items
.
cash_flow
.
september
,
items
.
cash_flow
.
october
,
items
.
cash_flow
.
november
,
items
.
cash_flow
.
december
,
items
.
cash_flow
.
january
,
items
.
cash_flow
.
february
,
items
.
cash_flow
.
march
,
items
.
cash_flow
.
april
,
items
.
cash_flow
.
may
,
items
.
cash_flow
.
june
,
items
.
cash_flow
.
july
,
items
.
cash_flow
.
august
,
items
.
cash_flow
.
september
,
items
.
cash_flow
.
october
,
items
.
cash_flow
.
november
,
items
.
cash_flow
.
december
,
])
}
if
(
items
.
children
!==
null
)
{
...
...
@@ -1657,18 +1657,18 @@ export default class SubHolding extends Component {
}
dataTable2
.
push
([...
dataTable
[
indexID
],
item
.
cash_flow
.
january
,
item
.
cash_flow
.
february
,
item
.
cash_flow
.
march
,
item
.
cash_flow
.
april
,
item
.
cash_flow
.
may
,
item
.
cash_flow
.
june
,
item
.
cash_flow
.
july
,
item
.
cash_flow
.
august
,
item
.
cash_flow
.
september
,
item
.
cash_flow
.
october
,
item
.
cash_flow
.
november
,
item
.
cash_flow
.
december
,
item
.
cash_flow
.
january
,
item
.
cash_flow
.
february
,
item
.
cash_flow
.
march
,
item
.
cash_flow
.
april
,
item
.
cash_flow
.
may
,
item
.
cash_flow
.
june
,
item
.
cash_flow
.
july
,
item
.
cash_flow
.
august
,
item
.
cash_flow
.
september
,
item
.
cash_flow
.
october
,
item
.
cash_flow
.
november
,
item
.
cash_flow
.
december
,
])
if
(
item
.
children
!==
null
)
{
...
...
@@ -1678,9 +1678,9 @@ export default class SubHolding extends Component {
})
}
}
}
})
this
.
setState
({
dataTable2
},
()
=>
{
// console.log(this.state.dataTable2)
...
...
@@ -1702,7 +1702,7 @@ export default class SubHolding extends Component {
let
dataTable3
=
[]
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
let
indexIDSuma
=
dbSumaCF
.
findIndex
((
val
)
=>
val
[
0
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
...
...
@@ -1711,19 +1711,19 @@ export default class SubHolding extends Component {
// console.log(indexIDzz)
if
(
indexIDzz
!=
-
1
)
{
dataTable3
.
push
([...
dataTable2
[
indexIDzz
],
items
.
cash_flow
.
january
,
items
.
cash_flow
.
february
,
items
.
cash_flow
.
march
,
items
.
cash_flow
.
april
,
items
.
cash_flow
.
may
,
items
.
cash_flow
.
june
,
items
.
cash_flow
.
july
,
items
.
cash_flow
.
august
,
items
.
cash_flow
.
september
,
items
.
cash_flow
.
october
,
items
.
cash_flow
.
november
,
items
.
cash_flow
.
december
,
...
dbSumaCF
[
indexIDSuma
]
items
.
cash_flow
.
january
,
items
.
cash_flow
.
february
,
items
.
cash_flow
.
march
,
items
.
cash_flow
.
april
,
items
.
cash_flow
.
may
,
items
.
cash_flow
.
june
,
items
.
cash_flow
.
july
,
items
.
cash_flow
.
august
,
items
.
cash_flow
.
september
,
items
.
cash_flow
.
october
,
items
.
cash_flow
.
november
,
items
.
cash_flow
.
december
,
...
dbSumaCF
[
indexIDSuma
]
])
}
if
(
items
.
children
!==
null
)
{
...
...
@@ -1736,19 +1736,19 @@ export default class SubHolding extends Component {
}
dataTable3
.
push
([...
dataTable2
[
indexID
],
item
.
cash_flow
.
january
,
item
.
cash_flow
.
february
,
item
.
cash_flow
.
march
,
item
.
cash_flow
.
april
,
item
.
cash_flow
.
may
,
item
.
cash_flow
.
june
,
item
.
cash_flow
.
july
,
item
.
cash_flow
.
august
,
item
.
cash_flow
.
september
,
item
.
cash_flow
.
october
,
item
.
cash_flow
.
november
,
item
.
cash_flow
.
december
,
...
dbSumaCF
[
indexIDSuma
]
item
.
cash_flow
.
january
,
item
.
cash_flow
.
february
,
item
.
cash_flow
.
march
,
item
.
cash_flow
.
april
,
item
.
cash_flow
.
may
,
item
.
cash_flow
.
june
,
item
.
cash_flow
.
july
,
item
.
cash_flow
.
august
,
item
.
cash_flow
.
september
,
item
.
cash_flow
.
october
,
item
.
cash_flow
.
november
,
item
.
cash_flow
.
december
,
...
dbSumaCF
[
indexIDSuma
]
])
if
(
item
.
children
!==
null
)
{
...
...
@@ -1758,9 +1758,9 @@ export default class SubHolding extends Component {
})
}
}
}
})
console
.
log
(
dataTable3
)
this
.
setState
({
dataTable
:
dataTable3
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
...
...
@@ -1779,7 +1779,7 @@ export default class SubHolding extends Component {
let
dataTable2
=
[]
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
4
]
==
item
.
id
)
console
.
log
(
indexID
)
if
(
indexID
!=
-
1
)
{
...
...
@@ -1788,19 +1788,19 @@ export default class SubHolding extends Component {
// console.log(indexIDzz)
if
(
indexIDzz
!=
-
1
)
{
dataTable2
.
push
([...
dataTable
[
indexIDzz
],
Number
(
items
.
tax_planning_report
.
january
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
february
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
march
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
april
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
may
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
june
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
july
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
august
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
september
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
october
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
november
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
december
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
total_actual_before
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
january
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
february
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
march
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
april
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
may
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
june
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
july
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
august
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
september
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
october
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
november
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
december
).
toFixed
(
1
),
Number
(
items
.
tax_planning_report
.
total_actual_before
).
toFixed
(
1
),
])
}
if
(
items
.
children
!==
null
)
{
...
...
@@ -1813,19 +1813,19 @@ export default class SubHolding extends Component {
}
dataTable2
.
push
([...
dataTable
[
indexID
],
Number
(
item
.
tax_planning_report
.
january
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
february
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
march
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
april
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
may
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
june
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
july
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
august
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
september
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
october
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
november
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
december
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
total_actual_before
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
january
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
february
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
march
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
april
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
may
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
june
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
july
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
august
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
september
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
october
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
november
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
december
).
toFixed
(
1
),
Number
(
item
.
tax_planning_report
.
total_actual_before
).
toFixed
(
1
),
])
if
(
item
.
children
!==
null
)
{
...
...
@@ -1835,9 +1835,9 @@ export default class SubHolding extends Component {
})
}
}
}
})
console
.
log
(
dataTable2
)
this
.
setState
({
dataTable
:
dataTable2
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
...
...
@@ -1866,7 +1866,7 @@ export default class SubHolding extends Component {
let
dataTable2
=
[]
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
...
...
@@ -1874,19 +1874,19 @@ export default class SubHolding extends Component {
// console.log(indexIDzz)
if
(
indexIDzz
!=
-
1
)
{
dataTable2
.
push
([...
dataTable
[
indexIDzz
],
items
.
formula
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
january
,
formula
:
items
.
profit_detail
.
january_formula
}
:
items
.
profit_detail
.
january
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
february
,
formula
:
items
.
profit_detail
.
february_formula
}
:
items
.
profit_detail
.
february
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
march
,
formula
:
items
.
profit_detail
.
march_formula
}
:
items
.
profit_detail
.
march
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
april
,
formula
:
items
.
profit_detail
.
april_formula
}
:
items
.
profit_detail
.
april
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
may
,
formula
:
items
.
profit_detail
.
may_formula
}
:
items
.
profit_detail
.
may
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
june
,
formula
:
items
.
profit_detail
.
june_formula
}
:
items
.
profit_detail
.
june
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
july
,
formula
:
items
.
profit_detail
.
july_formula
}
:
items
.
profit_detail
.
july
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
august
,
formula
:
items
.
profit_detail
.
august_formula
}
:
items
.
profit_detail
.
august
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
september
,
formula
:
items
.
profit_detail
.
september_formula
}
:
items
.
profit_detail
.
september
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
october
,
formula
:
items
.
profit_detail
.
october_formula
}
:
items
.
profit_detail
.
october
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
november
,
formula
:
items
.
profit_detail
.
november_formula
}
:
items
.
profit_detail
.
november
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
december
,
formula
:
items
.
profit_detail
.
december_formula
}
:
items
.
profit_detail
.
december
,
items
.
formula
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
january
,
formula
:
items
.
profit_detail
.
january_formula
}
:
items
.
profit_detail
.
january
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
february
,
formula
:
items
.
profit_detail
.
february_formula
}
:
items
.
profit_detail
.
february
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
march
,
formula
:
items
.
profit_detail
.
march_formula
}
:
items
.
profit_detail
.
march
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
april
,
formula
:
items
.
profit_detail
.
april_formula
}
:
items
.
profit_detail
.
april
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
may
,
formula
:
items
.
profit_detail
.
may_formula
}
:
items
.
profit_detail
.
may
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
june
,
formula
:
items
.
profit_detail
.
june_formula
}
:
items
.
profit_detail
.
june
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
july
,
formula
:
items
.
profit_detail
.
july_formula
}
:
items
.
profit_detail
.
july
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
august
,
formula
:
items
.
profit_detail
.
august_formula
}
:
items
.
profit_detail
.
august
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
september
,
formula
:
items
.
profit_detail
.
september_formula
}
:
items
.
profit_detail
.
september
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
october
,
formula
:
items
.
profit_detail
.
october_formula
}
:
items
.
profit_detail
.
october
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
november
,
formula
:
items
.
profit_detail
.
november_formula
}
:
items
.
profit_detail
.
november
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
december
,
formula
:
items
.
profit_detail
.
december_formula
}
:
items
.
profit_detail
.
december
,
])
}
if
(
items
.
children
!==
null
)
{
...
...
@@ -1899,19 +1899,19 @@ export default class SubHolding extends Component {
}
dataTable2
.
push
([...
dataTable
[
indexID
],
item
.
formula
,
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
.
formula
,
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
,
])
if
(
item
.
children
!==
null
)
{
...
...
@@ -1921,9 +1921,9 @@ export default class SubHolding extends Component {
})
}
}
}
})
console
.
log
(
dataTable2
)
// this.setState({ dataTable: dataTable2, previewTable: true, loading: false, previewDownload: true })
...
...
@@ -1945,7 +1945,7 @@ export default class SubHolding extends Component {
let
dataTable3
=
[]
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
...
...
@@ -1953,18 +1953,18 @@ export default class SubHolding extends Component {
// console.log(indexIDzz)
if
(
indexIDzz
!=
-
1
)
{
dataTable3
.
push
([...
dataTable2
[
indexIDzz
],
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
january
,
formula
:
items
.
profit_detail
.
january_formula
}
:
items
.
profit_detail
.
january
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
february
,
formula
:
items
.
profit_detail
.
february_formula
}
:
items
.
profit_detail
.
february
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
march
,
formula
:
items
.
profit_detail
.
march_formula
}
:
items
.
profit_detail
.
march
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
april
,
formula
:
items
.
profit_detail
.
april_formula
}
:
items
.
profit_detail
.
april
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
may
,
formula
:
items
.
profit_detail
.
may_formula
}
:
items
.
profit_detail
.
may
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
june
,
formula
:
items
.
profit_detail
.
june_formula
}
:
items
.
profit_detail
.
june
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
july
,
formula
:
items
.
profit_detail
.
july_formula
}
:
items
.
profit_detail
.
july
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
august
,
formula
:
items
.
profit_detail
.
august_formula
}
:
items
.
profit_detail
.
august
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
september
,
formula
:
items
.
profit_detail
.
september_formula
}
:
items
.
profit_detail
.
september
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
october
,
formula
:
items
.
profit_detail
.
october_formula
}
:
items
.
profit_detail
.
october
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
november
,
formula
:
items
.
profit_detail
.
november_formula
}
:
items
.
profit_detail
.
november
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
december
,
formula
:
items
.
profit_detail
.
december_formula
}
:
items
.
profit_detail
.
december
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
january
,
formula
:
items
.
profit_detail
.
january_formula
}
:
items
.
profit_detail
.
january
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
february
,
formula
:
items
.
profit_detail
.
february_formula
}
:
items
.
profit_detail
.
february
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
march
,
formula
:
items
.
profit_detail
.
march_formula
}
:
items
.
profit_detail
.
march
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
april
,
formula
:
items
.
profit_detail
.
april_formula
}
:
items
.
profit_detail
.
april
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
may
,
formula
:
items
.
profit_detail
.
may_formula
}
:
items
.
profit_detail
.
may
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
june
,
formula
:
items
.
profit_detail
.
june_formula
}
:
items
.
profit_detail
.
june
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
july
,
formula
:
items
.
profit_detail
.
july_formula
}
:
items
.
profit_detail
.
july
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
august
,
formula
:
items
.
profit_detail
.
august_formula
}
:
items
.
profit_detail
.
august
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
september
,
formula
:
items
.
profit_detail
.
september_formula
}
:
items
.
profit_detail
.
september
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
october
,
formula
:
items
.
profit_detail
.
october_formula
}
:
items
.
profit_detail
.
october
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
november
,
formula
:
items
.
profit_detail
.
november_formula
}
:
items
.
profit_detail
.
november
,
items
.
type_report_id
==
5
||
items
.
type_report_id
==
6
||
items
.
type_report_id
==
7
?
{
value
:
items
.
profit_detail
.
december
,
formula
:
items
.
profit_detail
.
december_formula
}
:
items
.
profit_detail
.
december
,
])
}
if
(
items
.
children
!==
null
)
{
...
...
@@ -1977,18 +1977,18 @@ export default class SubHolding extends Component {
}
dataTable3
.
push
([...
dataTable2
[
indexID
],
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
.
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
,
])
if
(
item
.
children
!==
null
)
{
...
...
@@ -1998,9 +1998,9 @@ export default class SubHolding extends Component {
})
}
}
}
})
console
.
log
(
dataTable3
)
this
.
setState
({
dataTable
:
dataTable3
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
...
...
@@ -2026,7 +2026,7 @@ export default class SubHolding extends Component {
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
...
...
@@ -2034,18 +2034,18 @@ export default class SubHolding extends Component {
// console.log(indexIDzz)
if
(
indexIDzz
!=
-
1
)
{
dataTable2
.
push
([...
dataTable
[
indexIDzz
],
Number
(
items
.
ratio
.
monthly_january
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_february
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_march
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_april
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_may
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_june
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_july
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_august
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_september
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_october
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_november
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_december
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_january
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_february
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_march
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_april
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_may
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_june
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_july
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_august
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_september
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_october
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_november
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_december
).
toFixed
(
2
),
])
}
if
(
items
.
children
!==
null
)
{
...
...
@@ -2058,18 +2058,18 @@ export default class SubHolding extends Component {
}
dataTable2
.
push
([...
dataTable
[
indexID
],
Number
(
item
.
ratio
.
monthly_january
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_february
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_march
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_april
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_may
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_june
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_july
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_august
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_september
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_october
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_november
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_december
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_january
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_february
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_march
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_april
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_may
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_june
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_july
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_august
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_september
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_october
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_november
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_december
).
toFixed
(
2
),
])
if
(
item
.
children
!==
null
)
{
...
...
@@ -2079,9 +2079,9 @@ export default class SubHolding extends Component {
})
}
}
}
})
console
.
log
(
dataTable2
)
// this.setState({ dataTable: dataTable2, previewTable: true, loading: false, previewDownload: true })
...
...
@@ -2089,7 +2089,7 @@ export default class SubHolding extends Component {
console
.
log
(
this
.
state
.
dataTable2
)
this
.
getRatioLastMR
(
payloadLast
)
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
...
...
@@ -2098,7 +2098,7 @@ export default class SubHolding extends Component {
},
1000
);
}
})
}
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
...
...
@@ -2114,7 +2114,7 @@ export default class SubHolding extends Component {
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
...
...
@@ -2122,18 +2122,18 @@ export default class SubHolding extends Component {
// console.log(indexIDzz)
if
(
indexIDzz
!=
-
1
)
{
dataTable3
.
push
([...
dataTable2
[
indexIDzz
],
Number
(
items
.
ratio
.
monthly_january
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_february
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_march
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_april
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_may
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_june
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_july
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_august
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_september
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_october
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_november
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_december
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_january
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_february
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_march
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_april
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_may
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_june
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_july
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_august
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_september
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_october
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_november
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_december
).
toFixed
(
2
),
])
}
if
(
items
.
children
!==
null
)
{
...
...
@@ -2146,18 +2146,18 @@ export default class SubHolding extends Component {
}
dataTable3
.
push
([...
dataTable2
[
indexID
],
Number
(
item
.
ratio
.
monthly_january
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_february
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_march
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_april
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_may
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_june
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_july
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_august
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_september
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_october
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_november
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_december
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_january
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_february
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_march
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_april
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_may
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_june
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_july
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_august
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_september
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_october
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_november
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_december
).
toFixed
(
2
),
])
if
(
item
.
children
!==
null
)
{
...
...
@@ -2167,13 +2167,13 @@ export default class SubHolding extends Component {
})
}
}
}
})
console
.
log
(
dataTable3
)
this
.
setState
({
dataTable
:
dataTable3
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
...
...
@@ -2182,7 +2182,7 @@ export default class SubHolding extends Component {
},
1000
);
}
})
}
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
...
...
@@ -2283,7 +2283,7 @@ export default class SubHolding extends Component {
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Sub
Holding
<
/Typography
>
<
/div
>
<
div
style
=
{{
minWidth
:
'max-content'
,
padding
:
'20px 20px 0px 20px'
}}
>
<
div
style
=
{{
marginTop
:
15
,
display
:
'flex'
}}
>
<
div
style
=
{{
marginTop
:
15
,
display
:
'flex'
}}
>
<
Autocomplete
options
=
{
this
.
state
.
reportType
}
getOptionLabel
=
{(
option
)
=>
titleCase
(
option
.
label
)}
...
...
@@ -2296,7 +2296,7 @@ export default class SubHolding extends Component {
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Report Type"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
value
=
{
this
.
state
.
report
}
/
>
{
this
.
state
.
report
!=
null
?
String
(
this
.
state
.
report
.
label
).
toLocaleLowerCase
().
includes
(
'summary'
)
?
<
Autocomplete
{
this
.
state
.
report
!=
null
?
String
(
this
.
state
.
report
.
label
).
toLocaleLowerCase
().
includes
(
'summary'
)
?
<
Autocomplete
{...
this
.
state
.
listMonths
}
// getOptionLabel={(option) => titleCase(option.label)}
id
=
"months"
...
...
@@ -2322,7 +2322,7 @@ export default class SubHolding extends Component {
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Company"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
value
=
{
this
.
state
.
company
}
/
>
{
this
.
state
.
report
!=
null
?
String
(
this
.
state
.
report
.
label
).
toLocaleLowerCase
().
includes
(
'summary'
)
?
<
Autocomplete
{
this
.
state
.
report
!=
null
?
String
(
this
.
state
.
report
.
label
).
toLocaleLowerCase
().
includes
(
'summary'
)
?
<
Autocomplete
{...
this
.
state
.
listQuarter
}
// getOptionLabel={(option) => titleCase(option.label)}
id
=
"quarter"
...
...
@@ -2335,7 +2335,7 @@ export default class SubHolding extends Component {
value
=
{
this
.
state
.
quarter
}
/> : null : null
}
<
/div
>
<
div
style
=
{{
marginTop
:
15
,
display
:
'flex'
}}
>
<
div
style
=
{{
marginTop
:
15
,
display
:
'flex'
}}
>
<
Autocomplete
{...
this
.
state
.
listPeriode
}
id
=
"periode"
...
...
@@ -2350,7 +2350,7 @@ export default class SubHolding extends Component {
/>
}
value
=
{
this
.
state
.
periode
}
/
>
{
this
.
state
.
report
!=
null
?
String
(
this
.
state
.
report
.
label
).
toLocaleLowerCase
().
includes
(
'summary'
)
?
<
Autocomplete
{
this
.
state
.
report
!=
null
?
String
(
this
.
state
.
report
.
label
).
toLocaleLowerCase
().
includes
(
'summary'
)
?
<
Autocomplete
{...
this
.
state
.
listUom
}
// getOptionLabel={(option) => titleCase(option.label)}
id
=
"uom"
...
...
@@ -2358,7 +2358,7 @@ export default class SubHolding extends Component {
this
.
getReportType
()
})}
disableClearable
style
=
{{
width
:
250
,
marginLeft
:
10
}}
style
=
{{
width
:
250
,
marginLeft
:
10
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Uom"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
value
=
{
this
.
state
.
uom
}
/> : null : null
}
...
...
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