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
22169fb5
Commit
22169fb5
authored
Aug 24, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'deni-dev(pc)' into 'master'
Deni dev(pc) See merge request
!153
parents
1222eb09
e96a9b3e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
126 additions
and
40 deletions
+126
-40
BudgetTahunan.js
src/container/BudgetTahunan.js
+73
-22
BalanceSheet.js
src/container/BudgetTahunan/BalanceSheet.js
+51
-16
Parameter.js
src/container/MasterData/Parameter/Parameter.js
+1
-1
UnitBisnis.js
src/container/MasterData/UnitBisnis.js
+1
-1
No files found.
src/container/BudgetTahunan.js
View file @
22169fb5
...
...
@@ -3,6 +3,9 @@ import { Typography, Paper, TextField, MenuItem } from '@material-ui/core';
import
MUIDataTable
from
'mui-datatables'
;
import
Images
from
'../assets/Images'
;
import
BalanceSheet
from
'./BudgetTahunan/BalanceSheet'
;
import
api
from
'../api'
;
import
Autocomplete
from
'@material-ui/lab/Autocomplete'
;
import
{
titleCase
}
from
'../library/Utils'
;
import
ProfitLoss
from
'./BudgetTahunan/ProfitLoss'
;
export
default
class
BudgetTahunan
extends
Component
{
...
...
@@ -14,19 +17,68 @@ export default class BudgetTahunan extends Component {
revisi
:
'0'
,
visibleBudgetTahunan
:
true
,
visibleBS
:
false
,
listCompany
:
null
,
company
:
null
,
report_id
:
null
,
visiblePL
:
false
}
}
clickDetail
(
item
){
componentDidMount
()
{
this
.
getCompanyActive
()
this
.
getReport
()
}
getReport
()
{
api
.
create
().
getReportType
().
then
(
response
=>
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
dataTable
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
return
[
index
+
1
,
item
.
report_name
,
""
,
item
.
report_id
]
})
this
.
setState
({
dataTable
})
}
}
})
}
getCompanyActive
()
{
api
.
create
().
getPerusahaanActive
().
then
((
response
)
=>
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
companyData
=
data
.
map
((
item
)
=>
{
return
{
company_id
:
item
.
company_id
,
company_name
:
item
.
company_name
,
}
})
let
defaultProps
=
{
options
:
companyData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
};
this
.
setState
({
listCompany
:
defaultProps
,
company
:
companyData
[
0
]
})
}
else
{
alert
(
response
.
data
.
message
)
}
})
}
clickDetail
(
item
,
id
)
{
this
.
setState
({
report_id
:
id
})
if
(
item
===
'Balance Sheet'
)
{
this
.
setState
({
visibleBudgetTahunan
:
false
,
this
.
setState
({
visibleBudgetTahunan
:
false
,
visibleBS
:
true
,
visiblePL
:
false
,
visibleCAT
:
false
,
visibleFAM
:
false
,
visibleTP
:
false
visibleTP
:
false
,
})
}
else
if
(
item
===
'Profit & Loss'
)
{
this
.
setState
({
...
...
@@ -49,7 +101,7 @@ export default class BudgetTahunan extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
val
==
'done'
?
{
val
==
=
"acc"
?
<
img
src
=
{
Images
.
ceklis
}
style
=
{{
width
:
31
,
height
:
24
}}
/>
:
null
}
...
...
@@ -70,7 +122,7 @@ export default class BudgetTahunan extends Component {
cursor
:
'pointer'
,
borderColor
:
'transparent'
}}
onClick
=
{()
=>
this
.
clickDetail
(
tableMeta
.
rowData
[
1
])}
onClick
=
{()
=>
this
.
clickDetail
(
tableMeta
.
rowData
[
1
]
,
tableMeta
.
rowData
[
3
]
)}
>
<
Typography
style
=
{{
color
:
'#5198ea'
,
fontSize
:
12
,
}}
>
Detail
<
/Typography
>
<
/button
>
...
...
@@ -156,20 +208,16 @@ export default class BudgetTahunan extends Component {
<
/TextField
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
TextField
style
=
{{
width
:
250
,
}}
id
=
"perusahaan"
select
label
=
"Perusahaan"
value
=
{
this
.
state
.
perusahaan
}
onChange
=
{(
e
)
=>
this
.
setState
({
perusahaan
:
e
.
target
.
value
})}
>
{
perusahaan
.
map
((
option
)
=>
(
<
MenuItem
key
=
{
option
.
value
}
value
=
{
option
.
value
}
>
{
option
.
label
}
<
/MenuItem
>
))}
<
/TextField
>
<
Autocomplete
{...
this
.
state
.
listCompany
}
id
=
"company"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
})}
debug
disableClearable
style
=
{{
width
:
250
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Company"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
value
=
{
this
.
state
.
company
}
/
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
TextField
...
...
@@ -190,7 +238,7 @@ export default class BudgetTahunan extends Component {
<
div
style
=
{{
marginTop
:
20
}}
>
<
MUIDataTable
data
=
{
dataTable
}
data
=
{
this
.
state
.
dataTable
}
columns
=
{
columns
}
options
=
{
options
}
/
>
...
...
@@ -226,7 +274,10 @@ export default class BudgetTahunan extends Component {
)}
{
this
.
state
.
visibleBS
&&
(
<
BalanceSheet
/>
<
BalanceSheet
report_id
=
{
this
.
state
.
report_id
}
company_id
=
{
this
.
state
.
company
.
company_id
}
/
>
)}
{
this
.
state
.
visiblePL
&&
(
<
ProfitLoss
/>
...
...
src/container/BudgetTahunan/BalanceSheet.js
View file @
22169fb5
...
...
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
import
{
Typography
,
Paper
,
createMuiTheme
,
MuiThemeProvider
,
TableCell
,
FormControlLabel
,
TextField
,
Input
}
from
'@material-ui/core'
;
import
MUIDataTable
from
'mui-datatables'
;
import
NumberFormat
from
'react-number-format'
;
import
api
from
'../../api'
;
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
...
...
@@ -21,6 +22,49 @@ const style2 = {
};
export
default
class
BalanceSheet
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
dataTable
:
[
[
"TOTAL ASSETS"
,
"11,247,249"
,
"10,702,196"
],
[
"TOTAL CURRENT ASSETS"
,
"2,647,647"
,
"2,058,898"
],
[
"Cash & Cash Equivalent"
,
"1,464,571"
,
"729,743"
],
[
"Cash & Bank Balance"
,
"938,707"
,
"265,584"
],
[
"Time & Call Deposit"
,
"525,864"
,
"464,159"
],
[
"BI Deposit"
,
""
,
""
],
[
"Marketable Securities"
,
"150,250"
,
"154,500"
],
[
"Notes Receivable"
,
""
,
""
],
[
"Accounts Receivable"
,
"172,031"
,
"97,112"
],
[
"Trade Receivables - Third Party"
,
"142,668"
,
"77,480"
],
]
}
}
componentDidMount
(){
this
.
getItemHierarki
()
console
.
log
(
this
.
props
);
}
getItemHierarki
(){
let
payload
=
{
"report_id"
:
this
.
props
.
report_id
,
"company_id"
:
this
.
props
.
company_id
}
api
.
create
().
getItemReportHierarki
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
})
}
handleChange
(
value
,
tableMeta
)
{
let
data
=
this
.
state
.
dataTable
let
a
=
data
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
value
this
.
setState
({
data
:
a
},
()
=>
console
.
log
(
this
.
state
.
dataTable
))
// let a = data[0].tableMeta.tableData[tableMeta.rowIndex] === value
// console.log(data)
}
render
()
{
const
columns
=
[{
name
:
"Account"
,
...
...
@@ -71,7 +115,6 @@ export default class BalanceSheet extends Component {
<
/TableCell
>
),
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
return
(
<
div
style
=
{{
textAlign
:
'right'
}}
>
{
tableMeta
.
rowIndex
===
3
||
tableMeta
.
rowIndex
===
4
||
tableMeta
.
rowIndex
===
9
?
...
...
@@ -99,9 +142,12 @@ export default class BalanceSheet extends Component {
type
=
"text"
placeholder
=
""
value
=
{
value
}
onChange
=
{
event
=>
{
updateValue
(
event
.
target
.
value
)
this
.
handleChange
(
event
.
target
.
value
,
tableMeta
)
}}
/
>
}
onChange
=
{
event
=>
updateValue
(
event
.
target
.
value
)}
/
>
<
/div>
:
<
span
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
}}
>
{
value
===
""
?
"-"
:
value
}
<
/span
>
...
...
@@ -240,18 +286,7 @@ export default class BalanceSheet extends Component {
}
}
]
const
dataTable
=
[
[
"TOTAL ASSETS"
,
"11,247,249"
,
"10,702,196"
],
[
"TOTAL CURRENT ASSETS"
,
"2,647,647"
,
"2,058,898"
],
[
"Cash & Cash Equivalent"
,
"1,464,571"
,
"729,743"
],
[
"Cash & Bank Balance"
,
"938,707"
,
"265584"
],
[
"Time & Call Deposit"
,
"525,864"
,
"464,159"
],
[
"BI Deposit"
,
""
,
""
],
[
"Marketable Securities"
,
"150,250"
,
"154,500"
],
[
"Notes Receivable"
,
""
,
""
],
[
"Accounts Receivable"
,
"172,031"
,
"97,112"
],
[
"Trade Receivables - Third Party"
,
"142,668"
,
"77,480"
],
]
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
}}
>
...
...
@@ -272,7 +307,7 @@ export default class BalanceSheet extends Component {
<
div
style
=
{{
marginTop
:
20
,
width
:
'100%'
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
data
=
{
dataTable
}
data
=
{
this
.
state
.
dataTable
}
columns
=
{
columns
}
options
=
{
options
}
/
>
...
...
@@ -285,7 +320,7 @@ export default class BalanceSheet extends Component {
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Kembali
<
/Typography
>
<
/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%'
}}
>
<
div
style
=
{{
backgroundColor
:
'#fff'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
border
:
'solid 1px #354960'
,
marginRight
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#354960'
,
textAlign
:
'center'
}}
>
Batal
<
/Typography
>
<
/div
>
...
...
src/container/MasterData/Parameter/Parameter.js
View file @
22169fb5
...
...
@@ -665,7 +665,7 @@ export default class Parameter extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
10
]
===
"Aktif"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
===
"Aktif"
?
"Active"
:
"Inactive"
}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
10
]
===
"Aktif"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
);
}
...
...
src/container/MasterData/UnitBisnis.js
View file @
22169fb5
...
...
@@ -379,7 +379,7 @@ export default class UnitBisnis extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
3
]
===
"Aktif"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
===
"Aktif"
?
"Active"
:
"Inactive"
}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
3
]
===
"Aktif"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/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