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
542416fd
Commit
542416fd
authored
Aug 15, 2023
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update RO
parent
55cb53a9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
467 additions
and
266 deletions
+467
-266
BalanceSheetRO.js
src/container/RollingOutlook/BalanceSheetRO.js
+413
-266
TaxPlanningRO.js
src/container/RollingOutlook/TaxPlanningRO.js
+54
-0
No files found.
src/container/RollingOutlook/BalanceSheetRO.js
View file @
542416fd
...
@@ -457,6 +457,7 @@ export default class BalanceSheetRO extends Component {
...
@@ -457,6 +457,7 @@ export default class BalanceSheetRO extends Component {
}
}
})
})
}
}
handleValidate
()
{
handleValidate
()
{
let
err
=
false
let
err
=
false
let
kansas
=
this
.
state
.
kansas
let
kansas
=
this
.
state
.
kansas
...
@@ -495,6 +496,44 @@ export default class BalanceSheetRO extends Component {
...
@@ -495,6 +496,44 @@ export default class BalanceSheetRO extends Component {
}
}
}
}
handleValidateSimulasi
()
{
let
err
=
false
let
kansas
=
this
.
state
.
kansas
let
dataTable
=
this
.
state
.
dataTable
// console.log(this.state.dataTable)
dataTable
.
map
((
i
,
index
)
=>
{
if
(
String
(
i
[
5
])
==
"Control (should be nil)"
)
{
this
.
setState
({
loading
:
true
})
let
n
=
0
for
(
n
=
(
this
.
props
.
quarter
==
'q1'
?
10
:
(
this
.
props
.
quarter
==
'q2'
?
13
:
16
));
n
<=
18
;
n
++
)
{
if
((
Number
(
i
[
n
]).
toFixed
(
2
)
<
Number
(
this
.
state
.
minValue
)
||
Number
(
i
[
n
]).
toFixed
(
2
)
>
Number
(
this
.
state
.
maxValue
)))
{
err
=
true
}
}
}
})
console
.
log
(
err
)
if
(
err
===
false
)
{
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
false
,
saveDraft
:
false
})
if
(
kansas
==
0
)
{
this
.
setState
({
kansas
:
1
,
loading
:
true
},
()
=>
{
this
.
handleValidate
()
})
}
else
{
this
.
setState
({
kansas
:
0
})
}
}
else
{
this
.
setState
({
loading
:
false
,
buttonError
:
true
,
editable
:
true
,
saveDraft
:
true
})
if
(
kansas
==
0
)
{
this
.
setState
({
kansas
:
1
,
loading
:
true
},
()
=>
{
this
.
handleValidate
()
})
}
else
{
this
.
setState
({
kansas
:
0
})
}
}
}
closeAlert
()
{
closeAlert
()
{
this
.
setState
({
alert
:
false
})
this
.
setState
({
alert
:
false
})
}
}
...
@@ -667,7 +706,7 @@ export default class BalanceSheetRO extends Component {
...
@@ -667,7 +706,7 @@ export default class BalanceSheetRO extends Component {
this
.
props
.
refresh
()
this
.
props
.
refresh
()
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
visibleUpload
:
false
,
visibleBSRO
:
false
,
loading
:
true
,
visibleButtonUpload
:
true
})
this
.
setState
({
visibleUpload
Simulasi
:
false
,
visibleBSRO
:
false
,
loading
:
true
,
visibleButtonUpload
:
true
})
let
err
=
false
let
err
=
false
let
dataTable
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
let
dataTable
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
// if (item.type_report_id === 3) {
// if (item.type_report_id === 3) {
...
@@ -2711,7 +2750,8 @@ export default class BalanceSheetRO extends Component {
...
@@ -2711,7 +2750,8 @@ export default class BalanceSheetRO extends Component {
<
/Alert
>
<
/Alert
>
<
/Snackbar
>
<
/Snackbar
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
{
this
.
state
.
visibleBSRO
?
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
{
this
.
state
.
visibleBSRO
?
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Rolling
Outlook
-
Balance
Sheet
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Rolling
Outlook
-
Balance
Sheet
<
/Typography
>
<
/div
>
<
/div
>
...
@@ -2971,7 +3011,114 @@ export default class BalanceSheetRO extends Component {
...
@@ -2971,7 +3011,114 @@ export default class BalanceSheetRO extends Component {
<
/div
>
<
/div
>
}
}
<
/div
>
<
/div
>
<
/Paper>
:
<
/Paper
>
:
this
.
state
.
visibleButtonUpload
?
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Rolling
Outlook
-
Balance
Sheet
<
/Typography
>
<
/div
>
<
div
style
=
{{
padding
:
20
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
}}
>
<
div
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
{
this
.
props
.
company
.
company_name
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
Period
:
{
this
.
props
.
periode
}
{
String
(
this
.
props
.
quarter
).
toLocaleUpperCase
()}
(
rev
.{
this
.
props
.
revision
})
<
/Typography
>
{
this
.
props
.
defaultCurrency
.
id
===
1
?
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
:
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
USD
thousand
<
/Typography
>
}
<
/div
>
<
div
style
=
{{
width
:
'50%'
}}
/
>
{
/* </div> */
}
<
/div
>
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
)
}}
>
{
!
this
.
state
.
loading
&&
(
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
data
=
{
dataTable2
}
columns
=
{
columns
}
options
=
{
options
}
/
>
<
/MuiThemeProvider
>
)}
<
/div
>
<
/div
>
<
div
className
=
"grid grid-2x"
style
=
{{
padding
:
20
}}
>
<
div
className
=
"col-1"
style
=
{{
paddingLeft
:
0
}}
>
<
button
type
=
"button"
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
setState
({
visibleBSRO
:
true
,
visibleUpload
:
false
},
()
=>
{
this
.
handleGetFor
(
'edit'
)
})
},
100
);
})}
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
}}
>
<
div
style
=
{{
backgroundColor
:
'#019ce5'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Back
<
/Typography
>
<
/div
>
<
/button
>
<
/div
>
{
this
.
props
.
isApprover
===
true
?
<
div
className
=
"col-2"
>
<
/div>
:
<
div
className
=
""
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
,
paddingRight
:
5
}}
>
{
this
.
state
.
get_for
==
'edit'
&&
<
button
className
=
"button"
type
=
"button"
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
marginRight
:
20
}}
onClick
=
{()
=>
{
this
.
setState
({
loading
:
true
,
dataTable
:
dataTable2
},
()
=>
{
setTimeout
(()
=>
{
this
.
handleValidateSimulasi
()
},
100
);
})
}}
>
<
div
style
=
{{
backgroundColor
:
'#fff'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
border
:
'solid 1px #354960'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#354960'
,
textAlign
:
'center'
}}
>
Calculate
<
/Typography
>
<
/div
>
<
/button>
}
{
this
.
state
.
get_for
===
'edit'
&&
<
button
type
=
"button"
// disabled={this.state.buttonError}
onClick
=
{()
=>
this
.
setState
({
handleDoubleClick
:
1
,
loading
:
true
},
()
=>
{
this
.
uploadSimulasi
(
'submitted'
)
})}
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
Data
<
/Typography
>
<
/div
>
<
/button>
}
<
/div
>
}
<
/div
>
<
/Paper
>
:
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Rolling
Outlook
-
Balance
Sheet
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Rolling
Outlook
-
Balance
Sheet
<
/Typography
>
...
@@ -3181,7 +3328,7 @@ export default class BalanceSheetRO extends Component {
...
@@ -3181,7 +3328,7 @@ export default class BalanceSheetRO extends Component {
}}
}}
/
>
/
>
<
/div
>
<
/div
>
{
this
.
state
.
visibleButtonUpload
&&
{
/* {
this.state.visibleButtonUpload &&
<div style={{ display: 'flex', justifyContent: 'flex-end', margin: '0px 32px 16px' }}>
<div style={{ display: 'flex', justifyContent: 'flex-end', margin: '0px 32px 16px' }}>
<div>
<div>
<button
<button
...
@@ -3205,7 +3352,7 @@ export default class BalanceSheetRO extends Component {
...
@@ -3205,7 +3352,7 @@ export default class BalanceSheetRO extends Component {
</button>
</button>
</div>
</div>
</div>
</div>
}
}
*/
}
{
/* <div style={{ padding: '0px 30px 29px', fontSize: 17, color: 'red' }}><b>Warning:</b> Valid currency for uploading data is <b>{this.props.defaultCurrency.id == 1 ? "IDR" : "USD"}</b></div> */
}
{
/* <div style={{ padding: '0px 30px 29px', fontSize: 17, color: 'red' }}><b>Warning:</b> Valid currency for uploading data is <b>{this.props.defaultCurrency.id == 1 ? "IDR" : "USD"}</b></div> */
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
src/container/RollingOutlook/TaxPlanningRO.js
View file @
542416fd
...
@@ -1088,6 +1088,37 @@ export default class TaxPlanning extends Component {
...
@@ -1088,6 +1088,37 @@ export default class TaxPlanning extends Component {
}
}
}
}
handleValidateSimulasi
()
{
// let data = []
let
errorContrl
=
this
.
state
.
buttonError
let
editAble
=
this
.
state
.
editAble
// console.log(this.state.dataTable)
this
.
state
.
dataTable
.
map
((
i
,
index
)
=>
{
if
(
String
(
i
[
8
])
==
"Control (should be nil)"
)
{
this
.
setState
({
loading
:
true
})
let
n
=
0
for
(
n
=
(
this
.
props
.
quarter
==
'q1'
?
12
:
(
this
.
props
.
quarter
==
'q2'
?
15
:
18
));
n
<=
20
;
n
++
)
{
if
((
Number
(
i
[
n
].
tbf
.
value
)
<
Number
(
this
.
state
.
minValue
)
||
Number
(
i
[
n
].
tbf
.
value
)
>
Number
(
this
.
state
.
maxValue
)))
{
errorContrl
=
true
editAble
=
true
break
}
else
{
errorContrl
=
false
editAble
=
false
}
}
}
})
console
.
log
(
errorContrl
)
console
.
log
(
editAble
)
if
(
errorContrl
===
false
&&
editAble
===
false
)
{
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
false
,
saveDraft
:
false
})
}
else
{
this
.
setState
({
loading
:
false
,
buttonError
:
true
,
editable
:
true
,
saveDraft
:
false
})
}
}
downloadTemplate
=
async
()
=>
{
downloadTemplate
=
async
()
=>
{
let
url
=
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/tax_planning/rolling_outlook/download_template?report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&quartal=
${
this
.
props
.
quarter
}
&¤cy_id=
${
this
.
props
.
defaultCurrency
.
id
}
`
let
url
=
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/tax_planning/rolling_outlook/download_template?report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&quartal=
${
this
.
props
.
quarter
}
&¤cy_id=
${
this
.
props
.
defaultCurrency
.
id
}
`
console
.
log
(
url
);
console
.
log
(
url
);
...
@@ -6607,6 +6638,29 @@ export default class TaxPlanning extends Component {
...
@@ -6607,6 +6638,29 @@ export default class TaxPlanning extends Component {
<
/button
>
<
/button
>
<
/div
>
<
/div
>
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
<
button
className
=
"button"
type
=
"button"
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
marginRight
:
20
}}
onClick
=
{()
=>
{
// this.forceUpdate()
this
.
setState
({
loading
:
true
,
buttonDraft
:
false
},
()
=>
{
setTimeout
(()
=>
{
this
.
handleValidateSimulasi
()
},
100
);
})
}}
>
<
div
style
=
{{
backgroundColor
:
'#fff'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
border
:
'solid 1px #354960'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#354960'
,
textAlign
:
'center'
}}
>
Calculate
<
/Typography
>
<
/div
>
<
/button
>
<
button
<
button
type
=
"button"
type
=
"button"
// disabled={this.state.buttonError}
// disabled={this.state.buttonError}
...
...
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