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
be142012
Commit
be142012
authored
Sep 22, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
belen apa tu man
parent
5340be35
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
198 additions
and
15 deletions
+198
-15
BudgetTahunan.js
src/container/BudgetTahunan.js
+36
-4
BalanceSheet.js
src/container/BudgetTahunan/BalanceSheet.js
+74
-11
CashFlow.js
src/container/BudgetTahunan/CashFlow.js
+88
-0
No files found.
src/container/BudgetTahunan.js
View file @
be142012
...
...
@@ -16,6 +16,7 @@ import UploadFile from "../library/Upload";
import
{
format
}
from
'date-fns'
;
import
Constant
from
'../library/Constant'
;
import
PropagateLoader
from
"react-spinners/PropagateLoader"
import
CashFlow
from
'./BudgetTahunan/CashFlow'
;
var
ct
=
require
(
"../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
...
...
@@ -40,6 +41,7 @@ export default class BudgetTahunan extends Component {
visiblePL
:
false
,
visibleFAM
:
false
,
visibleCAT
:
false
,
visibleCF
:
false
,
listAttachment
:
[],
visibleUpload
:
false
,
revisionTable
:
null
,
...
...
@@ -220,6 +222,7 @@ export default class BudgetTahunan extends Component {
visibleCAT
:
false
,
visibleFAM
:
false
,
visibleTP
:
false
,
visibleCF
:
false
,
})
}
else
if
(
item
===
'Profit Loss'
)
{
this
.
setState
({
...
...
@@ -228,7 +231,8 @@ export default class BudgetTahunan extends Component {
visiblePL
:
true
,
visibleCAT
:
false
,
visibleFAM
:
false
,
visibleTP
:
false
visibleTP
:
false
,
visibleCF
:
false
,
})
}
else
if
(
item
===
'Tax Planning'
)
{
this
.
setState
({
...
...
@@ -237,7 +241,8 @@ export default class BudgetTahunan extends Component {
visiblePL
:
false
,
visibleCAT
:
false
,
visibleFAM
:
false
,
visibleTP
:
true
visibleTP
:
true
,
visibleCF
:
false
,
})
}
else
if
(
item
===
'Fixed Assets Movement'
)
{
this
.
setState
({
...
...
@@ -246,7 +251,8 @@ export default class BudgetTahunan extends Component {
visiblePL
:
false
,
visibleCAT
:
false
,
visibleFAM
:
true
,
visibleTP
:
false
visibleTP
:
false
,
visibleCF
:
false
,
})
}
else
if
(
item
===
'CAT'
)
{
this
.
setState
({
...
...
@@ -255,7 +261,18 @@ export default class BudgetTahunan extends Component {
visiblePL
:
false
,
visibleCAT
:
true
,
visibleFAM
:
false
,
visibleTP
:
false
visibleTP
:
false
,
visibleCF
:
false
,
})
}
else
if
(
item
===
"Cash Flow"
){
this
.
setState
({
visibleBudgetTahunan
:
false
,
visibleBS
:
false
,
visiblePL
:
false
,
visibleCAT
:
false
,
visibleFAM
:
false
,
visibleTP
:
false
,
visibleCF
:
true
,
})
}
})
...
...
@@ -684,6 +701,21 @@ export default class BudgetTahunan extends Component {
getReport
=
{
this
.
getCompanyActive
.
bind
(
this
)}
/
>
)}
{
this
.
state
.
visibleCF
&&
(
<
CashFlow
open
=
{
this
.
props
.
open
}
report_id
=
{
this
.
state
.
report_id
}
height
=
{
this
.
props
.
height
}
width
=
{
this
.
props
.
width
}
company
=
{
this
.
state
.
company
}
revision
=
{
this
.
state
.
revisionTable
}
periode
=
{
this
.
state
.
periode
.
periode
}
submissionID
=
{
this
.
state
.
submissionID
}
saveToMasterBudget
=
{
this
.
saveToMasterBudget
.
bind
(
this
)}
onClickClose
=
{()
=>
this
.
setState
({
visibleCF
:
false
,
visibleBudgetTahunan
:
true
})}
getReport
=
{
this
.
getCompanyActive
.
bind
(
this
)}
/
>
)}
<
/div
>
);
}
...
...
src/container/BudgetTahunan/BalanceSheet.js
View file @
be142012
import
React
,
{
Component
}
from
'react'
;
import
{
Typography
,
Paper
,
createMuiTheme
,
MuiThemeProvider
,
TableCell
,
FormControlLabel
,
TextField
,
Input
,
Tooltip
,
withStyles
}
from
'@material-ui/core'
;
import
{
Typography
,
Paper
,
createMuiTheme
,
MuiThemeProvider
,
TableCell
,
FormControlLabel
,
TextField
,
Input
,
Tooltip
,
withStyles
,
Snackbar
}
from
'@material-ui/core'
;
import
MUIDataTable
from
'mui-datatables'
;
import
NumberFormat
from
'react-number-format'
;
import
api
from
'../../api'
;
import
AddIcon
from
'@material-ui/icons/Add'
;
import
{
values
}
from
'ramda'
;
import
PropagateLoader
from
"react-spinners/PropagateLoader"
import
Images
from
'../../assets/Images'
;
import
ReactTooltip
from
'react-tooltip'
;
import
UploadFile
from
"../../library/Upload"
;
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
{
Alert
}
from
'@material-ui/lab'
;
const
LightTooltip
=
withStyles
((
theme
)
=>
({
tooltip
:
{
...
...
@@ -367,6 +366,8 @@ export default class BalanceSheet extends Component {
}
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
}
`
console
.
log
(
url
);
let
res
=
await
fetch
(
`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
}
`
)
...
...
@@ -381,6 +382,53 @@ export default class BalanceSheet extends Component {
}
}
handleValidate
()
{
let
data
=
[]
console
.
log
(
this
.
state
.
dataTable
)
this
.
state
.
dataTable
.
map
(
i
=>
{
data
.
push
({
item_report_id
:
i
[
1
],
total_actual_before
:
String
(
i
[
6
]),
january
:
String
(
i
[
7
]),
february
:
String
(
i
[
8
]),
march
:
String
(
i
[
9
]),
april
:
String
(
i
[
10
]),
may
:
String
(
i
[
11
]),
june
:
String
(
i
[
12
]),
july
:
String
(
i
[
13
]),
august
:
String
(
i
[
14
]),
september
:
String
(
i
[
15
]),
october
:
String
(
i
[
16
]),
november
:
String
(
i
[
17
]),
december
:
String
(
i
[
18
]),
total_current_year
:
String
(
i
[
19
]),
total_next_year
:
String
(
i
[
20
]),
total_more_year
:
String
(
i
[
21
])
})
})
console
.
log
(
JSON
.
stringify
(
data
))
let
payload
=
{
"submission_id"
:
this
.
props
.
submissionID
,
"company_id"
:
this
.
props
.
company
.
company_id
,
"periode"
:
this
.
props
.
periode
,
"report_id"
:
this
.
props
.
report_id
,
"balance_sheet"
:
data
,
"status"
:
"submitted"
}
api
.
create
().
validateSubmitReport
(
payload
).
then
((
response
)
=>
{
console
.
log
(
response
)
if
(
response
.
data
.
data
.
result
)
{
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
true
})
}
else
{
this
.
setState
({
loading
:
false
,
buttonError
:
true
,
editable
:
true
})
}
})
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
render
()
{
let
dataTable2
=
this
.
state
.
dataTable
const
handleChange
=
(
value
,
tableMeta
,
type
)
=>
{
...
...
@@ -1847,7 +1895,12 @@ export default class BalanceSheet extends Component {
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
flex
:
1
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Pengajuan
Budget
Tahunan
<
/Typography
>
<
/div
>
{
this
.
state
.
loading
&&
loadingComponent
}
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
{
this
.
state
.
messageAlert
}
<
/Alert
>
<
/Snackbar
>
{
/* {this.state.loading && loadingComponent} */
}
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
{
this
.
state
.
visibleBalanceSheet
===
true
?
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
...
...
@@ -1915,13 +1968,14 @@ export default class BalanceSheet extends Component {
<
/div
>
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
)
}}
>
{
!
this
.
state
.
loading
&&
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
{
this
.
state
.
loading
&&
loadingComponent
}
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
data
=
{
dataTable2
}
columns
=
{
columns
}
options
=
{
options
}
/
>
<
/MuiThemeProvider>
}
<
/MuiThemeProvider
>
<
/div
>
<
/div
>
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
...
...
@@ -1985,7 +2039,7 @@ export default class BalanceSheet extends Component {
onClick
=
{()
=>
{
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
true
}
)
this
.
handleValidate
(
)
},
100
);
})
}}
...
...
@@ -1996,8 +2050,16 @@ export default class BalanceSheet extends Component {
<
/button
>
<
button
type
=
"button"
disabled
=
{
this
.
state
.
buttonError
}
onClick
=
{()
=>
this
.
backToMasterBudget
(
'submitted'
)}
// disabled={this.state.buttonError}
onClick
=
{()
=>
{
this
.
state
.
buttonError
?
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
'Data is not complete !'
,
tipeAlert
:
'warning'
,
loading
:
false
})
},
100
);
})
:
this
.
backToMasterBudget
(
'submitted'
)
}}
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
this
.
state
.
buttonError
===
true
?
'default'
:
'pointer'
,
...
...
@@ -2023,13 +2085,14 @@ export default class BalanceSheet extends Component {
<
/div
>
{
this
.
state
.
dataLoaded
&&
(
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
)
}}
>
{
!
this
.
state
.
loading
&&
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
{
this
.
state
.
loading
&&
loadingComponent
}
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
data
=
{
dataTable2
}
columns
=
{
columns
}
options
=
{
options
}
/
>
<
/MuiThemeProvider>
}
<
/MuiThemeProvider
>
<
/div
>
)}
<
/div
>
...
...
src/container/BudgetTahunan/CashFlow.js
0 → 100644
View file @
be142012
import
{
Paper
,
Typography
}
from
'@material-ui/core'
import
React
,
{
Component
}
from
'react'
import
ReactTooltip
from
'react-tooltip'
;
import
Images
from
'../../assets/Images'
;
export
default
class
CashFlow
extends
Component
{
render
()
{
return
(
<
div
style
=
{{
height
:
this
.
props
.
height
,
backgroundColor
:
'#f8f8f8'
,
marginBottom
:
100
,
minHeight
:
1000
}}
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
flex
:
1
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Pengajuan
Budget
Tahunan
<
/Typography
>
<
/div
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Budget
Tahunan
-
Cash
Flow
<
/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
}
(
rev
.{
this
.
props
.
revision
})
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
/div
>
<
div
style
=
{{
width
:
'50%'
}}
>
<
div
style
=
{{
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
<
a
data
-
tip
=
{
'Download Template'
}
data
-
for
=
"template"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
null
}
>
<
img
src
=
{
Images
.
template
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"template"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
null
}
>
<
img
src
=
{
Images
.
upload
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"upload"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
null
}
>
<
img
src
=
{
Images
.
download
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
<
/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
>
<
/Paper
>
<
/div
>
<
/div
>
)
}
}
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