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
ca479ecb
Commit
ca479ecb
authored
Feb 04, 2021
by
rifkaki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into rifka
parents
d0e51ac2
0e519cba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
21 deletions
+23
-21
SubHolding.js
src/container/Laporan/SubHolding.js
+23
-21
No files found.
src/container/Laporan/SubHolding.js
View file @
ca479ecb
...
@@ -266,22 +266,6 @@ export default class SubHolding extends Component {
...
@@ -266,22 +266,6 @@ export default class SubHolding extends Component {
}
}
getReportType
()
{
getReportType
()
{
console
.
log
(
'sini deh'
)
let
data
=
this
.
state
.
listPeriode
.
options
let
currentYear
=
new
Date
().
getFullYear
()
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriod
)
let
dateNow
=
new
Date
()
dateNow
.
setMonth
(
dateNow
.
getMonth
()
-
1
);
let
yearNow
=
dateNow
.
getFullYear
()
// console.log(data)
// console.log(yearNow)
// console.log(periode)
if
(
String
(
this
.
state
.
report
.
label
).
toLocaleLowerCase
().
includes
(
'summary'
))
{
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
.
periode
==
yearNow
)
// console.log(index)
this
.
setState
({
periode
:
data
[
index
]})
}
let
payload
=
{
let
payload
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
.
periode
,
"periode"
:
this
.
state
.
periode
.
periode
,
...
@@ -662,7 +646,7 @@ export default class SubHolding extends Component {
...
@@ -662,7 +646,7 @@ export default class SubHolding extends Component {
PLID
=
null
PLID
=
null
}
}
this
.
setState
({
PLID
},
()
=>
{
this
.
setState
({
PLID
},
()
=>
{
let
payloads
=
{...
payload
,
submission_id
:
this
.
state
.
PLID
,
months
:
this
.
state
.
month
.
month_id
,
quarter
:
0
}
let
payloads
=
{...
payload
,
report_id
:
28
,
submission_id
:
this
.
state
.
PLID
,
months
:
this
.
state
.
month
.
month_id
,
quarter
:
0
}
console
.
log
(
payloads
);
console
.
log
(
payloads
);
api
.
create
().
getReportPL
(
payloads
).
then
(
response
=>
{
api
.
create
().
getReportPL
(
payloads
).
then
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
...
@@ -2911,7 +2895,7 @@ export default class SubHolding extends Component {
...
@@ -2911,7 +2895,7 @@ export default class SubHolding extends Component {
}
}
}
else
if
(
this
.
state
.
report
.
value
===
3
)
{
}
else
if
(
this
.
state
.
report
.
value
===
3
)
{
let
res
=
await
fetch
(
let
res
=
await
fetch
(
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/db_profit_loss/export_report?submission_id=
${
this
.
state
.
PLID
===
null
?
""
:
this
.
state
.
PLID
}
&&report_id=
${
this
.
state
.
report
.
value
}
&&company_id=
${
this
.
state
.
company
.
company_id
}
&&year=
${
this
.
state
.
periode
.
periode
}
&&revision=
${
this
.
state
.
revisionType
}
`
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/db_profit_loss/export_report?submission_id=
${
this
.
state
.
PLID
===
null
?
""
:
this
.
state
.
PLID
}
&&report_id=
28
&&company_id=
${
this
.
state
.
company
.
company_id
}
&&year=
${
this
.
state
.
periode
.
periode
}
&&revision=
${
this
.
state
.
revisionType
}
`
)
)
res
=
await
res
.
blob
()
res
=
await
res
.
blob
()
this
.
setState
({
loading
:
false
})
this
.
setState
({
loading
:
false
})
...
@@ -2923,10 +2907,10 @@ export default class SubHolding extends Component {
...
@@ -2923,10 +2907,10 @@ export default class SubHolding extends Component {
a
.
click
();
a
.
click
();
}
}
}
else
if
(
this
.
state
.
report
.
value
===
4
)
{
}
else
if
(
this
.
state
.
report
.
value
===
4
)
{
let
url
=
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/db_ratio/export_report?submission_id=
${
this
.
state
.
FRID
===
null
?
""
:
this
.
state
.
FRID
}
&&report_id=
${
this
.
state
.
report
.
value
}
&&company_id=
${
this
.
state
.
company
.
company_id
}
&&year=
${
this
.
state
.
periode
.
periode
}
&&revision=
${
this
.
state
.
revisionType
}
`
let
url
=
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/db_ratio/export_report?submission_id=
${
this
.
state
.
FRID
===
null
?
""
:
this
.
state
.
FRID
}
&&report_id=
29
&&company_id=
${
this
.
state
.
company
.
company_id
}
&&year=
${
this
.
state
.
periode
.
periode
}
&&revision=
${
this
.
state
.
revisionType
}
`
console
.
log
(
url
);
console
.
log
(
url
);
let
res
=
await
fetch
(
let
res
=
await
fetch
(
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/db_ratio/export_report?submission_id=
${
this
.
state
.
FRID
===
null
?
""
:
this
.
state
.
FRID
}
&&report_id=
${
this
.
state
.
report
.
value
}
&&company_id=
${
this
.
state
.
company
.
company_id
}
&&year=
${
this
.
state
.
periode
.
periode
}
&&revision=
${
this
.
state
.
revisionType
}
`
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/db_ratio/export_report?submission_id=
${
this
.
state
.
FRID
===
null
?
""
:
this
.
state
.
FRID
}
&&report_id=
29
&&company_id=
${
this
.
state
.
company
.
company_id
}
&&year=
${
this
.
state
.
periode
.
periode
}
&&revision=
${
this
.
state
.
revisionType
}
`
)
)
res
=
await
res
.
blob
()
res
=
await
res
.
blob
()
this
.
setState
({
loading
:
false
})
this
.
setState
({
loading
:
false
})
...
@@ -3049,7 +3033,25 @@ export default class SubHolding extends Component {
...
@@ -3049,7 +3033,25 @@ export default class SubHolding extends Component {
getOptionLabel
=
{(
option
)
=>
titleCase
(
option
.
label
)}
getOptionLabel
=
{(
option
)
=>
titleCase
(
option
.
label
)}
id
=
"typereport"
id
=
"typereport"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
report
:
newInputValue
,
loading
:
true
,
previewTable
:
false
},
()
=>
{
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
report
:
newInputValue
,
loading
:
true
,
previewTable
:
false
},
()
=>
{
this
.
getReportType
()
console
.
log
(
'sini deh'
)
let
data
=
this
.
state
.
listPeriode
.
options
let
currentYear
=
new
Date
().
getFullYear
()
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriod
)
let
dateNow
=
new
Date
()
dateNow
.
setMonth
(
dateNow
.
getMonth
()
-
1
);
let
yearNow
=
dateNow
.
getFullYear
()
// console.log(data)
// console.log(yearNow)
// console.log(periode)
if
(
String
(
this
.
state
.
report
.
label
).
toLocaleLowerCase
().
includes
(
'summary'
))
{
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
.
periode
==
yearNow
)
// console.log(index)
this
.
setState
({
periode
:
data
[
index
]},
()
=>
{
this
.
getReportType
()
})
}
else
{
this
.
getReportType
()
}
})}
})}
disableClearable
disableClearable
style
=
{{
width
:
250
}}
style
=
{{
width
:
250
}}
...
...
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