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
0835644c
Commit
0835644c
authored
Oct 05, 2020
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'didam' into 'master'
apdet See merge request
!456
parents
409a1d85
675a1ea3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
21 deletions
+51
-21
index.js
src/api/index.js
+3
-1
BudgetTahunan.js
src/container/BudgetTahunan.js
+48
-20
No files found.
src/api/index.js
View file @
0835644c
...
...
@@ -206,6 +206,7 @@ const create = (type = "") => {
const
getCompanySubmitted
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/get_company_submitted'
,
body
)
const
getLastPeriod
=
(
idCompany
)
=>
api
.
get
(
`transaction/master_budget/get_last_periode/
${
idCompany
}
`
)
const
getSubmitMasterBudget
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/get_latest_periode_submit'
,
body
)
const
createPeriodeRevision
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/create_periode_revision'
,
body
)
const
getIdDeleteFromExcel
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/delete_from_excel'
,
body
)
const
getOpetratingIndID
=
(
body
)
=>
api
.
post
(
'transaction/get_operating_indicator_id'
,
body
)
...
...
@@ -371,7 +372,8 @@ const create = (type = "") => {
approvalSubmission
,
getCompanySubmitted
,
getLastPeriod
,
getSubmitMasterBudget
getSubmitMasterBudget
,
createPeriodeRevision
}
}
...
...
src/container/BudgetTahunan.js
View file @
0835644c
...
...
@@ -18,6 +18,7 @@ import Constant from '../library/Constant';
import
PropagateLoader
from
"react-spinners/PropagateLoader"
import
CashFlow
from
'./BudgetTahunan/CashFlow'
;
import
{
DatePicker
}
from
'@material-ui/pickers'
;
import
moment
from
'moment'
;
var
ct
=
require
(
"../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
...
...
@@ -62,7 +63,9 @@ export default class BudgetTahunan extends Component {
lastRevision
:
""
,
checkApprover
:
false
,
lastPeriod
:
''
,
latestPeriode
:
''
latestPeriode
:
''
,
minDateRevision
:
new
Date
(),
maxDateRevision
:
new
Date
()
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
}
...
...
@@ -423,11 +426,20 @@ export default class BudgetTahunan extends Component {
"status"
:
type
,
"detail"
:
this
.
state
.
detailRevisiCheck
}
let
payload
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"min_periode"
:
moment
(
this
.
state
.
minDateRevision
).
format
(
'YYYY-MM-DD'
),
"max_periode"
:
moment
(
this
.
state
.
maxDateRevision
).
format
(
'YYYY-MM-DD'
)
}
console
.
log
(
payload
)
api
.
create
().
approvalSubmission
(
body
).
then
((
res
)
=>
{
console
.
log
(
res
)
this
.
setState
({
loading
:
false
},
()
=>
{
this
.
getSubmission
()
})
if
(
type
==
'revision'
)
{
api
.
create
().
createPeriodeRevision
(
payload
).
then
((
res
)
=>
console
.
log
(
res
))
}
})
}
...
...
@@ -641,6 +653,21 @@ export default class BudgetTahunan extends Component {
}
validateRevision
()
{
let
arrayRevisi
=
this
.
state
.
detailRevisiCheck
let
remarksKosong
=
0
arrayRevisi
.
map
((
item
,
index
)
=>
{
if
(
item
.
remarks
==
""
)
{
remarksKosong
+=
1
}
})
if
(
remarksKosong
>
0
)
{
this
.
setState
({
alert
:
true
,
messageAlert
:
'Remarks Cannot be Empty'
,
tipeAlert
:
'error'
})
}
else
{
this
.
setState
({
visibleRevision
:
false
},
()
=>
this
.
approvalSubmission
(
'revision'
))
}
}
render
()
{
const
columns
=
[
"#"
,
"Report Type"
,
{
...
...
@@ -712,21 +739,20 @@ export default class BudgetTahunan extends Component {
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
t
his
.
state
.
isSubmit
===
false
?
'default'
:
t
ableMeta
.
rowData
[
5
]
?
'pointer'
:
'default'
,
cursor
:
tableMeta
.
rowData
[
5
]
?
'pointer'
:
'default'
,
borderColor
:
'transparent'
}}
onClick
=
{()
=>
this
.
state
.
isSubmit
===
false
?
null
:
// tableMeta.rowData[5] == true ?
this
.
clickDetail
(
tableMeta
.
rowData
[
1
],
tableMeta
.
rowData
[
4
],
tableMeta
.
rowData
[
2
],
tableMeta
.
rowData
[
3
])
// : null
// tableMeta.rowData[5] == true ?
this
.
clickDetail
(
tableMeta
.
rowData
[
1
],
tableMeta
.
rowData
[
4
],
tableMeta
.
rowData
[
2
],
tableMeta
.
rowData
[
3
])
// : null
}
>
{
/* {this.state.isApprover == true ?
(tableMeta.rowData[5] ? '#5198ea' : 'GrayText') :
(this.state.lastRevision == 0 ? (tableMeta.rowData[5] ? '#5198ea' : 'GrayText') :
(tableMeta.rowData[3] !== 'submitted' ? '#5198ea' : 'GrayText'))} */
}
<
Typography
style
=
{{
color
:
t
his
.
state
.
isSubmit
===
false
?
'GrayText'
:
t
ableMeta
.
rowData
[
5
]
?
'#5198ea'
:
'GrayText'
,
fontSize
:
12
,
}}
>
Detail
<
/Typography
>
<
Typography
style
=
{{
color
:
tableMeta
.
rowData
[
5
]
?
'#5198ea'
:
'GrayText'
,
fontSize
:
12
,
}}
>
Detail
<
/Typography
>
<
/button
>
<
/div
>
);
...
...
@@ -1196,7 +1222,7 @@ export default class BudgetTahunan extends Component {
getReport
=
{
this
.
getSubmission
.
bind
(
this
)}
isApprover
=
{
this
.
state
.
isApprover
}
lastStatus
=
{
this
.
state
.
lastStatus
}
prevRevision
=
{
this
.
state
.
prevRevision
}
prevRevision
=
{
this
.
state
.
isSubmit
?
this
.
state
.
prevRevision
:
true
}
status
=
{
this
.
state
.
status
}
/
>
)}
...
...
@@ -1216,9 +1242,8 @@ export default class BudgetTahunan extends Component {
status
=
{
this
.
state
.
status
}
isApprover
=
{
this
.
state
.
isApprover
}
lastStatus
=
{
this
.
state
.
lastStatus
}
prevRevision
=
{
this
.
state
.
prevRevision
}
prevRevision
=
{
this
.
state
.
isSubmit
?
this
.
state
.
prevRevision
:
true
}
/
>
)}
{
this
.
state
.
visibleTP
&&
(
<
TaxPlanning
...
...
@@ -1236,7 +1261,7 @@ export default class BudgetTahunan extends Component {
status
=
{
this
.
state
.
status
}
isApprover
=
{
this
.
state
.
isApprover
}
lastStatus
=
{
this
.
state
.
lastStatus
}
prevRevision
=
{
this
.
state
.
prevRevision
}
prevRevision
=
{
this
.
state
.
isSubmit
?
this
.
state
.
prevRevision
:
true
}
/
>
)}
{
this
.
state
.
visibleFAM
&&
(
...
...
@@ -1255,7 +1280,7 @@ export default class BudgetTahunan extends Component {
status
=
{
this
.
state
.
status
}
isApprover
=
{
this
.
state
.
isApprover
}
lastStatus
=
{
this
.
state
.
lastStatus
}
prevRevision
=
{
this
.
state
.
prevRevision
}
prevRevision
=
{
this
.
state
.
isSubmit
?
this
.
state
.
prevRevision
:
true
}
/
>
)}
{
this
.
state
.
visibleCAT
&&
(
...
...
@@ -1274,7 +1299,7 @@ export default class BudgetTahunan extends Component {
isApprover
=
{
this
.
state
.
isApprover
}
status
=
{
this
.
state
.
status
}
lastStatus
=
{
this
.
state
.
lastStatus
}
prevRevision
=
{
this
.
state
.
prevRevision
}
prevRevision
=
{
this
.
state
.
isSubmit
?
this
.
state
.
prevRevision
:
true
}
/
>
)}
{
this
.
state
.
visibleCF
&&
(
...
...
@@ -1290,7 +1315,7 @@ export default class BudgetTahunan extends Component {
saveToMasterBudget
=
{
this
.
saveToMasterBudget
.
bind
(
this
)}
onClickClose
=
{()
=>
this
.
setState
({
visibleCF
:
false
,
visibleBudgetTahunan
:
true
})}
getReport
=
{
this
.
getSubmission
.
bind
(
this
)}
prevRevision
=
{
this
.
state
.
prevRevision
}
prevRevision
=
{
this
.
state
.
isSubmit
?
this
.
state
.
prevRevision
:
true
}
/
>
)}
...
...
@@ -1314,7 +1339,7 @@ export default class BudgetTahunan extends Component {
<
/div
>
<
/div
>
<
div
className
=
"border-bottom"
style
=
{{
padding
:
20
}}
>
<
span
>
Anda
meminta
anak
perusahaan
untuk
melakukan
revisi
.
<
/span
>
<
span
>
You
ask
your
subsidiary
to
make
a
revision
<
/span
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
...
...
@@ -1325,7 +1350,7 @@ export default class BudgetTahunan extends Component {
<
/MuiThemeProvider
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
span
>
Durasi
waktu
yang
anda
berikan
untuk
revisi
:
<
/span
>
<
span
>
Timing
duration
you
give
for
revision
:
<
/span
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
,
marginTop
:
20
}}
>
<
div
>
<
DatePicker
...
...
@@ -1333,7 +1358,8 @@ export default class BudgetTahunan extends Component {
id
=
"startDate"
label
=
"Valid From"
format
=
"dd-MM-yyyy"
onChange
=
{(
e
)
=>
null
}
onChange
=
{(
e
)
=>
this
.
setState
({
minDateRevision
:
moment
(
e
).
format
(
'YYYY/MM/DD'
)})}
value
=
{
moment
(
this
.
state
.
minDateRevision
).
format
(
'YYYY/MM/DD'
)}
KeyboardButtonProps
=
{{
'aria-label'
:
'change date'
,
}}
...
...
@@ -1352,14 +1378,16 @@ export default class BudgetTahunan extends Component {
style
=
{{
padding
:
0
,
margin
:
0
,
width
:
'100%'
}}
/
>
<
/div
>
<
span
style
=
{{
alignSelf
:
'center'
}}
>
Sampai
dengan
<
/span
>
<
span
style
=
{{
alignSelf
:
'center'
}}
>
Until
<
/span
>
<
div
>
<
DatePicker
margin
=
"normal"
id
=
"startDate"
label
=
"Valid To"
format
=
"dd-MM-yyyy"
onChange
=
{(
e
)
=>
null
}
onChange
=
{(
e
)
=>
this
.
setState
({
maxDateRevision
:
moment
(
e
).
format
(
'YYYY/MM/DD'
)})}
minDate
=
{
moment
(
this
.
state
.
minDateRevision
).
format
(
'YYYY/MM/DD'
)}
value
=
{
moment
(
this
.
state
.
maxDateRevision
).
format
(
'YYYY/MM/DD'
)}
KeyboardButtonProps
=
{{
'aria-label'
:
'change date'
,
}}
...
...
@@ -1395,7 +1423,7 @@ export default class BudgetTahunan extends Component {
<
div
className
=
"column-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
alignItems
:
'center'
}}
>
<
button
type
=
"button"
onClick
=
{()
=>
this
.
setState
({
visibleRevision
:
false
},
()
=>
this
.
approvalSubmission
(
'revision'
)
)}
onClick
=
{()
=>
this
.
validateRevision
(
)}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Revision
<
/span
>
...
...
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