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
5eba227a
Commit
5eba227a
authored
Dec 17, 2020
by
rifkaki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into rifka
parents
51691d8d
2caef293
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1283 additions
and
28 deletions
+1283
-28
SummaryBS.js
src/container/Laporan/SummaryBS.js
+591
-0
SummaryPL.js
src/container/Laporan/SummaryPL.js
+646
-0
BalanceSheetMR.js
src/container/MonthlyReport/BalanceSheetMR.js
+26
-15
ProfitLossMR.js
src/container/MonthlyReport/ProfitLossMR.js
+20
-13
No files found.
src/container/Laporan/SummaryBS.js
0 → 100644
View file @
5eba227a
import
React
,
{
Component
}
from
'react'
;
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'
;
import
*
as
R
from
'ramda'
;
const
LightTooltip
=
withStyles
((
theme
)
=>
({
tooltip
:
{
backgroundColor
:
theme
.
palette
.
common
.
white
,
color
:
'rgba(0, 0, 0, 0.87)'
,
boxShadow
:
theme
.
shadows
[
1
],
fontSize
:
11
,
},
}))(
Tooltip
);
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable3
());
const
options
=
ct
.
customOptionsFixedColumn
();
const
style
=
{
position
:
"sticky"
,
left
:
0
,
zIndex
:
101
,
background
:
"white"
,
};
const
style2
=
{
position
:
"sticky"
,
background
:
"white"
,
zIndex
:
100
,
top
:
0
};
export
default
class
SummaryBS
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
dataTable
:
[],
loading
:
false
,
}
}
componentDidMount
()
{
// this.getItemHierarki()
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
render
()
{
const
columnSummaryBS
=
[
{
name
:
"Account"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
key
=
{
columnMeta
.
index
}
style
=
{{
...
style
,
top
:
0
,
zIndex
:
103
,
backgroundColor
:
'#1c71b8'
,
width
:
300
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'left'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
setCellProps
:
()
=>
({
style
}),
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
width
:
300
}}
>
{
tableMeta
.
rowData
[
4
]
==
0
?
<
span
style
=
{{
fontSize
:
12
,
fontWeight
:
'bold'
}}
>
{
String
(
tableMeta
.
rowData
[
0
]
===
4
?
""
:
val
).
toUpperCase
()}
<
/span
>
:
<
div
style
=
{{
paddingLeft
:
20
*
Number
(
tableMeta
.
rowData
[
4
])
}}
>
<
span
style
=
{{
fontSize
:
12
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
?
""
:
val
}
<
/span
>
<
/div
>
}
<
/div
>
)
}
}
},
{
name
:
`MTD 2021`
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
th
style
=
{{
...
style2
,
color
:
'#000'
,
backgroundColor
:
'#07a7d0'
,
top
:
0
,
zIndex
:
102
,
fontSize
:
13
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
,
padding
:
0
}}
>
{
/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> */
}
<
div
style
=
{{
borderBottom
:
"1px #fff solid"
,
backgroundColor
:
'#1c71b8'
,
textAlign
:
'center'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
padding
:
5
}}
>
{
columnMeta
.
name
}
<
/div
>
<
div
className
=
"grid grid-2x"
style
=
{{
...
style2
,
color
:
'#000'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
position
:
"sticky"
}}
>
<
div
className
=
"column-1 grid grid-4x"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
backgroundColor
:
'rgb(200 224 229)'
}}
>
<
div
className
=
"column-1"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'#07a7d0'
}}
>
<
span
>
{
"Last Month"
}
<
/span
>
<
/div
>
<
div
className
=
"column-2"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'#07a7d0'
}}
>
<
span
>
{
"Actual"
}
<
/span
>
<
/div
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'rgb(200 224 229)'
}}
>
<
span
>
{
"MB"
}
<
/span
>
<
/div
>
<
div
className
=
"column-4"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'rgb(200 224 229)'
}}
>
<
span
>
{
"% of MB"
}
<
/span
>
<
/div
>
<
/div
>
<
div
className
=
"column-2 grid grid-3x"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
backgroundColor
:
'rgb(200 224 229)'
}}
>
<
div
className
=
"column-1"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'rgb(200 224 229)'
}}
>
<
span
>
{
"OL"
}
<
/span
>
<
/div
>
<
div
className
=
"column-2"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'rgb(200 224 229)'
}}
>
<
span
>
{
"% of OL"
}
<
/span
>
<
/div
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'#07a7d0'
}}
>
<
span
>
{
"Last Year"
}
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/th
>
),
setCellProps
:
()
=>
({
style2
}),
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
console
.
log
(
tableMeta
)
return
(
<
div
>
<
div
className
=
"grid grid-2x content-center"
>
<
div
className
=
"grid grid-4x content-center"
>
<
div
className
=
"col-1"
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
tableMeta
.
rowData
[
0
]
===
1
?
null
:
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
1
).
toFixed
(
1
)}
/
>
}
/
>
<
/div
>
}
<
/div
>
<
div
className
=
"col-2"
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
tableMeta
.
rowData
[
0
]
===
1
?
null
:
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
2
).
toFixed
(
1
)}
/
>
}
/
>
<
/div
>
}
<
/div
>
<
div
className
=
"col-3"
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
tableMeta
.
rowData
[
0
]
===
1
?
null
:
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
3
).
toFixed
(
1
)}
/
>
}
/
>
<
/div
>
}
<
/div
>
<
div
className
=
"col-4"
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
tableMeta
.
rowData
[
0
]
===
1
?
null
:
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
4
).
toFixed
(
1
)}
/
>
}
/
>
<
/div
>
}
<
/div
>
<
/div
>
<
div
className
=
"grid grid-3x content-center"
>
<
div
className
=
"col-1"
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
tableMeta
.
rowData
[
0
]
===
1
?
null
:
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
5
).
toFixed
(
1
)}
/
>
}
/
>
<
/div
>
}
<
/div
>
<
div
className
=
"col-2"
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
tableMeta
.
rowData
[
0
]
===
1
?
null
:
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
6
).
toFixed
(
1
)}
/
>
}
/
>
<
/div
>
}
<
/div
>
<
div
className
=
"col-3"
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
tableMeta
.
rowData
[
0
]
===
1
?
null
:
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
7
).
toFixed
(
1
)}
/
>
}
/
>
<
/div
>
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)
}
}
},
{
name
:
"2022"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
th
style
=
{{
...
style2
,
color
:
'#fff'
,
backgroundColor
:
'#07a7d0'
,
fontSize
:
13
,
top
:
0
,
zIndex
:
102
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
,
padding
:
0
}}
>
{
/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> */
}
<
div
style
=
{{
borderBottom
:
"1px #fff solid"
,
backgroundColor
:
'#1c71b8'
,
textAlign
:
'center'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
padding
:
5
}}
>
{
columnMeta
.
name
}
<
/div
>
<
div
className
=
"grid grid-1x"
style
=
{{
...
style2
,
color
:
'#fff'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
position
:
"sticky"
}}
>
<
div
className
=
"column-1"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
<
span
>
{
"ForeCast"
}
<
/span
>
<
/div
>
<
/div
>
<
/th
>
),
setCellProps
:
()
=>
({
style2
}),
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
textAlign
:
'right'
}}
>
<
/div
>
)
}
}
},
{
name
:
"2023"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
th
style
=
{{
...
style2
,
color
:
'#fff'
,
backgroundColor
:
'#07a7d0'
,
fontSize
:
13
,
top
:
0
,
zIndex
:
102
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
,
padding
:
0
}}
>
{
/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> */
}
<
div
style
=
{{
borderBottom
:
"1px #fff solid"
,
backgroundColor
:
'#1c71b8'
,
textAlign
:
'center'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
padding
:
5
}}
>
{
columnMeta
.
name
}
<
/div
>
<
div
className
=
"grid grid-1x"
style
=
{{
...
style2
,
color
:
'#fff'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
position
:
"sticky"
}}
>
<
div
className
=
"column-1"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
<
span
>
{
"ForeCast"
}
<
/span
>
<
/div
>
<
/div
>
<
/th
>
),
setCellProps
:
()
=>
({
style2
}),
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
textAlign
:
'right'
}}
>
<
/div
>
)
}
}
}
]
let
datas
=
[
[
"ABCD"
,
{
a
:
"0"
,
b
:
"0"
,
c
:
"0"
,
d
:
"0"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
}],
[
"Total Assets"
,
{
a
:
"6"
,
b
:
"7"
,
c
:
"8"
,
d
:
"9"
},
{
a
:
"6"
,
b
:
"7"
,
c
:
"8"
,
d
:
"9"
},
{
a
:
"6"
,
b
:
"7"
,
c
:
"8"
,
d
:
"9"
},
{
a
:
"6"
,
b
:
"7"
,
c
:
"8"
,
d
:
"9"
},
{
a
:
"6"
,
b
:
"7"
,
c
:
"8"
,
d
:
"9"
},
{
a
:
"6"
,
b
:
"7"
,
c
:
"8"
,
d
:
"9"
}]
]
const
loadingComponent
=
(
<
div
style
=
{{
position
:
'absolute'
,
zIndex
:
110
,
top
:
0
,
left
:
0
,
width
:
'100%'
,
height
:
'100%'
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
background
:
'rgba(255,255,255,0.8)'
}}
>
<
PropagateLoader
// css={override}
size
=
{
20
}
color
=
{
"#274B80"
}
loading
=
{
this
.
state
.
loading
}
/
>
<
/div
>
);
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'
}}
>
FINANCIAL
SUMMARY
OF
TRIPUTRA
GROUP
<
/Typography
>
<
/div
>
<
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.visibleTP === true ? */
}
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Historical
<
/Typography
>
<
/div
>
<
div
style
=
{{
padding
:
20
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
}}
>
<
div
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
Historical
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
Period
:
2021
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
/div
>
<
div
style
=
{{
width
:
'50%'
}}
>
{
this
.
state
.
dataTable
.
length
==
0
?
null
:
this
.
props
.
isApprover
==
true
?
<
div
style
=
{{
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
downloadAllData
()
},
100
);
})}
>
<
img
src
=
{
Images
.
download
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div>
:
<
div
style
=
{{
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
{((
this
.
props
.
lastStatus
===
'SUBMIT'
||
this
.
props
.
lastStatus
===
'REVISION'
)
&&
this
.
props
.
prevRevision
===
false
&&
(
this
.
props
.
status
===
'revision'
||
this
.
props
.
status
===
'not-yet'
||
this
.
props
.
status
===
'draft'
||
this
.
props
.
status
===
'submitted'
))
&&
(
<
div
>
<
a
data
-
tip
=
{
'Download Template'
}
data
-
for
=
"template"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
downloadTemplate
()}
>
<
img
src
=
{
Images
.
template
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"template"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
)}
{((
this
.
props
.
lastStatus
===
'SUBMIT'
||
this
.
props
.
lastStatus
===
'REVISION'
)
&&
this
.
props
.
prevRevision
===
false
&&
(
this
.
props
.
status
===
'revision'
||
this
.
props
.
status
===
'not-yet'
||
this
.
props
.
status
===
'draft'
||
this
.
props
.
status
===
'submitted'
))
&&
(
<
div
>
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
true
})}
>
<
img
src
=
{
Images
.
upload
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"upload"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
)}
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
downloadAllData
()
},
100
);
})}
>
<
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
&&
loadingComponent
}
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
data
=
{
datas
}
columns
=
{
columnSummaryBS
}
options
=
{
options
}
/
>
<
/MuiThemeProvider
>
<
/div
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
,
marginTop
:
20
}}
>
Last
Updated
by
:
{
this
.
state
.
updateBy
}
<
/Typography
>
<
/div
>
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
<
div
className
=
"col-1"
>
<
button
type
=
"button"
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
props
.
onClickClose
()
},
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'
}}
>
Cancel
<
/Typography
>
<
/div
>
<
/button
>
<
/div
>
{
this
.
props
.
isApprover
===
true
||
this
.
state
.
dataTable
.
length
==
0
?
null
:
(
this
.
props
.
lastStatus
===
'SUBMIT'
||
this
.
props
.
lastStatus
===
'REVISION'
)
&&
this
.
props
.
prevRevision
===
false
&&
(
this
.
props
.
status
===
'revision'
||
this
.
props
.
status
===
'not-yet'
||
this
.
props
.
status
===
'draft'
||
this
.
props
.
status
===
'submitted'
)
?
<
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.setState({ loading: false, buttonError: false, editable: true })
this
.
handleValidate
()
},
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
className
=
"button"
type
=
"button"
onClick
=
{()
=>
this
.
state
.
saveDraft
===
true
?
null
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
,
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
backToMasterBudget
(
'draft'
)
},
100
);
})
}
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
this
.
state
.
saveDraft
!==
true
?
'pointer'
:
'default'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
marginRight
:
20
}}
>
<
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
as
Draft
<
/Typography
>
<
/div
>
<
/button
>
<
button
type
=
"button"
disabled
=
{
this
.
state
.
buttonError
}
onClick
=
{()
=>
this
.
state
.
buttonError
?
this
.
setState
({
alert
:
true
,
messageAlert
:
'Data is not complete !'
,
tipeAlert
:
'warning'
})
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
,
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
backToMasterBudget
(
'submitted'
)
},
100
);
})}
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
this
.
state
.
buttonError
===
true
?
'default'
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
marginRight
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
&
Complete
<
/Typography
>
<
/div
>
<
/button
>
<
/div
>
:
null
}
<
/div
>
<
/Paper
>
<
/div
>
<
/div
>
);
}
}
src/container/Laporan/SummaryPL.js
0 → 100644
View file @
5eba227a
import
React
,
{
Component
}
from
'react'
;
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'
;
import
*
as
R
from
'ramda'
;
const
LightTooltip
=
withStyles
((
theme
)
=>
({
tooltip
:
{
backgroundColor
:
theme
.
palette
.
common
.
white
,
color
:
'rgba(0, 0, 0, 0.87)'
,
boxShadow
:
theme
.
shadows
[
1
],
fontSize
:
11
,
},
}))(
Tooltip
);
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable3
());
const
options
=
ct
.
customOptionsFixedColumn
();
const
style
=
{
position
:
"sticky"
,
left
:
0
,
zIndex
:
101
,
background
:
"white"
,
};
const
style2
=
{
position
:
"sticky"
,
background
:
"white"
,
zIndex
:
100
,
top
:
0
};
export
default
class
SummaryPL
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
dataTable
:
[],
loading
:
false
,
}
}
componentDidMount
()
{
// this.getItemHierarki()
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
render
()
{
const
columnSummaryPL
=
[
{
name
:
"Account"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
key
=
{
columnMeta
.
index
}
style
=
{{
...
style
,
top
:
0
,
zIndex
:
102
,
backgroundColor
:
'#1c71b8'
,
width
:
300
,
borderRight
:
'1px #fff solid'
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'left'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
setCellProps
:
()
=>
({
style
}),
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
width
:
300
}}
>
{
val
}
<
/div
>
)
}
}
},
{
name
:
`MTD 2021`
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
th
style
=
{{
...
style2
,
backgroundColor
:
'#1c71b8'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
}}
>
<
div
style
=
{{
borderBottom
:
"1px #fff solid"
,
textAlign
:
'center'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
padding
:
5
,
height
:
50
}}
>
{
columnMeta
.
name
}
<
/div
>
<
div
className
=
"grid grid-1x"
style
=
{{
...
style2
,
backgroundColor
:
'#37b5e6'
,
color
:
'#fff'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
position
:
"sticky"
}}
>
<
div
className
=
"column-1 grid grid-4x"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
}}
>
<
div
className
=
"column-1"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'#07a7d0'
}}
>
<
span
>
{
"Actual"
}
<
/span
>
<
/div
>
<
div
className
=
"column-2"
style
=
{{
placeSelf
:
'center'
,
color
:
'black'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'rgb(200 224 229)'
}}
>
<
span
>
{
"MB"
}
<
/span
>
<
/div
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
color
:
'black'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'rgb(200 224 229)'
}}
>
<
span
>
{
"% of MB"
}
<
/span
>
<
/div
>
<
div
className
=
"column-4"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'#07a7d06'
}}
>
<
span
>
{
"Last Year"
}
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/th
>
),
setCellProps
:
()
=>
({
style2
}),
customBodyRender
:
(
val
,
tableMeta
,
updateValue
)
=>
{
console
.
log
(
tableMeta
)
console
.
log
(
val
)
return
(
<
div
>
<
div
className
=
"grid grid-1x content-center"
>
<
div
className
=
"grid grid-4x content-center"
>
<
div
className
=
"col-1"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
div
className
=
"col-2"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
div
className
=
"col-3"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
div
className
=
"col-4"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)
}
}
},
{
name
:
`YTD 2021`
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
th
style
=
{{
...
style2
,
backgroundColor
:
'#1c71b8'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
}}
>
<
div
style
=
{{
borderBottom
:
"1px #fff solid"
,
textAlign
:
'center'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
padding
:
5
,
height
:
50
}}
>
{
columnMeta
.
name
}
<
/div
>
<
div
className
=
"grid grid-1x"
style
=
{{
...
style2
,
backgroundColor
:
'#37b5e6'
,
color
:
'#fff'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
position
:
"sticky"
}}
>
<
div
className
=
"column-1 grid grid-4x"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
}}
>
<
div
className
=
"column-1"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'#07a7d0'
}}
>
<
span
>
{
"Actual"
}
<
/span
>
<
/div
>
<
div
className
=
"column-2"
style
=
{{
placeSelf
:
'center'
,
color
:
'black'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'rgb(200 224 229)'
}}
>
<
span
>
{
"MB"
}
<
/span
>
<
/div
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
color
:
'black'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'rgb(200 224 229)'
}}
>
<
span
>
{
"% of MB"
}
<
/span
>
<
/div
>
<
div
className
=
"column-4"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'#07a7d06'
}}
>
<
span
>
{
"Last Year"
}
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/th
>
),
setCellProps
:
()
=>
({
style2
}),
customBodyRender
:
(
val
,
tableMeta
,
updateValue
)
=>
{
console
.
log
(
tableMeta
)
console
.
log
(
val
)
return
(
<
div
>
<
div
className
=
"grid grid-1x content-center"
>
<
div
className
=
"grid grid-4x content-center"
>
<
div
className
=
"col-1"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
div
className
=
"col-2"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
div
className
=
"col-3"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
div
className
=
"col-4"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)
}
}
},
{
name
:
`Q1 2021`
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
th
style
=
{{
...
style2
,
backgroundColor
:
'#1c71b8'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
}}
>
<
div
style
=
{{
borderBottom
:
"1px #fff solid"
,
textAlign
:
'center'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
padding
:
5
,
height
:
50
}}
>
{
columnMeta
.
name
}
<
/div
>
<
div
className
=
"grid grid-1x"
style
=
{{
...
style2
,
backgroundColor
:
'#37b5e6'
,
color
:
'#fff'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
position
:
"sticky"
}}
>
<
div
className
=
"column-1 grid grid-4x"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
}}
>
<
div
className
=
"column-1"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'#07a7d0'
}}
>
<
span
>
{
"Actual"
}
<
/span
>
<
/div
>
<
div
className
=
"column-2"
style
=
{{
placeSelf
:
'center'
,
color
:
'black'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'rgb(200 224 229)'
}}
>
<
span
>
{
"MB"
}
<
/span
>
<
/div
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
color
:
'black'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'rgb(200 224 229)'
}}
>
<
span
>
{
"% of MB"
}
<
/span
>
<
/div
>
<
div
className
=
"column-4"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'#07a7d06'
}}
>
<
span
>
{
"Last Year"
}
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/th
>
),
setCellProps
:
()
=>
({
style2
}),
customBodyRender
:
(
val
,
tableMeta
,
updateValue
)
=>
{
console
.
log
(
tableMeta
)
console
.
log
(
val
)
return
(
<
div
>
<
div
className
=
"grid grid-1x content-center"
>
<
div
className
=
"grid grid-4x content-center"
>
<
div
className
=
"col-1"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
div
className
=
"col-2"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
div
className
=
"col-3"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
div
className
=
"col-4"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)
}
}
},
{
name
:
`FY 2021`
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
th
style
=
{{
...
style2
,
backgroundColor
:
'#1c71b8'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
}}
>
<
div
style
=
{{
borderBottom
:
"1px #fff solid"
,
textAlign
:
'center'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
padding
:
5
,
height
:
50
}}
>
{
columnMeta
.
name
}
<
/div
>
<
div
className
=
"grid grid-2x"
style
=
{{
...
style2
,
backgroundColor
:
'#37b5e6'
,
color
:
'#fff'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
position
:
"sticky"
}}
>
<
div
className
=
"column-1 grid grid-4x"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
}}
>
<
div
className
=
"column-1"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'#07a7d0'
}}
>
<
span
>
{
"Actual"
}
<
/span
>
<
/div
>
<
div
className
=
"column-2"
style
=
{{
placeSelf
:
'center'
,
color
:
'black'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'rgb(200 224 229)'
}}
>
<
span
>
{
"MB"
}
<
/span
>
<
/div
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
color
:
'black'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'rgb(200 224 229)'
}}
>
<
span
>
{
"% of MB"
}
<
/span
>
<
/div
>
<
div
className
=
"column-4"
style
=
{{
placeSelf
:
'center'
,
color
:
'black'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'#rgb(200 224 229)'
}}
>
<
span
>
{
"OL"
}
<
/span
>
<
/div
>
<
/div
>
<
div
className
=
"column-2 grid grid-4x"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
}}
>
<
div
className
=
"column-1"
style
=
{{
placeSelf
:
'center'
,
color
:
'black'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'rgb(200 224 229)'
}}
>
<
span
>
{
"% of OL"
}
<
/span
>
<
/div
>
<
div
className
=
"column-2"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'#07a7d0'
}}
>
<
span
>
{
"Last Year"
}
<
/span
>
<
/div
>
<
div
className
=
"column-3"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'#07a7d0'
}}
>
<
span
>
{
"% of LY"
}
<
/span
>
<
/div
>
<
div
className
=
"column-4"
style
=
{{
placeSelf
:
'center'
,
color
:
'black'
,
textAlign
:
'center'
,
padding
:
5
,
borderRight
:
"1px #fff solid"
,
backgroundColor
:
'rgb(200 224 229)'
}}
>
<
span
>
{
"% ach OL to MB"
}
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/th
>
),
setCellProps
:
()
=>
({
style2
}),
customBodyRender
:
(
val
,
tableMeta
,
updateValue
)
=>
{
console
.
log
(
tableMeta
)
console
.
log
(
val
)
return
(
<
div
>
<
div
className
=
"grid grid-2x content-center"
>
<
div
className
=
"col-1"
>
<
div
className
=
"grid grid-4x content-center"
>
<
div
className
=
"col-1"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
div
className
=
"col-2"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
div
className
=
"col-3"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
div
className
=
"col-4"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"col-2"
>
<
div
className
=
"grid grid-4x content-center"
>
<
div
className
=
"col-1"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
div
className
=
"col-2"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
div
className
=
"col-3"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
div
className
=
"col-4"
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
90
}}
>
0.0
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)
}
}
},
{
name
:
"2022"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
th
style
=
{{
...
style2
,
color
:
'#fff'
,
backgroundColor
:
'#07a7d0'
,
fontSize
:
13
,
top
:
0
,
zIndex
:
102
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
,
padding
:
0
}}
>
{
/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> */
}
<
div
style
=
{{
borderBottom
:
"1px #fff solid"
,
backgroundColor
:
'#1c71b8'
,
textAlign
:
'center'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
padding
:
5
,
height
:
50
}}
>
{
columnMeta
.
name
}
<
/div
>
<
div
className
=
"grid grid-1x"
style
=
{{
...
style2
,
color
:
'#fff'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
position
:
"sticky"
}}
>
<
div
className
=
"column-1"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
<
span
>
{
"ForeCast"
}
<
/span
>
<
/div
>
<
/div
>
<
/th
>
),
setCellProps
:
()
=>
({
style2
}),
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
textAlign
:
'right'
}}
>
<
/div
>
)
}
}
},
{
name
:
"2023"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
th
style
=
{{
...
style2
,
color
:
'#fff'
,
backgroundColor
:
'#07a7d0'
,
fontSize
:
13
,
top
:
0
,
zIndex
:
102
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
,
padding
:
0
}}
>
{
/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> */
}
<
div
style
=
{{
borderBottom
:
"1px #fff solid"
,
backgroundColor
:
'#1c71b8'
,
textAlign
:
'center'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
padding
:
5
,
height
:
50
}}
>
{
columnMeta
.
name
}
<
/div
>
<
div
className
=
"grid grid-1x"
style
=
{{
...
style2
,
color
:
'#fff'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
position
:
"sticky"
}}
>
<
div
className
=
"column-1"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
<
span
>
{
"ForeCast"
}
<
/span
>
<
/div
>
<
/div
>
<
/th
>
),
setCellProps
:
()
=>
({
style2
}),
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
textAlign
:
'right'
}}
>
<
/div
>
)
}
}
}
]
let
datas
=
[
[
"ABCD"
,
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
},
{
a
:
"2"
,
b
:
"3"
,
c
:
"4"
,
d
:
"5"
}],
[
"Total Assets"
,
{
a
:
"6"
,
b
:
"7"
,
c
:
"8"
,
d
:
"9"
},
{
a
:
"6"
,
b
:
"7"
,
c
:
"8"
,
d
:
"9"
},
{
a
:
"6"
,
b
:
"7"
,
c
:
"8"
,
d
:
"9"
},
{
a
:
"6"
,
b
:
"7"
,
c
:
"8"
,
d
:
"9"
},
{
a
:
"6"
,
b
:
"7"
,
c
:
"8"
,
d
:
"9"
},
{
a
:
"6"
,
b
:
"7"
,
c
:
"8"
,
d
:
"9"
}]
]
const
loadingComponent
=
(
<
div
style
=
{{
position
:
'absolute'
,
zIndex
:
110
,
top
:
0
,
left
:
0
,
width
:
'100%'
,
height
:
'100%'
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
background
:
'rgba(255,255,255,0.8)'
}}
>
<
PropagateLoader
// css={override}
size
=
{
20
}
color
=
{
"#274B80"
}
loading
=
{
this
.
state
.
loading
}
/
>
<
/div
>
);
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'
}}
>
FINANCIAL
SUMMARY
OF
TRIPUTRA
GROUP
<
/Typography
>
<
/div
>
<
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.visibleTP === true ? */
}
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Sub
Holding
Report
<
/Typography
>
<
/div
>
<
div
style
=
{{
padding
:
20
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
}}
>
<
div
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
Tax
Planning
-
Monthly
(
Database
)
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
Period
:
2021
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
/div
>
<
div
style
=
{{
width
:
'50%'
}}
>
{
this
.
state
.
dataTable
.
length
==
0
?
null
:
this
.
props
.
isApprover
==
true
?
<
div
style
=
{{
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
downloadAllData
()
},
100
);
})}
>
<
img
src
=
{
Images
.
download
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div>
:
<
div
style
=
{{
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
{((
this
.
props
.
lastStatus
===
'SUBMIT'
||
this
.
props
.
lastStatus
===
'REVISION'
)
&&
this
.
props
.
prevRevision
===
false
&&
(
this
.
props
.
status
===
'revision'
||
this
.
props
.
status
===
'not-yet'
||
this
.
props
.
status
===
'draft'
||
this
.
props
.
status
===
'submitted'
))
&&
(
<
div
>
<
a
data
-
tip
=
{
'Download Template'
}
data
-
for
=
"template"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
downloadTemplate
()}
>
<
img
src
=
{
Images
.
template
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"template"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
)}
{((
this
.
props
.
lastStatus
===
'SUBMIT'
||
this
.
props
.
lastStatus
===
'REVISION'
)
&&
this
.
props
.
prevRevision
===
false
&&
(
this
.
props
.
status
===
'revision'
||
this
.
props
.
status
===
'not-yet'
||
this
.
props
.
status
===
'draft'
||
this
.
props
.
status
===
'submitted'
))
&&
(
<
div
>
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
true
})}
>
<
img
src
=
{
Images
.
upload
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"upload"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
)}
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
downloadAllData
()
},
100
);
})}
>
<
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
&&
loadingComponent
}
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
data
=
{
datas
}
columns
=
{
columnSummaryPL
}
options
=
{
options
}
/
>
<
/MuiThemeProvider
>
<
/div
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
,
marginTop
:
20
}}
>
Last
Updated
by
:
{
this
.
state
.
updateBy
}
<
/Typography
>
<
/div
>
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
<
div
className
=
"col-1"
>
<
button
type
=
"button"
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
props
.
onClickClose
()
},
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'
}}
>
Cancel
<
/Typography
>
<
/div
>
<
/button
>
<
/div
>
{
this
.
props
.
isApprover
===
true
||
this
.
state
.
dataTable
.
length
==
0
?
null
:
(
this
.
props
.
lastStatus
===
'SUBMIT'
||
this
.
props
.
lastStatus
===
'REVISION'
)
&&
this
.
props
.
prevRevision
===
false
&&
(
this
.
props
.
status
===
'revision'
||
this
.
props
.
status
===
'not-yet'
||
this
.
props
.
status
===
'draft'
||
this
.
props
.
status
===
'submitted'
)
?
<
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.setState({ loading: false, buttonError: false, editable: true })
this
.
handleValidate
()
},
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
className
=
"button"
type
=
"button"
onClick
=
{()
=>
this
.
state
.
saveDraft
===
true
?
null
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
,
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
backToMasterBudget
(
'draft'
)
},
100
);
})
}
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
this
.
state
.
saveDraft
!==
true
?
'pointer'
:
'default'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
marginRight
:
20
}}
>
<
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
as
Draft
<
/Typography
>
<
/div
>
<
/button
>
<
button
type
=
"button"
disabled
=
{
this
.
state
.
buttonError
}
onClick
=
{()
=>
this
.
state
.
buttonError
?
this
.
setState
({
alert
:
true
,
messageAlert
:
'Data is not complete !'
,
tipeAlert
:
'warning'
})
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
,
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
backToMasterBudget
(
'submitted'
)
},
100
);
})}
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
this
.
state
.
buttonError
===
true
?
'default'
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
marginRight
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
&
Complete
<
/Typography
>
<
/div
>
<
/button
>
<
/div
>
:
null
}
<
/div
>
<
/Paper
>
<
/div
>
<
/div
>
);
}
}
src/container/MonthlyReport/BalanceSheetMR.js
View file @
5eba227a
import
{
createMuiTheme
,
FormControlLabel
,
Input
,
MuiThemeProvider
,
Paper
,
TableCell
,
Tooltip
,
Typography
,
withStyles
}
from
'@material-ui/core'
import
{
createMuiTheme
,
FormControlLabel
,
Input
,
Snackbar
,
MuiThemeProvider
,
Paper
,
TableCell
,
Tooltip
,
Typography
,
withStyles
}
from
'@material-ui/core'
import
MUIDataTable
from
'mui-datatables'
;
import
React
,
{
Component
}
from
'react'
import
ReactTooltip
from
'react-tooltip'
;
...
...
@@ -11,6 +11,7 @@ import UploadFile from "../../library/Upload";
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
Constant
from
'../../library/Constant'
;
import
*
as
R
from
'ramda'
;
import
{
Alert
}
from
'@material-ui/lab'
;
const
LightTooltip
=
withStyles
((
theme
)
=>
({
tooltip
:
{
...
...
@@ -266,8 +267,9 @@ export default class BalanceSheetMR extends Component {
item_report_id
:
i
[
1
]
===
undefined
?
""
:
String
(
i
[
1
]).
trim
(),
item_report
:
i
[
2
]
===
undefined
?
""
:
String
(
i
[
2
]).
trim
(),
actual
:
i
[
3
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
2
]))
===
false
?
"0"
:
String
(
i
[
3
]).
trim
(),
mtd_vs_previous_month
:
i
[
4
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
4
]))
===
false
?
"0"
:
String
(
i
[
4
]).
trim
(),
mtd_vs_mb
:
i
[
5
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
5
]))
===
false
?
"0"
:
String
(
i
[
5
]).
trim
(),
mtd_vs_previous_month
:
i
[
4
]
===
undefined
?
""
:
String
(
i
[
4
]).
trim
(),
mtd_vs_mb
:
i
[
5
]
===
undefined
?
""
:
String
(
i
[
5
]).
trim
(),
mtd_vs_rb
:
i
[
6
]
===
undefined
?
""
:
String
(
i
[
6
]).
trim
(),
})
}
})
...
...
@@ -316,9 +318,9 @@ export default class BalanceSheetMR extends Component {
0
,
0
,
0
,
item
.
mtd_vs_previous_month
===
""
?
""
:
item
.
mtd_vs_previous_month
,
item
.
mtd_vs_mb
===
""
?
""
:
item
.
mtd_vs_mb
,
item
.
mtd_vs_rb
===
""
?
""
:
item
.
mtd_vs_rb
===
null
?
''
:
item
.
mtd_vs_rb
,
item
.
mtd_vs_previous_month
,
item
.
mtd_vs_mb
,
item
.
mtd_vs_rb
,
item
.
actual_formula
,
item
.
order
,
item
.
error
...
...
@@ -356,9 +358,9 @@ export default class BalanceSheetMR extends Component {
percent_act_vs_mb
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
14
].
value
).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
14
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
14
]).
toFixed
(
1
)),
amount_act_vs_rb
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
15
].
value
).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
15
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
15
]).
toFixed
(
1
)),
percent_act_vs_rb
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
16
].
value
).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
16
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
16
]).
toFixed
(
1
)),
mtd_vs_previous_month
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
17
].
value
).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
17
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
17
]).
toFixed
(
1
)
),
mtd_vs_mb
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
18
].
value
).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
18
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
18
]).
toFixed
(
1
)
),
mtd_vs_rb
:
i
[
0
]
===
5
||
i
[
0
]
===
6
?
String
(
Number
(
i
[
19
].
value
).
toFixed
(
1
))
:
i
[
0
]
===
3
&&
i
[
19
]
===
""
?
"0.0"
:
String
(
Number
(
i
[
19
]).
toFixed
(
1
)
)
mtd_vs_previous_month
:
String
(
i
[
17
]
),
mtd_vs_mb
:
String
(
i
[
18
]
),
mtd_vs_rb
:
String
(
i
[
19
]
)
})
})
let
body
=
{
...
...
@@ -521,6 +523,10 @@ export default class BalanceSheetMR extends Component {
})
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
render
()
{
let
dataTable2
=
this
.
state
.
dataTable
const
handleText
=
(
value
,
tableMeta
,
type
)
=>
{
...
...
@@ -1697,6 +1703,11 @@ export default class BalanceSheetMR extends Component {
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
flex
:
1
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Monthly
Report
<
/Typography
>
<
/div
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
{
this
.
state
.
messageAlert
}
<
/Alert
>
<
/Snackbar
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
{
this
.
state
.
visibleBSMR
?
<
Paper
style
=
{{
paddingTop
:
10
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
...
...
@@ -1804,7 +1815,7 @@ export default class BalanceSheetMR extends Component {
{
/* {this.props.isApprover === true || this.state.dataTable.length == 0 ? null :
(this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? */
}
<
div
className
=
"grid grid-2x"
style
=
{{
padding
:
20
}}
>
<
div
className
=
"col-1"
>
<
div
className
=
"col-1"
style
=
{{
paddingLeft
:
0
}}
>
<
button
type
=
"button"
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
...
...
@@ -1816,7 +1827,7 @@ export default class BalanceSheetMR extends Component {
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
outline
:
'none'
,
}}
>
<
div
style
=
{{
backgroundColor
:
'#019ce5'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
...
...
@@ -1827,7 +1838,7 @@ export default class BalanceSheetMR extends Component {
{
this
.
props
.
isApprover
===
true
?
<
div
className
=
"col-2"
>
<
/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%'
,
paddingRight
:
5
}}
>
<
button
className
=
"button"
type
=
"button"
...
...
@@ -1912,7 +1923,7 @@ export default class BalanceSheetMR extends Component {
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
)
}}
>
{
/* {!this.state.loading && ( */
}
{
this
.
state
.
dataLoaded
&&
(
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
data
=
{
dataTable2
}
...
...
@@ -1920,7 +1931,7 @@ export default class BalanceSheetMR extends Component {
options
=
{
options
}
/
>
<
/MuiThemeProvider
>
{
/* )} */
}
)}
<
/div
>
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
<
div
className
=
"col-1"
>
...
...
@@ -2046,7 +2057,7 @@ export default class BalanceSheetMR extends Component {
this
.
setState
({
uploadStatus
:
'idle'
,
percentage
:
'0'
})
}}
onUpload
=
{()
=>
{
String
(
this
.
state
.
judul
).
includes
(
"MONTHLY
REPORT - BALANCE
SHEET"
)
?
String
(
this
.
state
.
judul
).
includes
(
"MONTHLY
"
)
&&
String
(
this
.
state
.
judul
).
includes
(
"REPORT"
)
&&
String
(
this
.
state
.
judul
).
includes
(
"BALANCE"
)
&&
String
(
this
.
state
.
judul
).
includes
(
"
SHEET"
)
?
this
.
checkUpload
()
:
this
.
setState
({
alert
:
true
,
messageAlert
:
"Invalid Template"
,
tipeAlert
:
'warning'
})
}}
...
...
src/container/MonthlyReport/ProfitLossMR.js
View file @
5eba227a
...
...
@@ -197,7 +197,7 @@ export default class ProfitLossMR extends Component {
item
.
profit_loss
.
rolling_budget
===
null
?
"0.0"
:
item
.
profit_loss
.
rolling_budget
===
""
?
"0.0"
:
item
.
profit_loss
.
rolling_budget
,
item
.
profit_loss
.
actual
===
null
?
"0.0"
:
item
.
profit_loss
.
actual
===
""
?
"0.0"
:
item
.
profit_loss
.
actual
,
item
.
profit_loss
.
ytd_actual
===
null
?
"0.0"
:
item
.
profit_loss
.
ytd_actual
===
""
?
"0.0"
:
item
.
profit_loss
.
ytd_actual
,
item
.
profit_loss
.
actual_previous_month
===
null
?
"
5.0"
:
item
.
profit_loss
.
actual_previous_month
===
""
?
"5
.0"
:
item
.
profit_loss
.
actual_previous_month
,
item
.
profit_loss
.
actual_previous_month
===
null
?
"
0.0"
:
item
.
profit_loss
.
actual_previous_month
===
""
?
"0
.0"
:
item
.
profit_loss
.
actual_previous_month
,
item
.
profit_loss
.
amount_act_vs_previous_month
===
null
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_previous_month
,
item
.
profit_loss
.
percent_act_vs_previous_month
===
null
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_previous_month
,
item
.
profit_loss
.
amount_act_vs_mb
===
null
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_mb
===
""
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_mb
,
...
...
@@ -232,7 +232,7 @@ export default class ProfitLossMR extends Component {
item
.
profit_loss
.
rolling_budget
===
null
?
"0.0"
:
item
.
profit_loss
.
rolling_budget
===
""
?
"0.0"
:
item
.
profit_loss
.
rolling_budget
,
item
.
profit_loss
.
actual
===
null
?
"0.0"
:
item
.
profit_loss
.
actual
===
""
?
"0.0"
:
item
.
profit_loss
.
actual
,
item
.
profit_loss
.
ytd_actual
===
null
?
"0.0"
:
item
.
profit_loss
.
ytd_actual
===
""
?
"0.0"
:
item
.
profit_loss
.
ytd_actual
,
item
.
profit_loss
.
actual_previous_month
===
null
?
"
5.0"
:
item
.
profit_loss
.
actual_previous_month
===
""
?
"5
.0"
:
item
.
profit_loss
.
actual_previous_month
,
item
.
profit_loss
.
actual_previous_month
===
null
?
"
0.0"
:
item
.
profit_loss
.
actual_previous_month
===
""
?
"0
.0"
:
item
.
profit_loss
.
actual_previous_month
,
item
.
profit_loss
.
amount_act_vs_previous_month
===
null
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_previous_month
,
item
.
profit_loss
.
percent_act_vs_previous_month
===
null
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_previous_month
===
""
?
"0.0"
:
item
.
profit_loss
.
percent_act_vs_previous_month
,
item
.
profit_loss
.
amount_act_vs_mb
===
null
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_mb
===
""
?
"0.0"
:
item
.
profit_loss
.
amount_act_vs_mb
,
...
...
@@ -603,6 +603,7 @@ export default class ProfitLossMR extends Component {
const
handleText
=
(
value
,
tableMeta
,
type
)
=>
{
// dataTable2[tableMeta.rowIndex][type] = value
let
a
=
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
value
console
.
log
(
dataTable2
);
// console.log(dataTable2[tableMeta.rowIndex]);
}
const
handleChange
=
(
value
,
tableMeta
,
type
)
=>
{
...
...
@@ -829,19 +830,20 @@ export default class ProfitLossMR extends Component {
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
tableMeta
.
rowData
[
4
]
===
0
?
null
:
tableMeta
.
rowData
[
4
]
===
1
?
null
:
<
FormControlLabel
style
=
{{
margin
:
0
}}
// value={
value
}
// value={
tableMeta.rowData[6]
}
control
=
{
<
Input
disableUnderline
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'left'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
inputProps
=
{{
style
:
{
color
:
"#5198ea"
}}}
placeholder
=
""
value
=
{
tableMeta
.
rowData
[
6
]}
// disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
// value={tableMeta.rowData[6]}
defaultValue
=
{
tableMeta
.
rowData
[
6
]}
inputProps
=
{{
style
:
{
color
:
"#5198ea"
}
}}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleText
(
event
.
target
.
value
,
tableMeta
,
0
)
...
...
@@ -1574,7 +1576,7 @@ export default class ProfitLossMR extends Component {
type
=
"text"
placeholder
=
""
disabled
=
{
false
}
//
value={tableMeta.rowData[19]}
value
=
{
tableMeta
.
rowData
[
19
]}
defaultValue
=
{
tableMeta
.
rowData
[
19
]}
inputProps
=
{{
style
:
{
...
...
@@ -1762,6 +1764,11 @@ export default class ProfitLossMR extends Component {
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
flex
:
1
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Monthly
Report
Submission
<
/Typography
>
<
/div
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
{
this
.
state
.
messageAlert
}
<
/Alert
>
<
/Snackbar
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
{
this
.
state
.
visiblePLMR
?
<
Paper
style
=
{{
paddingTop
:
10
}}
>
...
...
@@ -1869,7 +1876,7 @@ export default class ProfitLossMR extends Component {
{
/* {this.props.isApprover === true || this.state.dataTable.length == 0 ? null :
(this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? */
}
<
div
className
=
"grid grid-2x"
style
=
{{
padding
:
20
}}
>
<
div
className
=
"col-1"
>
<
div
className
=
"col-1"
style
=
{{
paddingLeft
:
0
}}
>
<
button
type
=
"button"
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
...
...
@@ -1892,7 +1899,7 @@ export default class ProfitLossMR extends Component {
{
this
.
props
.
isApprover
===
true
?
<
div
className
=
"col-2"
>
<
/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%'
,
paddingRight
:
5
}}
>
<
button
className
=
"button"
type
=
"button"
...
...
@@ -1978,7 +1985,7 @@ export default class ProfitLossMR extends Component {
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
)
}}
>
{
/* {!this.state.loading && ( */
}
{
this
.
state
.
dataLoaded
&&
(
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
data
=
{
dataTable2
}
...
...
@@ -1986,7 +1993,7 @@ export default class ProfitLossMR extends Component {
options
=
{
options
}
/
>
<
/MuiThemeProvider
>
{
/* )} */
}
)}
<
/div
>
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
<
div
className
=
"col-1"
>
...
...
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