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
7a2d368b
Commit
7a2d368b
authored
Nov 24, 2023
by
Riri Novita
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ENV-DEV' into 'ENV-DEPLOYMENT'
update See merge request
!2187
parents
ce3d495e
ef19eb71
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
162 additions
and
176 deletions
+162
-176
LOCFMR.js
src/container/MonthlyReport/LOCFMR.js
+3
-3
LOVMR.js
src/container/MonthlyReport/LOVMR.js
+24
-73
ListOfCreditFacilitiesMR.js
src/container/MonthlyReport/ListOfCreditFacilitiesMR.js
+135
-100
No files found.
src/container/MonthlyReport/LOCFMR.js
View file @
7a2d368b
...
@@ -555,8 +555,8 @@ export default class LOCF extends Component {
...
@@ -555,8 +555,8 @@ export default class LOCF extends Component {
let
lastArray
=
dataTable
[
dataTable
.
length
-
1
]
let
lastArray
=
dataTable
[
dataTable
.
length
-
1
]
this
.
setState
({
dataTable
,
diff
:
lastArray
[
46
],
perBS
:
lastArray
[
47
],
dataLoaded
:
true
,
loading
:
false
,
buttonError
:
false
,
dataDelete
:
[]
},
()
=>
{
this
.
setState
({
dataTable
,
diff
:
lastArray
[
46
],
perBS
:
lastArray
[
47
],
dataLoaded
:
true
,
loading
:
false
,
buttonError
:
false
,
dataDelete
:
[]
},
()
=>
{
console
.
log
(
lastArray
);
console
.
log
(
this
.
state
.
visibleLOCFMR
);
this
.
props
.
sendToParent
(
dataTable
,
lastArray
,
'LOCF'
,
'upload'
)
this
.
props
.
sendToParent
(
dataTable
,
lastArray
,
'LOCF'
,
'upload'
,
this
.
state
.
visibleLOCFMR
)
})
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
typeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
typeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
...
@@ -3592,7 +3592,7 @@ export default class LOCF extends Component {
...
@@ -3592,7 +3592,7 @@ export default class LOCF extends Component {
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
}}
>
Diff
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
}}
>
Diff
<
/Typography
>
<
/div
>
<
/div
>
<
div
style
=
{{
borderStyle
:
'solid'
,
borderWidth
:
'0px 1px 1px 1px'
,
padding
:
5
,
minWidth
:
200
,
display
:
'flex'
,
justifyContent
:
'flex-end'
}}
>
<
div
style
=
{{
borderStyle
:
'solid'
,
borderWidth
:
'0px 1px 1px 1px'
,
padding
:
5
,
minWidth
:
200
,
display
:
'flex'
,
justifyContent
:
'flex-end'
}}
>
<
Typography
style
=
{{
fontSize
:
'14px'
,
color
:
Number
(
this
.
state
.
diff
)
>
0
?
'red'
:
'#4b4b4b'
}}
><
NumberFormat
value
=
{
this
.
state
.
diff
}
displayType
=
{
'text'
}
thousandSeparator
=
{
true
}
prefix
=
{
''
}
/></
Typography
>
<
Typography
style
=
{{
fontSize
:
'14px'
,
color
:
Number
(
this
.
state
.
diff
)
>
'0.0'
||
Number
(
this
.
state
.
diff
)
<
'0.0'
?
'red'
:
'#4b4b4b'
}}
><
NumberFormat
value
=
{
this
.
state
.
diff
}
displayType
=
{
'text'
}
thousandSeparator
=
{
true
}
prefix
=
{
''
}
/></
Typography
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
src/container/MonthlyReport/LOVMR.js
View file @
7a2d368b
...
@@ -475,9 +475,8 @@ export default class LOV extends Component {
...
@@ -475,9 +475,8 @@ export default class LOV extends Component {
})
})
console
.
log
(
dataTable
)
console
.
log
(
dataTable
)
let
lastArray
=
dataTable
[
dataTable
.
length
-
1
]
let
lastArray
=
dataTable
[
dataTable
.
length
-
1
]
console
.
log
(
lastArray
);
this
.
setState
({
dataTable
,
diff
:
lastArray
[
16
],
perBS
:
lastArray
[
18
],
dataLoaded
:
true
,
loading
:
false
,
buttonError
:
false
,
dataDelete
:
[]
},
()
=>
{
this
.
setState
({
dataTable
,
diff
:
lastArray
[
16
],
perBS
:
lastArray
[
18
],
loading
:
false
,
visibleLOVMR
:
true
},
()
=>
{
this
.
props
.
sendToParent
(
dataTable
,
lastArray
,
'LOV'
,
'upload'
,
this
.
state
.
visibleLOVMR
)
this
.
props
.
sendToParent
(
dataTable
,
lastArray
,
'LOV'
,
'upload'
)
})
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
typeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
typeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
...
@@ -660,7 +659,7 @@ export default class LOV extends Component {
...
@@ -660,7 +659,7 @@ export default class LOV extends Component {
// }
// }
getListCurrency
()
{
getListCurrency
()
{
this
.
setState
({
dataLoaded
:
false
})
//
this.setState({ dataLoaded: false })
api
.
create
().
getDataCurrency
().
then
(
response
=>
{
api
.
create
().
getDataCurrency
().
then
(
response
=>
{
console
.
log
(
response
)
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
)
{
...
@@ -995,18 +994,17 @@ export default class LOV extends Component {
...
@@ -995,18 +994,17 @@ export default class LOV extends Component {
let
prevData
=
dataTable2
[
index
-
1
]
==
undefined
?
null
:
dataTable2
[
index
-
1
][
6
]
let
prevData
=
dataTable2
[
index
-
1
]
==
undefined
?
null
:
dataTable2
[
index
-
1
][
6
]
let
currentData
=
dataTable2
[
index
][
6
]
let
currentData
=
dataTable2
[
index
][
6
]
let
nextData
=
dataTable2
[
index
+
1
]
==
undefined
?
null
:
dataTable2
[
index
+
1
][
6
]
let
nextData
=
dataTable2
[
index
+
1
]
==
undefined
?
null
:
dataTable2
[
index
+
1
][
6
]
console
.
log
(
nextData
);
if
(
nextData
==
null
)
{
if
(
nextData
==
null
)
{
dataTable2
.
splice
(
index
,
1
)
dataTable2
.
splice
(
index
,
1
)
}
else
if
(
nextData
.
value
.
includes
(
'Total'
))
{
}
else
if
(
nextData
.
includes
(
'Total'
))
{
if
(
prevData
!==
null
&&
currentData
==
null
)
{
if
(
prevData
!==
null
&&
currentData
==
null
)
{
dataTable2
.
splice
(
index
,
1
)
dataTable2
.
splice
(
index
,
1
)
}
else
if
(
prevData
!==
null
&&
prevData
.
value
==
currentData
.
value
)
{
}
else
if
(
prevData
!==
null
&&
prevData
==
currentData
)
{
dataTable2
.
splice
(
index
,
1
)
dataTable2
.
splice
(
index
,
1
)
}
else
if
(
dataTable2
.
length
>
3
)
{
}
else
if
(
dataTable2
.
length
>
3
)
{
if
(
prevData
==
null
)
{
if
(
prevData
==
null
)
{
if
(
nextData
.
value
.
includes
(
'Grand'
))
{
if
(
nextData
.
includes
(
'Grand'
))
{
dataTable2
.
splice
(
index
,
1
)
dataTable2
.
splice
(
index
,
1
)
}
else
{
}
else
{
dataTable2
.
splice
(
index
,
2
)
dataTable2
.
splice
(
index
,
2
)
...
@@ -1016,7 +1014,7 @@ export default class LOV extends Component {
...
@@ -1016,7 +1014,7 @@ export default class LOV extends Component {
}
}
}
else
if
(
dataTable2
.
length
==
3
)
{
}
else
if
(
dataTable2
.
length
==
3
)
{
if
(
prevData
==
null
)
{
if
(
prevData
==
null
)
{
if
(
nextData
.
value
.
includes
(
'Grand'
))
{
if
(
nextData
.
includes
(
'Grand'
))
{
dataTable2
.
splice
(
index
,
1
)
dataTable2
.
splice
(
index
,
1
)
}
else
{
}
else
{
dataTable2
.
splice
(
index
,
3
)
dataTable2
.
splice
(
index
,
3
)
...
@@ -1832,6 +1830,7 @@ export default class LOV extends Component {
...
@@ -1832,6 +1830,7 @@ export default class LOV extends Component {
<
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
&&
loadingComponent
}
{
this
.
state
.
loading
&&
loadingComponent
}
{
this
.
state
.
dataLoaded
&&
!
this
.
state
.
loading
&&
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
{
this
.
state
.
dataLoaded
&&
!
this
.
state
.
loading
&&
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
div
>
cuuuk
<
/div
>
<
MUIDataTable
<
MUIDataTable
data
=
{
dataTable2
}
data
=
{
dataTable2
}
columns
=
{
columns
}
columns
=
{
columns
}
...
@@ -1840,54 +1839,6 @@ export default class LOV extends Component {
...
@@ -1840,54 +1839,6 @@ export default class LOV extends Component {
<
/MuiThemeProvider>
}
<
/MuiThemeProvider>
}
<
/div
>
<
/div
>
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
<
div
className
=
"col-1"
style
=
{{
paddingLeft
:
0
}}
>
<
button
type
=
"button"
onClick
=
{()
=>
this
.
setState
({
loading
:
true
,
visiblePLMR
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
getItemHierarkiLOV
()
},
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'
}}
>
Back
<
/Typography
>
<
/div
>
<
/button
>
<
/div
>
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
,
paddingRight
:
5
}}
>
<
button
className
=
"button"
type
=
"button"
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
marginRight
:
20
}}
onClick
=
{()
=>
{
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
// this.setState({ loading: false })
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
>
<
/div
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
,
maxWidth
:
'100%'
,
paddingLeft
:
5
,
paddingRight
:
15
,
marginTop
:
5
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
,
maxWidth
:
'100%'
,
paddingLeft
:
5
,
paddingRight
:
15
,
marginTop
:
5
}}
>
<
div
>
<
div
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
...
@@ -1953,7 +1904,7 @@ export default class LOV extends Component {
...
@@ -1953,7 +1904,7 @@ export default class LOV extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Total Outstanding Loan</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Total Outstanding Loan</Typography>
</div>
</div>
<div style={{border: '1px solid black', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end'}}>
<div style={{border: '1px solid black', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end'}}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{formatSeparator(this.state.totalOutStand
)}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{formatSeparator(this.state.perBS
)}</Typography>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
src/container/MonthlyReport/ListOfCreditFacilitiesMR.js
View file @
7a2d368b
...
@@ -120,9 +120,11 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -120,9 +120,11 @@ export default class ListOfCreditFacilities extends Component {
perBSLOV
:
0
,
perBSLOV
:
0
,
snekbar
:
false
,
snekbar
:
false
,
snekbarMsg
:
''
,
snekbarMsg
:
''
,
visibleLOCFMR
:
true
,
visibleParent
:
true
,
buttonError
:
false
,
saveDraft
:
true
,
saveDraft
:
true
,
saveComp
:
true
,
saveComp
:
true
,
saveCompLOV
:
true
,
get_for
:
'view'
,
get_for
:
'view'
,
updateBy
:
[],
updateBy
:
[],
notes
:
""
,
notes
:
""
,
...
@@ -153,14 +155,16 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -153,14 +155,16 @@ export default class ListOfCreditFacilities extends Component {
})
})
}
}
dataTableForChild
(
data
,
array
,
params
,
type
)
{
dataTableForChild
(
data
,
array
,
params
,
type
,
visibleView
)
{
console
.
log
(
visibleView
);
console
.
log
(
type
);
switch
(
params
)
{
switch
(
params
)
{
case
"LOV"
:
case
"LOV"
:
console
.
log
(
data
);
console
.
log
(
data
);
this
.
setState
({
dataTableLOV
:
data
,
diffLOV
:
array
[
16
],
perBSLOV
:
array
[
18
],
tambahLOV
:
type
})
this
.
setState
({
dataTableLOV
:
data
,
diffLOV
:
array
[
16
],
perBSLOV
:
array
[
18
],
tambahLOV
:
type
,
visibleParent
:
visibleView
==
undefined
?
true
:
visibleView
})
break
;
break
;
case
"LOCF"
:
case
"LOCF"
:
this
.
setState
({
dataTableLOCF
:
data
,
diffLOCF
:
array
[
46
],
perBSLOCF
:
array
[
48
],
tambah
:
type
})
this
.
setState
({
dataTableLOCF
:
data
,
diffLOCF
:
array
[
46
],
perBSLOCF
:
array
[
48
],
tambah
:
type
,
visibleParent
:
visibleView
==
undefined
?
true
:
visibleView
})
break
break
default
:
default
:
break
;
break
;
...
@@ -266,7 +270,7 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -266,7 +270,7 @@ export default class ListOfCreditFacilities extends Component {
})
})
}
else
{
}
else
{
this
.
setState
({
submissionID
:
null
,
loading
:
false
,
visibleLOCFMR
:
true
})
this
.
setState
({
submissionID
:
null
,
loading
:
false
})
}
}
}
}
})
})
...
@@ -274,6 +278,7 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -274,6 +278,7 @@ export default class ListOfCreditFacilities extends Component {
backToMonthlyReportLOCF
(
type
)
{
backToMonthlyReportLOCF
(
type
)
{
// this.setState({ loading: true })
// this.setState({ loading: true })
console
.
log
(
'kok kesiniii'
);
let
dataTable2
=
this
.
state
.
dataTablelocf
==
undefined
||
this
.
state
.
tambah
==
'tambah'
||
this
.
state
.
tambah
==
'upload'
?
this
.
state
.
dataTableLOCF
:
this
.
state
.
dataTablelocf
let
dataTable2
=
this
.
state
.
dataTablelocf
==
undefined
||
this
.
state
.
tambah
==
'tambah'
||
this
.
state
.
tambah
==
'upload'
?
this
.
state
.
dataTableLOCF
:
this
.
state
.
dataTablelocf
let
data
=
[]
let
data
=
[]
let
error
=
false
let
error
=
false
...
@@ -401,46 +406,46 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -401,46 +406,46 @@ export default class ListOfCreditFacilities extends Component {
"total_loan"
:
this
.
state
.
perBSLOCF
"total_loan"
:
this
.
state
.
perBSLOCF
}
}
console
.
log
(
JSON
.
stringify
(
payload
)
)
console
.
log
(
payload
)
if
(
error
&&
type
==
'submitted'
)
{
// if (error && type == 'submitted') {
this
.
setState
({
handleDoubleClick
:
0
,
saveDraft
:
false
,
saveComp
:
true
,
loading
:
false
,
snekbar
:
true
,
snekbarMsg
:
'Data Incomplete'
,
handleDoubleClick
:
0
})
// this.setState({ handleDoubleClick: 0, saveDraft: false, saveComp: true, loading: false, snekbar: true, snekbarMsg: 'Data Incomplete', handleDoubleClick: 0 })
}
else
{
// } else {
api
.
create
(
'UPLOAD'
).
createMonthlyReportLOCF
(
payload
).
then
(
response
=>
{
// api.create('UPLOAD').createMonthlyReportLOCF(payload).then(response => {
console
.
log
(
response
);
// console.log(response);
if
(
response
.
data
)
{
// if (response.data) {
if
(
response
.
data
.
status
===
"success"
)
{
// if (response.data.status === "success") {
this
.
props
.
saveToMonthlyReport
(
'LOCF'
)
// this.props.saveToMonthlyReport('LOCF')
}
else
{
// } else {
if
(
response
.
data
?.
message
==
"Please Set Up Rate Currency First"
)
{
// if (response.data?.message == "Please Set Up Rate Currency First") {
this
.
setState
({
visibleAlertSave
:
true
})
// this.setState({ visibleAlertSave: true })
}
else
{
// } else {
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
document
.
body
.
style
.
overflow
=
'unset'
;
// document.body.style.overflow = 'unset';
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
// if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout
(()
=>
{
// setTimeout(() => {
localStorage
.
removeItem
(
Constant
.
TOKEN
)
// localStorage.removeItem(Constant.TOKEN)
window
.
location
.
reload
();
// window.location.reload();
},
1000
);
// }, 1000);
}
// }
this
.
props
.
saveToMonthlyReport
()
})
}
}
// else {
// this.setState({ loading: false }, () => {
// this.props.saveToMonthlyReport()
// this.props.saveToMonthlyReport()
// })
// })
// }
// }
}
else
{
// }
this
.
setState
({
loading
:
false
},
()
=>
{
// // else {
// this.getSubmission()
// // this.setState({ loading: false }, () => {
document
.
body
.
style
.
overflow
=
'unset'
;
// // this.props.saveToMonthlyReport()
})
// // })
}
// // }
this
.
setState
({
handleDoubleClick
:
0
})
// } else {
})
// this.setState({ loading: false }, () => {
}
// // this.getSubmission()
// document.body.style.overflow = 'unset';
// })
// }
// this.setState({ handleDoubleClick: 0 })
// })
// }
}
}
handleCalculateLOCF
=
()
=>
{
handleCalculateLOCF
=
()
=>
{
...
@@ -448,9 +453,11 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -448,9 +453,11 @@ export default class ListOfCreditFacilities extends Component {
let
dataTable2
=
this
.
state
.
dataTablelocf
==
undefined
||
this
.
state
.
tambah
==
'tambah'
||
this
.
state
.
tambah
==
'upload'
?
this
.
state
.
dataTableLOCF
:
this
.
state
.
dataTablelocf
let
dataTable2
=
this
.
state
.
dataTablelocf
==
undefined
||
this
.
state
.
tambah
==
'tambah'
||
this
.
state
.
tambah
==
'upload'
?
this
.
state
.
dataTableLOCF
:
this
.
state
.
dataTablelocf
let
data
=
[]
let
data
=
[]
let
error
=
false
let
error
=
false
console
.
log
(
dataTable2
);
let
bankNameEmpty
=
false
dataTable2
.
map
(
i
=>
{
dataTable2
.
map
(
i
=>
{
console
.
log
(
i
[
12
]);
if
(
i
[
6
]
==
null
)
{
bankNameEmpty
=
true
}
if
(
i
[
0
]
==
3
)
{
if
(
i
[
0
]
==
3
)
{
if
(
i
[
6
]
==
null
||
i
[
7
]
==
null
||
i
[
8
]
==
""
||
i
[
9
]
==
""
||
i
[
10
]
==
""
||
i
[
11
]
==
""
)
{
if
(
i
[
6
]
==
null
||
i
[
7
]
==
null
||
i
[
8
]
==
""
||
i
[
9
]
==
""
||
i
[
10
]
==
""
||
i
[
11
]
==
""
)
{
error
=
true
error
=
true
...
@@ -701,9 +708,22 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -701,9 +708,22 @@ export default class ListOfCreditFacilities extends Component {
}
}
}
}
})
})
console
.
log
(
error
);
let
lastArrayLOCF
=
dataTablelocf
[
res
.
length
-
1
]
let
lastArrayLOCF
=
dataTablelocf
[
res
.
length
-
1
]
this
.
setState
({
dataTablelocf
,
diffLOCF
:
lastArrayLOCF
[
46
],
perBSLOCF
:
lastArrayLOCF
[
48
],
visibleLOCFMR
:
true
,
loading
:
false
},
()
=>
{
if
(
bankNameEmpty
)
{
if
(
this
.
state
.
get_for
==
'view'
)
{
this
.
setState
({
saveDraft
:
false
,
saveComp
:
true
})
}
else
{
this
.
setState
({
saveDraft
:
false
,
saveComp
:
true
})
}
}
else
{
if
(
this
.
state
.
get_for
==
'view'
)
{
console
.
log
(
"view"
);
}
else
{
this
.
setState
({
saveDraft
:
false
,
saveComp
:
lastArrayLOCF
[
46
]
==
0
||
lastArrayLOCF
[
46
]
==
'0.0'
||
lastArrayLOCF
[
46
]
==
"-0.0"
?
false
:
true
})
}
}
this
.
setState
({
dataTablelocf
,
diffLOCF
:
lastArrayLOCF
[
46
],
perBSLOCF
:
lastArrayLOCF
[
48
],
loading
:
false
},
()
=>
{
this
.
handleCalculateLOV
()
this
.
handleCalculateLOV
()
})
})
}
}
...
@@ -712,13 +732,17 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -712,13 +732,17 @@ export default class ListOfCreditFacilities extends Component {
}
}
handleCalculateLOV
=
()
=>
{
handleCalculateLOV
=
()
=>
{
console
.
log
(
this
.
state
.
visibleParent
);
this
.
setState
({
loading
:
true
})
this
.
setState
({
loading
:
true
})
console
.
log
(
this
.
state
.
dataTablelov
);
console
.
log
(
this
.
state
.
dataTableLOV
);
let
dataTable2
=
this
.
state
.
dataTablelov
==
undefined
||
this
.
state
.
tambahLOV
==
'tambah'
||
this
.
state
.
tambahLOV
==
'upload'
?
this
.
state
.
dataTableLOV
:
this
.
state
.
dataTablelov
let
dataTable2
=
this
.
state
.
dataTablelov
==
undefined
||
this
.
state
.
tambahLOV
==
'tambah'
||
this
.
state
.
tambahLOV
==
'upload'
?
this
.
state
.
dataTableLOV
:
this
.
state
.
dataTablelov
let
data
=
[]
let
data
=
[]
let
error
=
false
let
error
=
false
let
bankNameEmpty
=
false
console
.
log
(
dataTable2
);
dataTable2
.
map
(
i
=>
{
dataTable2
.
map
(
i
=>
{
if
(
i
[
6
]
==
null
)
{
bankNameEmpty
=
true
}
if
(
i
[
0
]
==
3
)
{
if
(
i
[
0
]
==
3
)
{
if
(
i
[
6
]
==
null
||
i
[
7
]
==
null
||
i
[
8
]
==
""
||
i
[
9
]
==
""
||
i
[
10
]
==
""
||
i
[
11
]
==
""
||
i
[
12
]
==
""
)
{
if
(
i
[
6
]
==
null
||
i
[
7
]
==
null
||
i
[
8
]
==
""
||
i
[
9
]
==
""
||
i
[
10
]
==
""
||
i
[
11
]
==
""
||
i
[
12
]
==
""
)
{
error
=
true
error
=
true
...
@@ -849,9 +873,21 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -849,9 +873,21 @@ export default class ListOfCreditFacilities extends Component {
}
}
}
}
})
})
console
.
log
(
dataTablelov
);
let
lastArrayLOV
=
dataTablelov
[
res
.
length
-
1
]
let
lastArrayLOV
=
dataTablelov
[
res
.
length
-
1
]
this
.
setState
({
dataTablelov
,
diffLOV
:
lastArrayLOV
[
16
],
perBSLOV
:
lastArrayLOV
[
18
],
loading
:
false
,
visibleLOCFMR
:
true
,
loadingChild
:
false
},
()
=>
{
if
(
bankNameEmpty
)
{
if
(
this
.
state
.
get_for
==
'view'
)
{
this
.
setState
({
saveDraft
:
false
,
saveCompLOV
:
true
})
}
else
{
this
.
setState
({
saveDraft
:
false
,
saveCompLOV
:
true
})
}
}
else
{
if
(
this
.
state
.
get_for
==
'view'
)
{
console
.
log
(
"view"
);
}
else
{
this
.
setState
({
saveDraft
:
false
,
saveCompLOV
:
lastArrayLOV
[
16
]
==
0
||
lastArrayLOV
[
16
]
==
'0.0'
||
lastArrayLOV
[
16
]
==
"-0.0"
?
false
:
true
})
}
}
this
.
setState
({
dataTablelov
,
diffLOV
:
lastArrayLOV
[
16
],
perBSLOV
:
lastArrayLOV
[
18
],
loading
:
false
,
loadingChild
:
false
},
()
=>
{
// this.handleCalculateLOV()
// this.handleCalculateLOV()
})
})
}
else
{
}
else
{
...
@@ -862,10 +898,13 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -862,10 +898,13 @@ export default class ListOfCreditFacilities extends Component {
}
}
uploadLOCF
(
type
)
{
uploadLOCF
(
type
)
{
console
.
log
(
'masooook'
);
let
dataTable2
=
this
.
state
.
dataTablelocf
==
undefined
||
this
.
state
.
tambah
==
'tambah'
||
this
.
state
.
tambah
==
'upload'
?
this
.
state
.
dataTableLOCF
:
this
.
state
.
dataTablelocf
let
data
=
[]
let
data
=
[]
let
error
=
false
let
error
=
false
this
.
deleteReport
()
// this.deleteReport()
this
.
state
.
dataTable
.
map
(
i
=>
{
console
.
log
(
dataTable2
);
dataTable2
.
map
(
i
=>
{
if
(
i
[
0
]
==
3
)
{
if
(
i
[
0
]
==
3
)
{
if
(
i
[
6
]
==
null
||
i
[
7
]
==
null
||
i
[
8
]
==
""
||
i
[
9
]
==
""
||
i
[
10
]
==
""
||
i
[
11
]
==
""
)
{
if
(
i
[
6
]
==
null
||
i
[
7
]
==
null
||
i
[
8
]
==
""
||
i
[
9
]
==
""
||
i
[
10
]
==
""
||
i
[
11
]
==
""
)
{
error
=
true
error
=
true
...
@@ -989,48 +1028,43 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -989,48 +1028,43 @@ export default class ListOfCreditFacilities extends Component {
"diff"
:
this
.
state
.
diff
,
"diff"
:
this
.
state
.
diff
,
"total_loan"
:
this
.
state
.
perBS
"total_loan"
:
this
.
state
.
perBS
}
}
console
.
log
(
JSON
.
stringify
(
body
));
console
.
log
(
body
);
if
(
error
&&
type
==
'submitted'
)
{
// if (error && type == 'submitted') {
this
.
setState
({
handleDoubleClick
:
0
,
saveDraft
:
false
,
saveComp
:
true
,
loading
:
false
,
snekbar
:
true
,
snekbarMsg
:
'Data Incomplete'
,
handleDoubleClick
:
0
})
// this.setState({ handleDoubleClick: 0, saveDraft: false, saveComp: true, loading: false, snekbar: true, snekbarMsg: 'Data Incomplete', handleDoubleClick: 0 })
}
else
{
// } else {
api
.
create
(
'UPLOAD'
).
uploadMonthlyReportLOCF
(
body
).
then
(
response
=>
{
// api.create('UPLOAD').uploadMonthlyReportLOCF(body).then(response => {
console
.
log
(
response
);
// console.log(response);
if
(
response
.
data
)
{
// if (response.data) {
if
(
response
.
ok
)
{
// if (response.ok) {
if
(
response
.
data
.
status
===
"success"
)
{
// if (response.data.status === "success") {
this
.
props
.
saveToMonthlyReport
(
'LOCF'
)
// this.props.saveToMonthlyReport('LOCF')
// this.props.onClickClose()
// // this.props.onClickClose()
// this.props.getReport()
// // this.props.getReport()
}
else
{
// } else {
if
(
response
.
data
?.
message
==
"Please Set Up Rate Currency First"
)
{
// if (response.data?.message == "Please Set Up Rate Currency First") {
this
.
setState
({
visibleAlertSave
:
true
})
// this.setState({ visibleAlertSave: true })
}
else
{
// } else {
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
// if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout
(()
=>
{
// setTimeout(() => {
localStorage
.
removeItem
(
Constant
.
TOKEN
)
// localStorage.removeItem(Constant.TOKEN)
window
.
location
.
reload
();
// window.location.reload();
},
1000
);
// }, 1000);
}
})
}
// alert(response.data.status)
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
,
loading
:
false
,
handleDoubleClick
:
0
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
,
handleDoubleClick
:
0
})
}
this
.
setState
({
handleDoubleClick
:
0
})
})
}
}
// handleCalculateLOV = () => {
// let dataTable2 = this.state.dataTableLOV
// console.log(dataTable2);
// }
// }
// })
// }
// // alert(response.data.status)
// }
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false, handleDoubleClick: 0 })
// }
// } else {
// this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false, handleDoubleClick: 0 })
// }
// this.setState({ handleDoubleClick: 0 })
// })
// }
}
render
()
{
render
()
{
let
dataTable2
=
this
.
state
.
dataTable
let
dataTable2
=
this
.
state
.
dataTable
...
@@ -1067,7 +1101,7 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -1067,7 +1101,7 @@ export default class ListOfCreditFacilities extends Component {
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Monthly
Report
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Monthly
Report
<
/Typography
>
<
/div
>
<
/div
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
{
this
.
state
.
visible
LOCFMR
?
{
this
.
state
.
visible
Parent
?
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
<
Snackbar
open
=
{
this
.
state
.
snekbar
}
autoHideDuration
=
{
3000
}
onClose
=
{
handleClose
}
>
<
Snackbar
open
=
{
this
.
state
.
snekbar
}
autoHideDuration
=
{
3000
}
onClose
=
{
handleClose
}
>
<
Alert
onClose
=
{
handleClose
}
severity
=
"error"
>
<
Alert
onClose
=
{
handleClose
}
severity
=
"error"
>
...
@@ -1210,7 +1244,7 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -1210,7 +1244,7 @@ export default class ListOfCreditFacilities extends Component {
type
=
"button"
type
=
"button"
// disabled={this.state.buttonError}
// disabled={this.state.buttonError}
onClick
=
{()
=>
onClick
=
{()
=>
this
.
state
.
saveComp
||
this
.
state
.
saveTambahan
?
this
.
state
.
saveComp
||
this
.
state
.
save
CompLOV
||
this
.
state
.
save
Tambahan
?
this
.
setState
({
snekbar
:
true
,
snekbarMsg
:
'Data Incomplete / Diff must be 0'
})
this
.
setState
({
snekbar
:
true
,
snekbarMsg
:
'Data Incomplete / Diff must be 0'
})
:
:
this
.
state
.
handleDoubleClick
==
1
?
null
:
this
.
state
.
handleDoubleClick
==
1
?
null
:
...
@@ -1261,6 +1295,7 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -1261,6 +1295,7 @@ export default class ListOfCreditFacilities extends Component {
width
=
{
this
.
props
.
width
}
width
=
{
this
.
props
.
width
}
sendToParent
=
{
this
.
dataTableForChild
.
bind
(
this
)}
sendToParent
=
{
this
.
dataTableForChild
.
bind
(
this
)}
dataTablelocf
=
{
this
.
state
.
dataTablelocf
}
dataTablelocf
=
{
this
.
state
.
dataTablelocf
}
loadingChild
=
{
this
.
state
.
loadingChild
}
/
>
/
>
<
hr
/>
<
hr
/>
<
LOV
<
LOV
...
@@ -1278,8 +1313,8 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -1278,8 +1313,8 @@ export default class ListOfCreditFacilities extends Component {
height
=
{
this
.
props
.
height
}
height
=
{
this
.
props
.
height
}
width
=
{
this
.
props
.
width
}
width
=
{
this
.
props
.
width
}
sendToParent
=
{
this
.
dataTableForChild
.
bind
(
this
)}
sendToParent
=
{
this
.
dataTableForChild
.
bind
(
this
)}
sendDataTable
=
{
this
.
olahDataTable
.
bind
(
this
)}
dataTablelov
=
{
this
.
state
.
dataTablelov
}
dataTablelov
=
{
this
.
state
.
dataTablelov
}
loadingChild
=
{
this
.
state
.
loadingChild
}
/
>
/
>
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
<
div
className
=
"col-1"
>
<
div
className
=
"col-1"
>
...
@@ -1354,7 +1389,7 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -1354,7 +1389,7 @@ export default class ListOfCreditFacilities extends Component {
type
=
"button"
type
=
"button"
// disabled={this.state.buttonError}
// disabled={this.state.buttonError}
onClick
=
{()
=>
onClick
=
{()
=>
this
.
state
.
saveComp
||
this
.
state
.
saveTambahan
?
this
.
state
.
saveComp
||
this
.
state
.
save
CompLOV
||
this
.
state
.
save
Tambahan
?
this
.
setState
({
snekbar
:
true
,
snekbarMsg
:
'Data Incomplete / Diff must be 0'
})
this
.
setState
({
snekbar
:
true
,
snekbarMsg
:
'Data Incomplete / Diff must be 0'
})
:
:
this
.
state
.
handleDoubleClick
==
1
?
null
:
this
.
state
.
handleDoubleClick
==
1
?
null
:
...
...
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