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
9384300e
Commit
9384300e
authored
Oct 06, 2020
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'faisal' into 'master'
OLPA PL See merge request
!474
parents
54217f96
d9c23444
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
82 deletions
+78
-82
ProfitLossOLPA.js
src/container/OutlookPA/ProfitLossOLPA.js
+78
-82
No files found.
src/container/OutlookPA/ProfitLossOLPA.js
View file @
9384300e
...
...
@@ -66,7 +66,7 @@ export default class ProfitLossOLPA extends Component {
"revision"
:
Number
(
this
.
props
.
revision
),
"periode"
:
this
.
props
.
periode
,
"company_id"
:
this
.
props
.
company
.
company_id
,
"
submission_id"
:
this
.
props
.
submissionID
"
outlook_pa_id"
:
this
.
props
.
outlook_pa_id
}
api
.
create
().
getLastestUpdateMB
(
payload
).
then
(
response
=>
{
if
(
response
.
data
)
{
...
...
@@ -79,19 +79,19 @@ export default class ProfitLossOLPA extends Component {
})
}
getItemHierarki
()
{
async
getItemHierarki
()
{
this
.
setState
({
loading
:
true
,
judulColumn
:
null
})
let
payload
=
{
"outlook_pa_id"
:
this
.
props
.
outlook_pa_id
,
"report_id"
:
this
.
props
.
report_id
,
"revision"
:
Number
(
this
.
props
.
revision
)
,
"revision"
:
this
.
props
.
revision
,
"periode"
:
this
.
props
.
periode
,
"company_id"
:
this
.
props
.
company
.
company_id
,
"submission_id"
:
this
.
props
.
submissionID
"company_id"
:
this
.
props
.
company
.
company_id
}
api
.
create
().
getDetailReportMB
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
)
let
response
=
await
api
.
create
().
getDetailReportOLPA
(
payload
)
console
.
log
(
response
);
let
dataTable
=
[]
this
.
setState
({
visibleProfitLoss
:
true
})
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
const
handlePushChild
=
(
item
)
=>
{
...
...
@@ -172,8 +172,6 @@ export default class ProfitLossOLPA extends Component {
}
else
{
this
.
setState
({
dataTable
,
loading
:
false
,
buttonError
:
true
,
editable
:
true
})
}
})
}
handleValue
(
data
)
{
...
...
@@ -203,7 +201,7 @@ export default class ProfitLossOLPA extends Component {
}
}
backTo
MasterBudget
(
type
)
{
backTo
OLPA
(
type
)
{
let
data
=
[]
this
.
state
.
dataTable
.
map
(
i
=>
{
data
.
push
({
...
...
@@ -228,7 +226,7 @@ export default class ProfitLossOLPA extends Component {
})
})
let
payload
=
{
"
submission_id"
:
this
.
props
.
submissionID
,
"
outlook_pa_id"
:
this
.
props
.
outlook_pa_id
,
"company_id"
:
this
.
props
.
company
.
company_id
,
"periode"
:
this
.
props
.
periode
,
"report_id"
:
this
.
props
.
report_id
,
...
...
@@ -237,13 +235,13 @@ export default class ProfitLossOLPA extends Component {
}
console
.
log
(
data
);
this
.
setState
({
loading
:
false
})
this
.
props
.
saveTo
MasterBudget
(
payload
)
this
.
props
.
saveTo
OLPA
(
payload
)
this
.
props
.
onClickClose
()
}
downloadTemplate
=
async
()
=>
{
let
res
=
await
fetch
(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/
master_budget
/download_template?report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
`
`https://tia.eksad.com/tia-reporting-dev/public/transaction/
outlook_pa
/download_template?report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
`
)
res
=
await
res
.
blob
()
console
.
log
(
res
)
...
...
@@ -306,7 +304,7 @@ export default class ProfitLossOLPA extends Component {
}
checkUpload
()
{
api
.
create
().
checkUpload
MB
(
this
.
state
.
payload
).
then
(
response
=>
{
api
.
create
().
checkUpload
OLPA
(
this
.
state
.
payload
).
then
(
response
=>
{
// console.log(JSON.stringify(this.state.payload));
console
.
log
(
response
)
if
(
response
.
data
)
{
...
...
@@ -380,15 +378,15 @@ export default class ProfitLossOLPA extends Component {
})
})
let
body
=
{
submission_id
:
this
.
props
.
submissionID
,
outlook_pa_id
:
this
.
props
.
outlook_pa_id
,
company_id
:
this
.
props
.
company
.
company_id
,
periode
:
this
.
props
.
periode
,
report_id
:
this
.
props
.
report_id
,
profit_loss
:
data
,
status
:
type
}
console
.
log
(
data
);
api
.
create
(
'UPLOAD'
).
upload
MasterBudget
(
body
).
then
(
response
=>
{
console
.
log
(
JSON
.
stringify
(
body
)
);
api
.
create
(
'UPLOAD'
).
upload
OLPA
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
...
...
@@ -400,18 +398,16 @@ export default class ProfitLossOLPA extends Component {
}
else
{
this
.
setState
({
loading
:
false
})
alert
(
response
.
problem
)
// this.props.onClickClose()
// this.props.getReport()
}
})
}
async
downloadAllData
()
{
let
url
=
`https://tia.eksad.com/tia-reporting-dev/public/transaction/
master_budget/export_master_budget?submission_id=
${
this
.
props
.
submissionID
}
&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
`
let
sub_null
=
`https://tia.eksad.com/tia-reporting-dev/public/transaction/
master_budget/export_master_budget?submission
_id=&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
`
let
url
=
`https://tia.eksad.com/tia-reporting-dev/public/transaction/
outlook_pa/export_outlook_pa?outlook_pa_id=
${
this
.
props
.
outlook_pa_id
}
&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
`
let
sub_null
=
`https://tia.eksad.com/tia-reporting-dev/public/transaction/
outlook_pa/export_outlook_pa?outlook_pa
_id=&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
`
console
.
log
(
url
);
let
res
=
await
fetch
(
this
.
props
.
submissionID
==
null
?
sub_null
:
url
this
.
props
.
outlook_pa_id
==
null
?
sub_null
:
url
)
res
=
await
res
.
blob
()
this
.
setState
({
loading
:
false
})
...
...
@@ -450,15 +446,15 @@ export default class ProfitLossOLPA extends Component {
})
})
let
payload
=
{
"
submission_id"
:
this
.
props
.
submissionID
,
"
outlook_pa_id"
:
this
.
props
.
outlook_pa_id
,
"company_id"
:
this
.
props
.
company
.
company_id
,
"periode"
:
this
.
props
.
periode
,
"report_id"
:
this
.
props
.
report_id
,
"profit_loss"
:
data
,
"status"
:
"submitted"
}
console
.
log
(
payload
)
api
.
create
().
validateSubmitReport
(
payload
).
then
((
response
)
=>
{
//
console.log(payload)
api
.
create
().
validateSubmitReport
OLPA
(
payload
).
then
((
response
)
=>
{
console
.
log
(
response
)
if
(
response
.
data
.
data
.
result
)
{
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
false
})
...
...
@@ -2158,7 +2154,7 @@ export default class ProfitLossOLPA extends Component {
<
/button
>
<
/div
>
{
this
.
props
.
isApprover
===
true
||
this
.
state
.
dataTable
.
length
==
0
?
null
:
(
this
.
props
.
lastStatus
==
'SUBMIT'
||
this
.
props
.
lastStatus
==
'REVISION'
)
&&
this
.
props
.
prevRevision
===
false
?
(
this
.
props
.
lastStatus
==
=
'SUBMIT'
||
this
.
props
.
lastStatus
===
'REVISION'
)
&&
this
.
props
.
prevRevision
===
false
&&
(
this
.
props
.
status
===
'revision'
||
this
.
props
.
status
===
'not-yet'
||
this
.
props
.
status
===
'draft'
||
this
.
props
.
status
===
'submitted'
)
?
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
<
button
className
=
"button"
...
...
@@ -2196,7 +2192,7 @@ export default class ProfitLossOLPA extends Component {
onClick
=
{()
=>
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
this
.
backTo
MasterBudget
(
'draft'
)
this
.
backTo
OLPA
(
'draft'
)
})
}
>
...
...
@@ -2212,7 +2208,7 @@ export default class ProfitLossOLPA extends Component {
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
this
.
backTo
MasterBudget
(
'submitted'
)
this
.
backTo
OLPA
(
'submitted'
)
})}
style
=
{{
backgroundColor
:
'transparent'
,
...
...
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