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
3f0244dd
Commit
3f0244dd
authored
Dec 17, 2020
by
Riri Novita
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'riri' into 'master'
issue upload See merge request
!817
parents
a11740e8
3a7312b8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
21 deletions
+39
-21
BalanceSheetMR.js
src/container/MonthlyReport/BalanceSheetMR.js
+23
-12
ProfitLossMR.js
src/container/MonthlyReport/ProfitLossMR.js
+16
-9
No files found.
src/container/MonthlyReport/BalanceSheetMR.js
View file @
3f0244dd
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
MUIDataTable
from
'mui-datatables'
;
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
ReactTooltip
from
'react-tooltip'
;
import
ReactTooltip
from
'react-tooltip'
;
...
@@ -11,6 +11,7 @@ import UploadFile from "../../library/Upload";
...
@@ -11,6 +11,7 @@ import UploadFile from "../../library/Upload";
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
Constant
from
'../../library/Constant'
;
import
Constant
from
'../../library/Constant'
;
import
*
as
R
from
'ramda'
;
import
*
as
R
from
'ramda'
;
import
{
Alert
}
from
'@material-ui/lab'
;
const
LightTooltip
=
withStyles
((
theme
)
=>
({
const
LightTooltip
=
withStyles
((
theme
)
=>
({
tooltip
:
{
tooltip
:
{
...
@@ -266,8 +267,9 @@ export default class BalanceSheetMR extends Component {
...
@@ -266,8 +267,9 @@ export default class BalanceSheetMR extends Component {
item_report_id
:
i
[
1
]
===
undefined
?
""
:
String
(
i
[
1
]).
trim
(),
item_report_id
:
i
[
1
]
===
undefined
?
""
:
String
(
i
[
1
]).
trim
(),
item_report
:
i
[
2
]
===
undefined
?
""
:
String
(
i
[
2
]).
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
(),
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_previous_month
:
i
[
4
]
===
undefined
?
""
:
String
(
i
[
4
]).
trim
(),
mtd_vs_mb
:
i
[
5
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
5
]))
===
false
?
"0"
:
String
(
i
[
5
]).
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 {
...
@@ -316,9 +318,9 @@ export default class BalanceSheetMR extends Component {
0
,
0
,
0
,
0
,
0
,
0
,
item
.
mtd_vs_previous_month
===
""
?
""
:
item
.
mtd_vs_previous_month
,
item
.
mtd_vs_previous_month
,
item
.
mtd_vs_mb
===
""
?
""
:
item
.
mtd_vs_mb
,
item
.
mtd_vs_mb
,
item
.
mtd_vs_rb
===
""
?
""
:
item
.
mtd_vs_rb
===
null
?
''
:
item
.
mtd_vs_rb
,
item
.
mtd_vs_rb
,
item
.
actual_formula
,
item
.
actual_formula
,
item
.
order
,
item
.
order
,
item
.
error
item
.
error
...
@@ -356,9 +358,9 @@ export default class BalanceSheetMR extends Component {
...
@@ -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
)),
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
)),
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
)),
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_previous_month
:
String
(
i
[
17
]
),
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_mb
:
String
(
i
[
18
]
),
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_rb
:
String
(
i
[
19
]
)
})
})
})
})
let
body
=
{
let
body
=
{
...
@@ -521,6 +523,10 @@ export default class BalanceSheetMR extends Component {
...
@@ -521,6 +523,10 @@ export default class BalanceSheetMR extends Component {
})
})
}
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
render
()
{
render
()
{
let
dataTable2
=
this
.
state
.
dataTable
let
dataTable2
=
this
.
state
.
dataTable
const
handleText
=
(
value
,
tableMeta
,
type
)
=>
{
const
handleText
=
(
value
,
tableMeta
,
type
)
=>
{
...
@@ -1697,6 +1703,11 @@ export default class BalanceSheetMR extends Component {
...
@@ -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
}}
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
flex
:
1
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Monthly
Report
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Monthly
Report
<
/Typography
>
<
/div
>
<
/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%'
}}
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
{
this
.
state
.
visibleBSMR
?
<
Paper
style
=
{{
paddingTop
:
10
}}
>
{
this
.
state
.
visibleBSMR
?
<
Paper
style
=
{{
paddingTop
:
10
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
...
@@ -1912,7 +1923,7 @@ export default class BalanceSheetMR extends Component {
...
@@ -1912,7 +1923,7 @@ export default class BalanceSheetMR extends Component {
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
/div
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
)
}}
>
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
)
}}
>
{
/* {!this.state.loading && ( */
}
{
this
.
state
.
dataLoaded
&&
(
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
<
MUIDataTable
data
=
{
dataTable2
}
data
=
{
dataTable2
}
...
@@ -1920,7 +1931,7 @@ export default class BalanceSheetMR extends Component {
...
@@ -1920,7 +1931,7 @@ export default class BalanceSheetMR extends Component {
options
=
{
options
}
options
=
{
options
}
/
>
/
>
<
/MuiThemeProvider
>
<
/MuiThemeProvider
>
{
/* )} */
}
)}
<
/div
>
<
/div
>
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
<
div
className
=
"col-1"
>
<
div
className
=
"col-1"
>
...
@@ -2046,7 +2057,7 @@ export default class BalanceSheetMR extends Component {
...
@@ -2046,7 +2057,7 @@ export default class BalanceSheetMR extends Component {
this
.
setState
({
uploadStatus
:
'idle'
,
percentage
:
'0'
})
this
.
setState
({
uploadStatus
:
'idle'
,
percentage
:
'0'
})
}}
}}
onUpload
=
{()
=>
{
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
.
checkUpload
()
:
this
.
setState
({
alert
:
true
,
messageAlert
:
"Invalid Template"
,
tipeAlert
:
'warning'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
"Invalid Template"
,
tipeAlert
:
'warning'
})
}}
}}
...
...
src/container/MonthlyReport/ProfitLossMR.js
View file @
3f0244dd
...
@@ -603,6 +603,7 @@ export default class ProfitLossMR extends Component {
...
@@ -603,6 +603,7 @@ export default class ProfitLossMR extends Component {
const
handleText
=
(
value
,
tableMeta
,
type
)
=>
{
const
handleText
=
(
value
,
tableMeta
,
type
)
=>
{
// dataTable2[tableMeta.rowIndex][type] = value
// dataTable2[tableMeta.rowIndex][type] = value
let
a
=
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
value
let
a
=
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
value
console
.
log
(
dataTable2
);
// console.log(dataTable2[tableMeta.rowIndex]);
// console.log(dataTable2[tableMeta.rowIndex]);
}
}
const
handleChange
=
(
value
,
tableMeta
,
type
)
=>
{
const
handleChange
=
(
value
,
tableMeta
,
type
)
=>
{
...
@@ -829,19 +830,20 @@ export default class ProfitLossMR extends Component {
...
@@ -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
:
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
tableMeta
.
rowData
[
4
]
===
0
?
null
:
tableMeta
.
rowData
[
4
]
===
1
?
null
:
<
FormControlLabel
<
FormControlLabel
style
=
{{
margin
:
0
}}
style
=
{{
margin
:
0
}}
// value={
value
}
// value={
tableMeta.rowData[6]
}
control
=
{
control
=
{
<
Input
<
Input
disableUnderline
=
{
true
}
disableUnderline
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'left'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
style
=
{{
fontSize
:
12
,
textAlign
:
'left'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
type
=
"text"
inputProps
=
{{
style
:
{
color
:
"#5198ea"
}}}
placeholder
=
""
placeholder
=
""
value
=
{
tableMeta
.
rowData
[
6
]}
// 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)}
defaultValue
=
{
tableMeta
.
rowData
[
6
]}
defaultValue
=
{
tableMeta
.
rowData
[
6
]}
inputProps
=
{{
style
:
{
color
:
"#5198ea"
}
}}
onBlur
=
{(
event
)
=>
{
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
// updateValue(event.target.value)
handleText
(
event
.
target
.
value
,
tableMeta
,
0
)
handleText
(
event
.
target
.
value
,
tableMeta
,
0
)
...
@@ -1574,7 +1576,7 @@ export default class ProfitLossMR extends Component {
...
@@ -1574,7 +1576,7 @@ export default class ProfitLossMR extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
false
}
disabled
=
{
false
}
//
value={tableMeta.rowData[19]}
value
=
{
tableMeta
.
rowData
[
19
]}
defaultValue
=
{
tableMeta
.
rowData
[
19
]}
defaultValue
=
{
tableMeta
.
rowData
[
19
]}
inputProps
=
{{
inputProps
=
{{
style
:
{
style
:
{
...
@@ -1762,6 +1764,11 @@ export default class ProfitLossMR extends Component {
...
@@ -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
}}
>
<
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
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Monthly
Report
Submission
<
/Typography
>
<
/div
>
<
/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%'
}}
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
{
this
.
state
.
visiblePLMR
?
{
this
.
state
.
visiblePLMR
?
<
Paper
style
=
{{
paddingTop
:
10
}}
>
<
Paper
style
=
{{
paddingTop
:
10
}}
>
...
@@ -1978,7 +1985,7 @@ export default class ProfitLossMR extends Component {
...
@@ -1978,7 +1985,7 @@ export default class ProfitLossMR extends Component {
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
/div
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
)
}}
>
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
)
}}
>
{
/* {!this.state.loading && ( */
}
{
this
.
state
.
dataLoaded
&&
(
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
<
MUIDataTable
data
=
{
dataTable2
}
data
=
{
dataTable2
}
...
@@ -1986,7 +1993,7 @@ export default class ProfitLossMR extends Component {
...
@@ -1986,7 +1993,7 @@ export default class ProfitLossMR extends Component {
options
=
{
options
}
options
=
{
options
}
/
>
/
>
<
/MuiThemeProvider
>
<
/MuiThemeProvider
>
{
/* )} */
}
)}
<
/div
>
<
/div
>
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
<
div
className
=
"col-1"
>
<
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