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
648fa4f7
Commit
648fa4f7
authored
Aug 01, 2023
by
Riri Novita
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev/staging-riri' into 'ENV-STAGING'
update locf See merge request
!1943
parents
5310ef9d
2b3c5ad7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
285 additions
and
24 deletions
+285
-24
ListOfCreditFacilitiesMR.js
src/container/MonthlyReport/ListOfCreditFacilitiesMR.js
+284
-20
OperatingIndicatorMR.js
src/container/MonthlyReport/OperatingIndicatorMR.js
+0
-2
ProfitLossMR.js
src/container/MonthlyReport/ProfitLossMR.js
+1
-2
No files found.
src/container/MonthlyReport/ListOfCreditFacilitiesMR.js
View file @
648fa4f7
...
@@ -122,7 +122,8 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -122,7 +122,8 @@ export default class ListOfCreditFacilities extends Component {
saveTambahan
:
true
,
saveTambahan
:
true
,
defaultCurrencyUpload
:
this
.
props
.
defaultCurrency
,
defaultCurrencyUpload
:
this
.
props
.
defaultCurrency
,
visibleAlertSave
:
false
,
visibleAlertSave
:
false
,
visibleButtonUpload
:
false
visibleButtonUpload
:
false
,
uploadData
:
false
}
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
this
.
fileHandlerSimulasi
=
this
.
fileHandlerSimulasi
.
bind
(
this
);
this
.
fileHandlerSimulasi
=
this
.
fileHandlerSimulasi
.
bind
(
this
);
...
@@ -762,6 +763,7 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -762,6 +763,7 @@ export default class ListOfCreditFacilities extends Component {
}
}
checkUploadSimulasi
()
{
checkUploadSimulasi
()
{
console
.
log
(
this
.
state
.
uploadData
);
let
payload
=
{
let
payload
=
{
...
this
.
state
.
payload
,
...
this
.
state
.
payload
,
currency_id
:
this
.
state
.
defaultCurrencyUpload
?.
id
currency_id
:
this
.
state
.
defaultCurrencyUpload
?.
id
...
@@ -1002,22 +1004,22 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -1002,22 +1004,22 @@ export default class ListOfCreditFacilities extends Component {
}
}
this
.
setState
({
loading
:
true
,
dataTable
:
[]
})
this
.
setState
({
loading
:
true
,
dataTable
:
[]
})
console
.
log
(
body
)
console
.
log
(
body
)
api
.
create
().
uploadSimulasiMRLOCF
(
body
).
then
(
response
=>
{
//
api.create().uploadSimulasiMRLOCF(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'
,
"simulasiLOCF"
)
//
this.props.saveToMonthlyReport('LOCF', "simulasiLOCF")
}
else
{
//
} else {
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
,
loading
:
false
})
//
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
//
}
}
else
{
//
} else {
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
,
loading
:
false
})
//
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
//
}
}
else
{
//
} else {
this
.
setState
({
alert
:
true
,
messageAlert
:
'Error saving data. Please try again'
,
tipeAlert
:
'error'
,
loading
:
false
})
//
this.setState({ alert: true, messageAlert: 'Error saving data. Please try again', tipeAlert: 'error', loading: false })
}
//
}
})
//
})
}
}
uploadLOCF
(
type
)
{
uploadLOCF
(
type
)
{
...
@@ -1762,6 +1764,233 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -1762,6 +1764,233 @@ export default class ListOfCreditFacilities extends Component {
})
})
}
}
handleCalculateSimulasi
=
()
=>
{
let
dataTable2
=
this
.
state
.
dataTable
this
.
setState
({
loading
:
true
,
uploadData
:
true
},
()
=>
{
let
bankPrev
=
""
let
idPrev
=
0
let
newData
=
[]
let
dataCoba
=
[]
let
bankNameEmpty
=
false
let
totalLoan
=
0
dataTable2
.
map
((
item
,
index
)
=>
{
if
(
item
[
0
]
!==
8
)
{
if
(
item
[
6
]
==
null
)
{
bankNameEmpty
=
true
}
else
{
let
groupName
=
String
(
item
[
6
].
value
).
split
(
"-"
)
let
indexAS
=
dataCoba
.
findIndex
((
val
)
=>
item
[
6
].
value
.
includes
(
val
.
groupName
))
if
(
indexAS
==
-
1
)
{
dataCoba
.
push
({
groupName
:
groupName
[
groupName
.
length
-
1
],
data
:
[
item
]
})
}
else
{
let
indexDD
=
dataCoba
[
indexAS
].
data
.
length
-
1
==
-
1
?
0
:
dataCoba
[
indexAS
].
data
.
length
-
1
if
(
String
(
dataCoba
[
indexAS
].
data
[
indexDD
]).
includes
(
'Total'
))
{
let
dataAwal
=
[]
let
dataAkhir
=
[]
dataAwal
=
dataCoba
[
indexAS
].
data
.
splice
(
0
,
dataCoba
[
indexAS
].
data
.
length
-
2
)
dataAkhir
=
dataCoba
[
indexAS
].
data
.
splice
(
dataCoba
[
indexAS
].
data
.
length
-
1
,
1
)
dataAwal
.
push
(
item
)
dataCoba
[
indexAS
].
data
=
dataAwal
.
concat
(
dataAkhir
)
}
else
{
dataCoba
[
indexAS
].
data
.
push
(
item
)
}
}
}
}
})
let
dataGabung
=
[]
if
(
!
bankNameEmpty
)
{
dataCoba
.
map
((
item
,
index
)
=>
{
item
.
data
.
map
((
items
,
index
)
=>
{
dataGabung
.
push
(
items
)
})
})
dataGabung
.
map
((
items
,
index
)
=>
{
if
(
items
[
0
]
==
3
)
{
this
.
props
.
defaultCurrency
.
id
==
1
?
totalLoan
+=
items
[
22
]
:
totalLoan
+=
items
[
21
]
}
if
(
bankPrev
!=
""
)
{
if
(
items
[
6
].
value
!==
bankPrev
)
{
bankPrev
=
items
[
6
].
value
if
(
items
[
6
].
value
==
'Grand Total'
)
{
// if (dataTable2.length > 2) {
// newData.push(items)
// } else {
if
(
String
(
dataGabung
[
index
-
1
][
6
].
value
).
includes
(
'Total '
))
{
newData
.
push
(
items
)
}
else
{
// if (String(dataGabung[index][6].value).includes('Total ')) {
// newData.push(items)
// } else {
// items[46] = index + 1
let
nameTotal
=
String
(
dataGabung
[
index
-
1
][
6
].
value
).
split
(
"-"
)
newData
.
push
([
8
,
""
,
""
,
""
,
""
,
""
,
{
value
:
'Total '
+
nameTotal
[
nameTotal
.
length
-
1
]
},
null
,
""
,
null
,
"0.00"
,
""
,
""
,
"0"
,
""
,
"0"
,
""
,
"0"
,
""
,
""
,
"0"
,
"0"
,
"0"
,
"0"
,
"0"
,
""
,
"0"
,
""
,
"0"
,
""
,
"0"
,
""
,
"0"
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
index
],
items
,
)
// }
}
// }
}
else
{
if
(
String
(
dataGabung
[
index
-
1
][
6
].
value
).
includes
(
'Total '
))
{
newData
.
push
(
items
)
}
else
{
if
(
String
(
dataGabung
[
index
][
6
].
value
).
includes
(
'Total '
))
{
newData
.
push
(
items
)
}
else
{
items
[
46
]
=
index
+
1
let
nameTotal
=
String
(
dataGabung
[
index
-
1
][
6
].
value
).
split
(
"-"
)
newData
.
push
([
8
,
""
,
""
,
""
,
""
,
""
,
{
value
:
'Total '
+
nameTotal
[
nameTotal
.
length
-
1
]
},
null
,
""
,
null
,
"0.00"
,
""
,
""
,
"0"
,
""
,
"0"
,
""
,
"0"
,
""
,
""
,
"0"
,
"0"
,
"0"
,
"0"
,
"0"
,
""
,
"0"
,
""
,
"0"
,
""
,
"0"
,
""
,
"0"
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
index
],
items
,
)
}
}
}
}
else
{
newData
.
push
(
items
)
}
}
else
{
bankPrev
=
items
[
6
].
value
idPrev
=
items
[
0
]
newData
.
push
(
items
)
}
})
}
else
{
if
(
this
.
state
.
get_for
==
'edit'
)
{
this
.
setState
({
snekbar
:
true
,
snekbarMsg
:
'Bank Names Cannot be Empty'
})
}
}
setTimeout
(()
=>
{
// console.log(dataCoba)
// console.log(dataGabung)
console
.
log
(
newData
)
// console.log(dataTampungBank)
console
.
log
(
Number
(
totalLoan
).
toFixed
(
1
));
console
.
log
(
this
.
state
.
perBS
)
console
.
log
(
this
.
state
.
diff
)
// console.log(bankNameEmpty)
// dataTable: newData, totalOutStand: newData[newData.length-1][22]
if
(
bankNameEmpty
)
{
if
(
this
.
state
.
get_for
==
'view'
)
{
this
.
setState
({
loading
:
false
,
dataTable
:
this
.
state
.
dataTable
,
diff
:
this
.
state
.
diff
==
null
?
"0.0"
:
Number
(
0
-
this
.
state
.
perBS
).
toFixed
(
1
),
perBS
:
this
.
state
.
totalOutStand
==
null
?
"0.0"
:
this
.
state
.
totalOutStand
,
saveDraft
:
false
,
saveComp
:
true
})
}
else
{
this
.
setState
({
loading
:
false
,
dataTable
:
this
.
state
.
dataTable
,
diff
:
Number
(
0
-
this
.
state
.
perBS
).
toFixed
(
1
),
saveDraft
:
false
,
saveComp
:
true
})
}
}
else
{
if
(
this
.
state
.
get_for
==
'view'
)
{
this
.
setState
({
loading
:
false
,
dataTable
:
newData
,
diff
:
this
.
state
.
diff
==
null
?
"0.0"
:
Number
(
Number
(
totalLoan
).
toFixed
(
1
)
-
this
.
state
.
perBS
).
toFixed
(
1
),
perBS
:
this
.
state
.
totalOutStand
==
null
?
"0.0"
:
this
.
state
.
totalOutStand
})
}
else
{
this
.
setState
({
loading
:
false
,
dataTable
:
newData
,
diff
:
Number
(
Number
(
totalLoan
).
toFixed
(
1
)
-
this
.
state
.
perBS
).
toFixed
(
1
),
saveDraft
:
false
,
saveComp
:
Number
(
Number
(
totalLoan
).
toFixed
(
1
)
-
this
.
state
.
perBS
)
==
0
||
Number
(
Number
(
totalLoan
).
toFixed
(
1
)
-
this
.
state
.
perBS
)
==
"-0.0"
?
false
:
true
},
()
=>
{
// alert(this.state.saveComp)
// console.log(Number(Number(totalLoan).toFixed(1) - this.state.perBS));
})
}
}
},
100
);
})
}
render
()
{
render
()
{
let
dataTable2
=
this
.
state
.
dataTable
let
dataTable2
=
this
.
state
.
dataTable
...
@@ -4579,14 +4808,49 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -4579,14 +4808,49 @@ export default class ListOfCreditFacilities extends Component {
<
/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"
>
<
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'
,
marginLeft
:
10
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Back
<
/Typography
>
<
/div
>
<
/button
>
<
/div
>
<
/div
>
{
/* {this.props.isApprover === true || this.state.dataTable.length == 0 ? null :
{
/* {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') ? */
}
(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%'
}}
>
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
<
button
<
button
className
=
"button"
type
=
"button"
type
=
"button"
// disabled={this.state.buttonError}
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
marginRight
:
20
}}
onClick
=
{()
=>
this
.
setState
({
totalOutStand
:
totalLoan
,
saveTambahan
:
false
},
()
=>
{
this
.
handleCalculateSimulasi
()
})}
>
<
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
type
=
"button"
disabled
=
{
this
.
state
.
uploadData
===
true
?
false
:
true
}
onClick
=
{()
=>
onClick
=
{()
=>
this
.
setState
({
handleDoubleClick
:
1
,
loading
:
true
},
()
=>
{
this
.
setState
({
handleDoubleClick
:
1
,
loading
:
true
},
()
=>
{
this
.
uploadSimulasi
(
'submitted'
)
this
.
uploadSimulasi
(
'submitted'
)
...
@@ -4599,7 +4863,7 @@ export default class ListOfCreditFacilities extends Component {
...
@@ -4599,7 +4863,7 @@ export default class ListOfCreditFacilities extends Component {
outline
:
'none'
,
outline
:
'none'
,
}}
}}
>
>
<
div
style
=
{{
backgroundColor
:
'#354960
'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
backgroundColor
:
this
.
state
.
uploadData
===
true
?
'#354960'
:
'#5559
'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
Data
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
Data
<
/Typography
>
<
/div
>
<
/div
>
<
/button
>
<
/button
>
...
...
src/container/MonthlyReport/OperatingIndicatorMR.js
View file @
648fa4f7
...
@@ -1220,7 +1220,6 @@ export default class OperatingIndicatorMR extends Component {
...
@@ -1220,7 +1220,6 @@ export default class OperatingIndicatorMR extends Component {
fixedDecimalScale
=
{
1
}
fixedDecimalScale
=
{
1
}
disabled
=
{
!
this
.
props
.
permission
.
create
||
!
this
.
props
.
permission
.
edit
||
this
.
state
.
get_for
==
'view'
}
disabled
=
{
!
this
.
props
.
permission
.
create
||
!
this
.
props
.
permission
.
edit
||
this
.
state
.
get_for
==
'view'
}
value
=
{
Number
(
tableMeta
.
rowData
[
10
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
10
]).
toFixed
(
1
)}
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
onBlur
=
{(
event
)
=>
{
handleChange
(
event
.
target
.
value
,
tableMeta
)
handleChange
(
event
.
target
.
value
,
tableMeta
)
}}
}}
...
@@ -1243,7 +1242,6 @@ export default class OperatingIndicatorMR extends Component {
...
@@ -1243,7 +1242,6 @@ export default class OperatingIndicatorMR extends Component {
disabled
=
{
true
}
disabled
=
{
true
}
decimalScale
=
{
1
}
decimalScale
=
{
1
}
value
=
{
Number
(
handleFormula
(
val
,
tableMeta
,
2
)).
toFixed
(
1
)}
value
=
{
Number
(
handleFormula
(
val
,
tableMeta
,
2
)).
toFixed
(
1
)}
decimalScale
=
{
1
}
/
>
/
>
}
}
/
>
/
>
...
...
src/container/MonthlyReport/ProfitLossMR.js
View file @
648fa4f7
...
@@ -1407,7 +1407,6 @@ export default class ProfitLossMR extends Component {
...
@@ -1407,7 +1407,6 @@ export default class ProfitLossMR extends Component {
disabled
=
{
true
}
disabled
=
{
true
}
decimalScale
=
{
1
}
decimalScale
=
{
1
}
value
=
{
Number
(
tableMeta
.
rowData
[
10
]).
toFixed
(
1
)}
value
=
{
Number
(
tableMeta
.
rowData
[
10
]).
toFixed
(
1
)}
decimalScale
=
{
1
}
/
>
/
>
:
:
tableMeta
.
rowData
[
0
]
===
3
?
tableMeta
.
rowData
[
0
]
===
3
?
...
@@ -1876,7 +1875,7 @@ export default class ProfitLossMR extends Component {
...
@@ -1876,7 +1875,7 @@ export default class ProfitLossMR extends Component {
control
=
{
control
=
{
<
NumberFormat
<
NumberFormat
thousandSeparator
=
{
true
}
thousandSeparator
=
{
true
}
style
=
{{
color
:
'red'
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
//
style={{ color: 'red', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
style
=
{{
color
:
Number
(
tableMeta
.
rowData
[
18
]).
toFixed
(
1
)
<
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
18
]).
toFixed
(
1
)
>
this
.
state
.
maxValue
?
'red'
:
'#000000b0'
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
style
=
{{
color
:
Number
(
tableMeta
.
rowData
[
18
]).
toFixed
(
1
)
<
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
18
]).
toFixed
(
1
)
>
this
.
state
.
maxValue
?
'red'
:
'#000000b0'
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
...
...
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