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
ffc48b8f
Commit
ffc48b8f
authored
Aug 26, 2020
by
EKSAD
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
budget tahunan PL
parent
8697b872
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
42 deletions
+113
-42
BudgetTahunan.js
src/container/BudgetTahunan.js
+2
-0
ProfitLoss.js
src/container/BudgetTahunan/ProfitLoss.js
+108
-39
CreateReportItems.js
...container/MasterData/formReportItems/CreateReportItems.js
+2
-2
EditReportItems.js
src/container/MasterData/formReportItems/EditReportItems.js
+1
-1
No files found.
src/container/BudgetTahunan.js
View file @
ffc48b8f
...
...
@@ -307,6 +307,8 @@ export default class BudgetTahunan extends Component {
)}
{
this
.
state
.
visiblePL
&&
(
<
ProfitLoss
report_id
=
{
this
.
state
.
report_id
}
company
=
{
this
.
state
.
company
}
onClickClose
=
{()
=>
this
.
setState
({
visiblePL
:
false
,
visibleBudgetTahunan
:
true
})}
/
>
...
...
src/container/BudgetTahunan/ProfitLoss.js
View file @
ffc48b8f
...
...
@@ -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,8 +22,102 @@ const style2 = {
};
export
default
class
ProfitLoss
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
.
company_id
}
api
.
create
().
getItemReportHierarki
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
dataTable
=
[]
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
children
.
length
>
0
)
{
dataTable
.
push
([
item
.
level
,
item
.
description
])
item
.
children
.
map
(
i
=>
{
if
(
i
.
children
)
{
if
(
i
.
children
.
length
>
0
)
{
dataTable
.
push
([
i
.
level
,
i
.
description
])
i
.
children
.
map
(
val
=>
{
dataTable
.
push
([
val
.
level
,
val
.
description
])
})
}
else
{
dataTable
.
push
([
i
.
level
,
i
.
description
])
}
}
else
{
dataTable
.
push
([
i
.
level
,
i
.
description
])
}
})
}
else
{
dataTable
.
push
([
item
.
level
,
item
.
description
])
}
})
console
.
log
(
dataTable
);
this
.
setState
({
dataTable
})
}
}
})
}
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
:
""
,
options
:
{
display
:
false
}
},
{
name
:
"Account"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
...
...
@@ -34,35 +129,18 @@ export default class ProfitLoss extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
width
:
388
}}
>
{
tableMeta
.
row
Index
==
0
?
<
span
style
=
{{
fontSize
:
12
,
fontWeight
:
'bold'
}}
>
{
val
}
<
/span
>
{
tableMeta
.
row
Data
[
0
]
==
0
?
<
span
style
=
{{
fontSize
:
12
,
fontWeight
:
'bold'
}}
>
{
String
(
val
).
toUpperCase
()
}
<
/span
>
:
tableMeta
.
row
Index
==
1
||
tableMeta
.
rowIndex
==
4
||
tableMeta
.
rowIndex
==
7
?
<
span
style
=
{{
fontSize
:
12
,
marginLeft
:
1
0
}}
>
{
val
}
<
/span>
:
<
span
style
=
{{
fontSize
:
12
,
marginLeft
:
2
0
}}
>
{
val
}
<
/span
>
tableMeta
.
row
Data
[
0
]
===
1
?
<
span
style
=
{{
fontSize
:
12
,
marginLeft
:
2
0
}}
>
{
val
}
<
/span>
:
<
span
style
=
{{
fontSize
:
12
,
marginLeft
:
4
0
}}
>
{
val
}
<
/span
>
}
<
/div
>
)
}
}
},
{
name
:
"Keterangan"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
key
=
{
columnMeta
.
index
}
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
102
,
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
setCellProps
:
()
=>
({
style
:
{
position
:
"sticky"
,
left
:
420
,
background
:
"white"
,
zIndex
:
101
}
})
}
},{
name
:
"31 Dec 2020 Actual"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
...
...
@@ -88,10 +166,9 @@ export default class ProfitLoss extends Component {
<
/TableCell
>
),
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
return
(
<
div
style
=
{{
textAlign
:
'right'
}}
>
{
tableMeta
.
rowIndex
===
2
||
tableMeta
.
rowIndex
===
3
?
{
tableMeta
.
rowIndex
===
3
||
tableMeta
.
rowIndex
===
4
||
tableMeta
.
rowIndex
===
9
?
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
...
...
@@ -116,9 +193,12 @@ export default class ProfitLoss 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
>
...
...
@@ -257,18 +337,7 @@ export default class ProfitLoss extends Component {
}
}
]
const
dataTable
=
[
[
"Ravenue"
,
""
,
"11,247,249"
,
"10,702,196"
],
[
"Unit Bisnis/ Brand/ SubCo 1"
,
""
,
"2,647,647"
,
"2,058,898"
],
[
"Sales Volume"
,
"Subco1"
,
"1,464,571"
,
"729,743"
],
[
"Sales Price"
,
"Subco1"
,
"1"
,
"6"
],
[
"Unit Bisnis/ Brand/ SubCo 2"
,
""
,
"-"
,
"-"
],
[
"Sales Volume"
,
"Subco2"
,
"-"
,
"-"
],
[
"Sales Price"
,
"Subco2"
,
"-"
,
"-"
],
[
"Unit Bisnis/ Brand/ SubCo 3"
,
""
,
"-"
,
"-"
],
[
"Sales Volume"
,
"Subco3"
,
"-"
,
"-"
],
[
"Sales Price"
,
"Subco3"
,
"-"
,
"-"
],
]
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
}}
>
...
...
@@ -281,7 +350,7 @@ export default class ProfitLoss extends Component {
<
/div
>
<
div
style
=
{{
padding
:
20
}}
>
<
div
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
PT
.
XYZ
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
{
this
.
props
.
company
.
company_name
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
Periode
:
2021
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
/div
>
...
...
@@ -289,7 +358,7 @@ export default class ProfitLoss extends Component {
<
div
style
=
{{
marginTop
:
20
,
width
:
'100%'
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
data
=
{
dataTable
}
data
=
{
this
.
state
.
dataTable
}
columns
=
{
columns
}
options
=
{
options
}
/
>
...
...
src/container/MasterData/formReportItems/CreateReportItems.js
View file @
ffc48b8f
...
...
@@ -350,7 +350,7 @@ export default class CreateReportItems extends Component {
<
div
className
=
"popup-panel grid grid-2x main-color"
style
=
{{
height
:
64
,
borderTopRightRadius
:
8
,
borderTopLeftRadius
:
8
}}
>
<
div
className
=
"col-1"
style
=
{{
maxWidth
:
"inherit"
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
className
=
"popup-title"
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
16
,
fontWeight
:
'bold'
}}
>
Add
Data
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
16
,
fontWeight
:
'bold'
}}
>
Create
Data
<
/span
>
<
/div
>
<
/div
>
<
div
className
=
"col-2 content-right"
style
=
{{
maxWidth
:
"inherit"
,
alignSelf
:
'center'
}}
>
...
...
@@ -431,7 +431,7 @@ export default class CreateReportItems extends Component {
debug
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Company"
label
=
"Company
Name
"
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
...
...
src/container/MasterData/formReportItems/EditReportItems.js
View file @
ffc48b8f
...
...
@@ -421,7 +421,7 @@ export default class EditReportItems extends Component {
debug
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Company"
label
=
"Company
Name
"
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
...
...
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