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
0acdb603
Commit
0acdb603
authored
Mar 17, 2021
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'GGMAC' into 'master'
Ggmac See merge request
!1283
parents
a86a2a06
8fe76710
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
457 additions
and
83 deletions
+457
-83
index.js
src/api/index.js
+21
-2
RollingOutlook.js
src/container/RollingOutlook.js
+56
-18
BalanceSheetRO.js
src/container/RollingOutlook/BalanceSheetRO.js
+380
-63
No files found.
src/api/index.js
View file @
0acdb603
...
...
@@ -241,12 +241,22 @@ const create = (type = "") => {
const
getLastestUpdateMROI
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/monthly_report/get_latest_update'
,
body
)
// Rolling Outlook
const
getRollingOutlookID
=
(
body
)
=>
api
.
post
(
'transaction/rolling_outlook/get_rolling_outlook_id'
,
body
)
const
getRollingOutlookID
=
(
body
)
=>
api
.
post
(
'transaction/rolling_outlook/get_monthly_report_id'
,
body
)
const
getRollingOutlookAttachment
=
(
body
)
=>
api
.
post
(
'transaction/rolling_outlook/get_report_attachment'
,
body
)
const
uploadRollingOutlookAttachment
=
(
body
)
=>
api
.
post
(
'transaction/rolling_outlook/upload_attachment'
,
body
)
const
deleteRollingOutlookAttachment
=
(
body
)
=>
api
.
post
(
`transaction/rolling_outlook/delete_attachment/
${
body
}
`
)
const
getRollingOutlookReport
=
(
body
)
=>
api
.
post
(
'transaction/rolling_outlook/get_all_report'
,
body
)
const
getRollingOutlookLastUpdate
=
(
body
)
=>
api
.
post
(
'transaction/rolling_outlook/get_latest_update'
,
body
)
const
getRollingOutlookRevision
=
(
body
)
=>
api
.
post
(
'transaction/rolling_outlook/get_revision'
,
body
)
const
getRollingOutlookIsApprover
=
(
body
)
=>
api
.
get
(
'transaction/rolling_outlook/is_approver'
)
const
getRollingOutlookBS
=
(
body
)
=>
api
.
post
(
'transaction/balance_sheet/rolling_outlook/get_report_hierarki'
,
body
)
const
checkImportRollingOutlookBS
=
(
body
)
=>
api
.
post
(
'transaction/balance_sheet/rolling_outlook/check_import'
,
body
)
const
importRollingOutlookBS
=
(
body
)
=>
api
.
post
(
'transaction/balance_sheet/rolling_outlook/import_rolling_outlook'
,
body
)
const
createRollingOutlookBS
=
(
body
)
=>
api
.
post
(
'transaction/balance_sheet/rolling_outlook/create_rolling_outlook'
,
body
)
const
getRollingOutlookPL
=
(
body
)
=>
api
.
post
(
'transaction/profit_loss/rolling_outlook/get_report_hierarki'
,
body
)
const
getRollingOutlookTP
=
(
body
)
=>
api
.
post
(
'transaction/rolling_outlook/tax_planning/get_report_hierarki'
,
body
)
//REPORT NEW
const
getAllReportBS
=
(
body
)
=>
api
.
post
(
'/transaction/db_balance_sheet/get_report_hierarki'
,
body
)
const
getReportBSMB
=
(
body
)
=>
api
.
post
(
'/transaction/db_balance_sheet/master_budget/get_report_hierarki'
,
body
)
...
...
@@ -707,7 +717,16 @@ const create = (type = "") => {
deleteMasterDataCat
,
getListChildDashboardCAT
,
getDashboardCATDetail
,
getRollingOutlookPL
getRollingOutlookPL
,
getRollingOutlookAttachment
,
uploadRollingOutlookAttachment
,
deleteRollingOutlookAttachment
,
getRollingOutlookReport
,
getRollingOutlookLastUpdate
,
getRollingOutlookRevision
,
getRollingOutlookIsApprover
,
checkImportRollingOutlookBS
,
importRollingOutlookBS
}
}
...
...
src/container/RollingOutlook.js
View file @
0acdb603
...
...
@@ -63,7 +63,14 @@ export default class RollingOutlook extends Component {
latestPeriode
:
''
,
minDateRevision
:
new
Date
(),
maxDateRevision
:
new
Date
(),
btnApprove
:
false
btnApprove
:
false
,
quarterList
:
[
{
value
:
'q1'
,
name
:
'Q1'
},
{
value
:
'q2'
,
name
:
'Q2'
},
{
value
:
'q3'
,
name
:
'Q3'
},
// {value: 'ol_pa', name: 'OL PA'},
],
quarter
:
null
}
this
.
myRef
=
React
.
createRef
()
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
...
...
@@ -74,18 +81,18 @@ export default class RollingOutlook extends Component {
componentDidMount
()
{
this
.
setState
({
loading
:
true
})
this
.
props
.
selectIndex
(
'Rolling Outlook & CAT'
)
if
(
this
.
props
.
location
.
state
!==
undefined
)
{
console
.
log
(
this
.
props
);
this
.
setState
({
userType
:
this
.
props
.
location
.
state
.
userType
,
intent
:
'Home'
,
lastPeriod
:
this
.
props
.
location
.
state
.
rawData
.
periode
,
rawData
:
this
.
props
.
location
.
state
.
rawData
},
()
=>
{
this
.
checkApprover
()
})
}
else
{
//
if (this.props.location.state !== undefined) {
//
console.log(this.props);
//
this.setState({ userType: this.props.location.state.userType, intent: 'Home', lastPeriod: this.props.location.state.rawData.periode, rawData: this.props.location.state.rawData }, () => {
//
this.checkApprover()
//
})
//
} else {
this
.
checkApprover
()
}
//
}
}
checkApprover
()
{
api
.
create
().
check
Approver
().
then
(
response
=>
{
api
.
create
().
getRollingOutlookIs
Approver
().
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
.
data
.
is_approver
===
true
)
{
this
.
setState
({
isApprover
:
true
,
checkApprover
:
true
},
()
=>
...
...
@@ -151,8 +158,9 @@ export default class RollingOutlook extends Component {
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
.
periode
,
"revision"
:
this
.
state
.
revision
.
revision
,
"quartal"
:
this
.
state
.
quarter
.
value
}
api
.
create
().
get
MasterBudgetAt
t
(
payload
).
then
(
response
=>
{
api
.
create
().
get
RollingOutlookAttachmen
t
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
...
...
@@ -168,8 +176,9 @@ export default class RollingOutlook extends Component {
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
.
periode
,
"report_type"
:
"Rolling Outlook"
,
"quartal"
:
this
.
state
.
quarter
.
value
}
api
.
create
().
getR
eportTypeBody
(
payload
).
then
(
response
=>
{
api
.
create
().
getR
ollingOutlookReport
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
...
...
@@ -209,7 +218,7 @@ export default class RollingOutlook extends Component {
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
isSubmit
:
response
.
data
.
data
.
is_can_submit
},
()
=>
{
this
.
setState
({
isSubmit
:
true
},
()
=>
{
this
.
getReport
()
this
.
getReportAttachment
()
})
...
...
@@ -327,12 +336,18 @@ export default class RollingOutlook extends Component {
options
:
periodeData
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
};
let
defaultPropsQuarter
=
{
options
:
this
.
state
.
quarterList
,
getOptionLabel
:
(
option
)
=>
option
.
name
}
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
latestPeriode
))
// console.log(data)
console
.
log
(
this
.
state
.
lastPeriod
)
// console.log(periodeData)
// console.log(index)
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
this
.
setState
({
list
Quarter
:
defaultPropsQuarter
,
quarter
:
this
.
state
.
quarterList
[
0
],
list
Periode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
if
(
this
.
state
.
isApprover
===
true
)
{
this
.
getCompanySubmitted
()
}
else
{
...
...
@@ -347,9 +362,10 @@ export default class RollingOutlook extends Component {
getRevision
()
{
let
payload
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
.
periode
"periode"
:
this
.
state
.
periode
.
periode
,
"quartal"
:
this
.
state
.
quarter
.
value
}
api
.
create
().
getRevision
(
payload
).
then
(
response
=>
{
api
.
create
().
getR
ollingOutlookR
evision
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
...
...
@@ -376,7 +392,8 @@ export default class RollingOutlook extends Component {
let
payload
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
.
periode
,
"is_approver"
:
this
.
state
.
isApprover
"is_approver"
:
this
.
state
.
isApprover
,
"quartal"
:
this
.
state
.
quarter
.
value
}
api
.
create
().
getRollingOutlookID
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
...
...
@@ -428,13 +445,13 @@ export default class RollingOutlook extends Component {
item
.
history_approval_date
]
})
this
.
setState
({
dataTableHistory
,
visibleTableHistory
:
tru
e
})
this
.
setState
({
dataTableHistory
,
visibleTableHistory
:
fals
e
})
}
})
}
approvalSubmission
(
type
)
{
this
.
scrollToMyRef
()
//
this.scrollToMyRef()
this
.
setState
({
loading
:
true
})
let
body
=
{
"approval_id"
:
this
.
props
.
location
.
state
==
undefined
?
this
.
state
.
approverID
:
this
.
state
.
rawData
.
approval_id
,
...
...
@@ -920,6 +937,21 @@ export default class RollingOutlook extends Component {
value
=
{
this
.
state
.
periode
}
/
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
Autocomplete
{...
this
.
state
.
listQuarter
}
id
=
"company"
disabled
=
{
this
.
state
.
intent
===
'Home'
?
true
:
false
}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
quarter
:
newInputValue
},
()
=>
{
this
.
setState
({
visibleTableHistory
:
false
})
this
.
getRevision
()
})}
disableClearable
style
=
{{
width
:
250
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Company"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
value
=
{
this
.
state
.
quarter
}
/
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
Autocomplete
{...
this
.
state
.
listCompany
}
...
...
@@ -1208,8 +1240,10 @@ export default class RollingOutlook extends Component {
revision
=
{
this
.
state
.
revisionTable
}
periode
=
{
this
.
state
.
periode
.
periode
}
rollingOutlookID
=
{
this
.
state
.
rollingOutlookID
}
refresh
=
{
this
.
getRollingOutlookID
.
bind
(
this
)}
onClickClose
=
{()
=>
this
.
setState
({
visibleBS
:
false
,
visibleRollingOutlook
:
true
})}
isApprover
=
{
'false'
}
quarter
=
{
this
.
state
.
quarter
.
value
}
/
>
)}
...
...
@@ -1224,6 +1258,8 @@ export default class RollingOutlook extends Component {
periode
=
{
this
.
state
.
periode
.
periode
}
rollingOutlookID
=
{
this
.
state
.
rollingOutlookID
}
onClickClose
=
{()
=>
this
.
setState
({
visiblePL
:
false
,
visibleRollingOutlook
:
true
})}
refresh
=
{
this
.
getRollingOutlookID
.
bind
(
this
)}
quarter
=
{
this
.
state
.
quarter
.
value
}
isApprover
=
{
'false'
}
/
>
)}
...
...
@@ -1239,8 +1275,10 @@ export default class RollingOutlook extends Component {
periode
=
{
this
.
state
.
periode
.
periode
}
rollingOutlookID
=
{
this
.
state
.
rollingOutlookID
}
onClickClose
=
{()
=>
this
.
setState
({
visibleTP
:
false
,
visibleRollingOutlook
:
true
})}
refresh
=
{
this
.
getRollingOutlookID
.
bind
(
this
)}
status
=
{
this
.
state
.
status
}
lastStatus
=
{
this
.
state
.
lastStatus
}
quarter
=
{
this
.
state
.
quarter
.
value
}
isApprover
=
{
'false'
}
/
>
)}
...
...
src/container/RollingOutlook/BalanceSheetRO.js
View file @
0acdb603
This diff is collapsed.
Click to expand it.
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