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
0930e0a2
Commit
0930e0a2
authored
Nov 21, 2023
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
up
parent
06b6ce22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
259 additions
and
259 deletions
+259
-259
ListOfCreditFacilitiesMR.js
src/container/MonthlyReport/ListOfCreditFacilitiesMR.js
+259
-259
No files found.
src/container/MonthlyReport/ListOfCreditFacilitiesMR.js
View file @
0930e0a2
...
...
@@ -749,265 +749,265 @@ export default class ListOfCreditFacilities extends Component {
let
dataTable2
=
this
.
state
.
dataTablelov
==
undefined
||
this
.
state
.
tambah
==
'tambah'
?
this
.
state
.
dataTableLOV
:
this
.
state
.
dataTablelov
let
data
=
[]
let
error
=
false
//
dataTable2.map(i => {
//
if (i[0] == 3) {
//
if (i[6] == null || i[7] == null || i[8] == "" || i[9] == "" || i[10] == "" || i[11] == "") {
//
error = true
//
}
//
if (i[7].value == 'Others' && i[18] == '') {
//
error = true
//
}
//
let tgl = String(i[9]).split('-')
//
let checkUndifined = tgl.findIndex((val) => val == undefined)
//
if (this.props.defaultCurrency.id == 2) {
//
data.push({
//
"item_report_id": i[1],
// "borrower_comp
_name": i[5],
// "bank
_name": i[6] == null ? [6] : i[6].value,
//
"type_of_credit": i[7] == null ? i[7] : i[7].value,
//
"remarks": i[8],
//
"loan_maturity_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])),
//
"interest": i[10] == "" ? "0.00" : i[10],
//
"currency": i[11],
//
"loan_plafond_amount_ori": Number(i[12]) == "" ? "0.0" : Number(i[12]),
//
"loan_plafond_amount_idr": Number(i[13]) == "" ? "0.0" : Number(i[13]),
//
"out_loan_ki_amount_ori": Number(i[14]) == "" ? "0.0" : Number(i[14]),
//
"out_loan_ki_amount_idr": Number(i[15]) == "" ? "0.0" : Number(i[15]),
//
"out_loan_kmk_amount_ori": Number(i[16]) == "" ? "0.0" : Number(i[16]),
//
"out_loan_kmk_amount_idr": Number(i[17]) == "" ? "0.0" : Number(i[17]),
//
"out_loan_other_type": i[18],
//
"out_loan_other_amount_ori": Number(i[19]) == "" ? "0.0" : Number(i[19]),
//
"out_loan_other_amount_idr": Number(i[20]) == "" ? "0.0" : Number(i[20]),
//
"total_out_loan_ori": Number(i[21]) == "" ? "0.0" : Number(i[21]),
//
"total_out_loan_idr": Number(i[22]) == "" ? "0.0" : Number(i[22]),
//
"remaining_plafond_ori": Number(i[23]) == "" ? "0.0" : Number(i[23]),
//
"remaining_plafond_idr": Number(i[24]) == "" ? "0.0" : Number(i[24]),
//
"current_ratio_financial": Number(i[25]) == "" ? "0.00" : Number(i[25]),
//
"current_ratio_current": Number(i[26]) == "" ? "0.00" : Number(i[26]),
//
"der_financial": Number(i[27]) == "" ? "0.00" : Number(i[27]),
//
"der_current": Number(i[28]) == "" ? "0.00" : Number(i[28]),
//
"debt_to_ebitda_financial": Number(i[29]) == "" ? "0.00" : Number(i[29]),
//
"debt_to_ebitda_current": Number(i[30]) == "" ? "0.00" : Number(i[30]),
//
"ebitda_to_interest_financial": Number(i[31]) == "" ? "0.00" : Number(i[31]),
//
"ebitda_to_interest_current": Number(i[32]) == "" ? "0.00" : Number(i[32]),
//
"other_ratio1_ratio_name": i[33],
//
"other_ratio1_financial": Number(i[34]) == "" ? "0.00" : Number(i[34]),
//
"other_ratio1_current": Number(i[35]) == "" ? "0.00" : Number(i[35]),
//
"other_ratio2_ratio_name": i[36],
//
"other_ratio2_financial": Number(i[37]) == "" ? "0.00" : Number(i[37]),
//
"other_ratio2_current": Number(i[38]) == "" ? "0.00" : Number(i[38]),
//
"other_ratio3_ratio_name": i[39],
//
"other_ratio3_financial": Number(i[40]) == "" ? "0.00" : Number(i[40]),
//
"other_ratio3_current": Number(i[41]) == "" ? "0.00" : Number(i[41]),
//
"other_ratio4_ratio_name": i[42],
//
"other_ratio4_financial": Number(i[43]) == "" ? "0.00" : Number(i[43]),
//
"other_ratio4_current": Number(i[44]) == "" ? "0.00" : Number(i[44]),
//
"notes": i[45],
//
})
//
} else {
//
data.push({
//
"item_report_id": i[1],
//
"borrower_comp_name": i[5],
//
"bank_name": i[6] == null ? [6] : i[6].value,
//
"type_of_credit": i[7] == null ? i[7] : i[7].value,
//
"remarks": i[8],
//
"loan_maturity_date": i[9] == undefined || i[9] == "null" || i[9] == null ? "" : (String(tgl[2]).length <= 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(i[9])),
//
"interest": i[10] == "" ? "0.00" : i[10],
//
"currency": i[11],
//
"loan_plafond_amount_ori": fixNumber(Number(i[12]), 1) == "" ? "0.0" : fixNumber(Number(i[12]), 1),
//
"loan_plafond_amount_idr": fixNumber(Number(i[13]), 1) == "" ? "0.0" : fixNumber(Number(i[13]), 1),
//
"out_loan_ki_amount_ori": fixNumber(Number(i[14]), 1) == "" ? "0.0" : fixNumber(Number(i[14]), 1),
//
"out_loan_ki_amount_idr": fixNumber(Number(i[15]), 1) == "" ? "0.0" : fixNumber(Number(i[15]), 1),
//
"out_loan_kmk_amount_ori": fixNumber(Number(i[16]), 1) == "" ? "0.0" : fixNumber(Number(i[16]), 1),
//
"out_loan_kmk_amount_idr": fixNumber(Number(i[17]), 1) == "" ? "0.0" : fixNumber(Number(i[17]), 1),
//
"out_loan_other_type": i[18],
//
"out_loan_other_amount_ori": fixNumber(Number(i[19]), 1) == "" ? "0.0" : fixNumber(Number(i[19]), 1),
//
"out_loan_other_amount_idr": fixNumber(Number(i[20]), 1) == "" ? "0.0" : fixNumber(Number(i[20]), 1),
//
"total_out_loan_ori": fixNumber(Number(i[21]), 1) == "" ? "0.0" : fixNumber(Number(i[21]), 1),
//
"total_out_loan_idr": fixNumber(Number(i[22]), 1) == "" ? "0.0" : fixNumber(Number(i[22]), 1),
//
"remaining_plafond_ori": fixNumber(Number(i[23]), 1) == "" ? "0.0" : fixNumber(Number(i[23]), 1),
//
"remaining_plafond_idr": fixNumber(Number(i[24]), 1) == "" ? "0.0" : fixNumber(Number(i[24]), 1),
//
"current_ratio_financial": fixNumber(Number(i[25]), 2) == "" ? "0.00" : fixNumber(Number(i[25]), 2),
//
"current_ratio_current": fixNumber(Number(i[26]), 2) == "" ? "0.00" : fixNumber(Number(i[26]), 2),
//
"der_financial": fixNumber(Number(i[27]), 2) == "" ? "0.00" : fixNumber(Number(i[27]), 2),
//
"der_current": fixNumber(Number(i[28]), 2) == "" ? "0.00" : fixNumber(Number(i[28]), 2),
//
"debt_to_ebitda_financial": fixNumber(Number(i[29]), 2) == "" ? "0.00" : fixNumber(Number(i[29]), 2),
//
"debt_to_ebitda_current": fixNumber(Number(i[30]), 2) == "" ? "0.00" : fixNumber(Number(i[30]), 2),
//
"ebitda_to_interest_financial": fixNumber(Number(i[31]), 2) == "" ? "0.00" : fixNumber(Number(i[31]), 2),
//
"ebitda_to_interest_current": fixNumber(Number(i[32]), 2) == "" ? "0.00" : fixNumber(Number(i[32]), 2),
//
"other_ratio1_ratio_name": i[33],
//
"other_ratio1_financial": fixNumber(Number(i[34]), 2) == "" ? "0.00" : fixNumber(Number(i[34]), 2),
//
"other_ratio1_current": fixNumber(Number(i[35]), 2) == "" ? "0.00" : fixNumber(Number(i[35]), 2),
//
"other_ratio2_ratio_name": i[36],
//
"other_ratio2_financial": fixNumber(Number(i[37]), 2) == "" ? "0.00" : fixNumber(Number(i[37]), 2),
//
"other_ratio2_current": fixNumber(Number(i[38]), 2) == "" ? "0.00" : fixNumber(Number(i[38]), 2),
//
"other_ratio3_ratio_name": i[39],
//
"other_ratio3_financial": fixNumber(Number(i[40]), 2) == "" ? "0.00" : fixNumber(Number(i[40]), 2),
//
"other_ratio3_current": fixNumber(Number(i[41]), 2) == "" ? "0.00" : fixNumber(Number(i[41]), 2),
//
"other_ratio4_ratio_name": i[42],
//
"other_ratio4_financial": fixNumber(Number(i[43]), 2) == "" ? "0.00" : fixNumber(Number(i[43]), 2),
//
"other_ratio4_current": fixNumber(Number(i[44]), 2) == "" ? "0.00" : fixNumber(Number(i[44]), 2),
//
"notes": i[45],
//
})
//
}
//
}
//
})
//
let body = {
//
"monthly_report_id": this.props.monthlyReportId,
//
"company_id": this.props.company.company_id,
//
"periode": this.props.periode,
//
"report_id": this.props.report_id,
//
"status": 'submitted',
//
"months": this.props.month.month_id,
//
"currency_id": this.props.defaultCurrency.id,
//
"locf": data,
//
"per_bs": this.state.perBS,
//
"diff": this.state.diff,
//
"total_loan": this.state.perBS
//
}
//
console.log(body);
//
api.create().validateSaveLOCF(body).then((response) => {
//
console.log(response);
//
let dataTablelov = []
//
if (response.data) {
//
let res = response.data.data
//
const handlePushChild = (item) => {
//
let indexIDzz = dataTablelov.findIndex((val) => val[1] === item.id)
//
let tgl = String(item.locf.loan_maturity_date).split('-')
//
if (indexIDzz === -1) {
//
dataTablelov.push([
//
item.type_report_id,
//
item.id,
//
item.parent,
//
item.formula,
//
item.level,
//
String(item.locf.bank_name).includes('Total') ? null : item.locf.borrower_comp_name === null || item.locf.borrower_comp_name === "" ? this.props.company.company_name : item.locf.borrower_comp_name,
//
item.locf.bank_name === null ? null : item.locf.bank_name === "" ? null : { value: item.locf.bank_name },
//
item.locf.type_of_credit === null ? null : item.locf.type_of_credit === "" ? null : { value: item.locf.type_of_credit },
//
item.locf.remarks === null || item.locf.remarks === "" ? "" : item.locf.remarks,
//
item.locf.loan_maturity_date == null || item.locf.loan_maturity_date == "" ? null : (item.locf.loan_maturity_date !== "null" ? String(tgl[2]).length > 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(item.locf.loan_maturity_date) : null),
//
item.locf.interest === null || item.locf.interest === "" ? "0.00" : item.locf.interest,
//
item.locf.currency === null || item.locf.currency === "" ? "" : item.locf.currency,
//
item.locf.loan_plafond_amount_ori,
//
item.locf.loan_plafond_amount_idr === null ? "0.0" : item.locf.loan_plafond_amount_idr === "" ? "0.0" : item.locf.loan_plafond_amount_idr,
//
item.locf.out_loan_ki_amount_ori,
//
item.locf.out_loan_ki_amount_idr === null ? "0.0" : item.locf.out_loan_ki_amount_idr === "" ? "0.0" : item.locf.out_loan_ki_amount_idr,
//
item.locf.out_loan_kmk_amount_ori,
//
item.locf.out_loan_kmk_amount_idr === null ? "0.0" : item.locf.out_loan_kmk_amount_idr === "" ? "0.0" : item.locf.out_loan_kmk_amount_idr,
//
item.locf.out_loan_other_type,
//
item.locf.out_loan_other_amount_ori,
//
item.locf.out_loan_other_amount_idr === null ? "0.0" : item.locf.out_loan_other_amount_idr === "" ? "0.0" : item.locf.out_loan_other_amount_idr,
//
item.locf.total_out_loan_ori === null ? "0.0" : item.locf.total_out_loan_ori === "" ? "0.0" : item.locf.total_out_loan_ori,
//
item.locf.total_out_loan_idr === null ? "0.0" : item.locf.total_out_loan_idr === "" ? "0.0" : item.locf.total_out_loan_idr,
//
item.locf.remaining_plafond_ori === null ? "0.0" : item.locf.remaining_plafond_ori === "" ? "0.0" : item.locf.remaining_plafond_ori,
//
item.locf.remaining_plafond_idr === null ? "0.0" : item.locf.remaining_plafond_idr === "" ? "0.0" : item.locf.remaining_plafond_idr,
//
item.locf.current_ratio_financial,
//
item.locf.current_ratio_current === null ? "0.0" : item.locf.current_ratio_current === "" ? "0.0" : item.locf.current_ratio_current,
//
item.locf.der_financial,
//
item.locf.der_current === null ? "0.0" : item.locf.der_current === "" ? "0.0" : item.locf.der_current,
//
item.locf.debt_to_ebitda_financial,
//
item.locf.debt_to_ebitda_current === null ? "0.0" : item.locf.debt_to_ebitda_current === "" ? "0.0" : item.locf.debt_to_ebitda_current,
//
item.locf.ebitda_to_interest_financial,
//
item.locf.ebitda_to_interest_current === null ? "0.0" : item.locf.ebitda_to_interest_current === "" ? "0.0" : item.locf.ebitda_to_interest_current,
//
item.locf.other_ratio1_ratio_name,
//
item.locf.other_ratio1_financial,
//
item.locf.other_ratio1_current === null ? "0.0" : item.locf.other_ratio1_current === "" ? "0.0" : item.locf.other_ratio1_current,
//
item.locf.other_ratio2_ratio_name,
//
item.locf.other_ratio2_financial,
//
item.locf.other_ratio2_current === null ? "0.0" : item.locf.other_ratio2_current === "" ? "0.0" : item.locf.other_ratio2_current,
//
item.locf.other_ratio3_ratio_name,
//
item.locf.other_ratio3_financial,
//
item.locf.other_ratio3_current === null ? "0.0" : item.locf.other_ratio3_current === "" ? "0.0" : item.locf.other_ratio3_current,
//
item.locf.other_ratio4_ratio_name,
//
item.locf.other_ratio4_financial,
//
item.locf.other_ratio4_current === null ? "0.0" : item.locf.other_ratio4_current === "" ? "0.0" : item.locf.other_ratio4_current,
//
item.locf.notes,
//
item.diff,
//
item.total_loan,
//
item.per_bs
//
// index
//
])
//
}
//
if (item.children !== null) {
//
if (item.children.length > 0) {
//
item.children.map((items, indexs) => {
//
handlePushChild(items)
//
})
//
}
//
}
//
}
//
res.map((item, index) => {
//
let tgl = String(item.locf.loan_maturity_date).split('-')
//
dataTablelov.push([
//
item.type_report_id,
//
item.id,
//
item.parent,
//
item.formula,
//
item.level,
//
String(item.locf.bank_name).includes('Total') ? null : item.locf.borrower_comp_name === null || item.locf.borrower_comp_name === "" ? this.props.company.company_name : item.locf.borrower_comp_name,
//
item.locf.bank_name === null ? null : item.locf.bank_name === "" ? null : { value: item.locf.bank_name },
//
item.locf.type_of_credit === null ? null : item.locf.type_of_credit === "" ? null : { value: item.locf.type_of_credit },
//
item.locf.remarks === null || item.locf.remarks === "" ? "" : item.locf.remarks,
//
item.locf.loan_maturity_date == null || item.locf.loan_maturity_date == "" ? null : (item.locf.loan_maturity_date !== "null" ? String(tgl[2]).length > 2 ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : String(item.locf.loan_maturity_date) : null),
//
item.locf.interest === null || item.locf.interest === "" ? "0.00" : item.locf.interest,
//
item.locf.currency === null || item.locf.currency === "" ? "" : item.locf.currency,
//
item.locf.loan_plafond_amount_ori,
//
item.locf.loan_plafond_amount_idr === null ? "0.0" : item.locf.loan_plafond_amount_idr === "" ? "0.0" : item.locf.loan_plafond_amount_idr,
//
item.locf.out_loan_ki_amount_ori,
//
item.locf.out_loan_ki_amount_idr === null ? "0.0" : item.locf.out_loan_ki_amount_idr === "" ? "0.0" : item.locf.out_loan_ki_amount_idr,
//
item.locf.out_loan_kmk_amount_ori,
//
item.locf.out_loan_kmk_amount_idr === null ? "0.0" : item.locf.out_loan_kmk_amount_idr === "" ? "0.0" : item.locf.out_loan_kmk_amount_idr,
//
item.locf.out_loan_other_type,
//
item.locf.out_loan_other_amount_ori,
//
item.locf.out_loan_other_amount_idr === null ? "0.0" : item.locf.out_loan_other_amount_idr === "" ? "0.0" : item.locf.out_loan_other_amount_idr,
//
item.locf.total_out_loan_ori === null ? "0.0" : item.locf.total_out_loan_ori === "" ? "0.0" : item.locf.total_out_loan_ori,
//
item.locf.total_out_loan_idr === null ? "0.0" : item.locf.total_out_loan_idr === "" ? "0.0" : item.locf.total_out_loan_idr,
//
item.locf.remaining_plafond_ori === null ? "0.0" : item.locf.remaining_plafond_ori === "" ? "0.0" : item.locf.remaining_plafond_ori,
//
item.locf.remaining_plafond_idr === null ? "0.0" : item.locf.remaining_plafond_idr === "" ? "0.0" : item.locf.remaining_plafond_idr,
//
item.locf.current_ratio_financial,
//
item.locf.current_ratio_current === null ? "0.0" : item.locf.current_ratio_current === "" ? "0.0" : item.locf.current_ratio_current,
//
item.locf.der_financial,
//
item.locf.der_current === null ? "0.0" : item.locf.der_current === "" ? "0.0" : item.locf.der_current,
//
item.locf.debt_to_ebitda_financial,
//
item.locf.debt_to_ebitda_current === null ? "0.0" : item.locf.debt_to_ebitda_current === "" ? "0.0" : item.locf.debt_to_ebitda_current,
//
item.locf.ebitda_to_interest_financial,
//
item.locf.ebitda_to_interest_current === null ? "0.0" : item.locf.ebitda_to_interest_current === "" ? "0.0" : item.locf.ebitda_to_interest_current,
//
item.locf.other_ratio1_ratio_name,
//
item.locf.other_ratio1_financial,
//
item.locf.other_ratio1_current === null ? "0.0" : item.locf.other_ratio1_current === "" ? "0.0" : item.locf.other_ratio1_current,
//
item.locf.other_ratio2_ratio_name,
//
item.locf.other_ratio2_financial,
//
item.locf.other_ratio2_current === null ? "0.0" : item.locf.other_ratio2_current === "" ? "0.0" : item.locf.other_ratio2_current,
//
item.locf.other_ratio3_ratio_name,
//
item.locf.other_ratio3_financial,
//
item.locf.other_ratio3_current === null ? "0.0" : item.locf.other_ratio3_current === "" ? "0.0" : item.locf.other_ratio3_current,
//
item.locf.other_ratio4_ratio_name,
//
item.locf.other_ratio4_financial,
//
item.locf.other_ratio4_current === null ? "0.0" : item.locf.other_ratio4_current === "" ? "0.0" : item.locf.other_ratio4_current,
//
item.locf.notes,
//
item.diff,
//
item.total_loan,
//
item.per_bs
//
// index
//
])
//
if (item.children !== null) {
//
if (item.children.length > 0) {
//
item.children.map((items, indexs) => {
//
handlePushChild(items)
//
})
//
}
//
}
//
})
// let lastArrayLOCF
= dataTablelov[res.length - 1]
//
this.setState({ dataTablelov, diff: lastArrayLOV[46], perBS: lastArrayLOV[48], loading: false, visibleLOVFMR: true }, () => {
//
// this.handleCalculateLOV()
//
})
//
console.log(this.state.diff);
//
}
//
})
dataTable2
.
map
(
i
=>
{
if
(
i
[
0
]
==
3
)
{
if
(
i
[
6
]
==
null
||
i
[
7
]
==
null
||
i
[
8
]
==
""
||
i
[
9
]
==
""
||
i
[
10
]
==
""
||
i
[
11
]
==
""
)
{
error
=
true
}
if
(
i
[
7
].
value
==
'Others'
&&
i
[
18
]
==
''
)
{
error
=
true
}
let
tgl
=
String
(
i
[
9
]).
split
(
'-'
)
let
checkUndifined
=
tgl
.
findIndex
((
val
)
=>
val
==
undefined
)
if
(
this
.
props
.
defaultCurrency
.
id
==
2
)
{
data
.
push
({
"item_report_id"
:
i
[
1
],
"company
_name"
:
i
[
5
],
"institution
_name"
:
i
[
6
]
==
null
?
[
6
]
:
i
[
6
].
value
,
"type_of_credit"
:
i
[
7
]
==
null
?
i
[
7
]
:
i
[
7
].
value
,
"remarks"
:
i
[
8
],
"loan_maturity_date"
:
i
[
9
]
==
undefined
||
i
[
9
]
==
"null"
||
i
[
9
]
==
null
?
""
:
(
String
(
tgl
[
2
]).
length
<=
2
?
tgl
[
2
]
+
'-'
+
tgl
[
1
]
+
'-'
+
tgl
[
0
]
:
String
(
i
[
9
])),
"interest"
:
i
[
10
]
==
""
?
"0.00"
:
i
[
10
],
"currency"
:
i
[
11
],
"loan_plafond_amount_ori"
:
Number
(
i
[
12
])
==
""
?
"0.0"
:
Number
(
i
[
12
]),
"loan_plafond_amount_idr"
:
Number
(
i
[
13
])
==
""
?
"0.0"
:
Number
(
i
[
13
]),
"out_loan_ki_amount_ori"
:
Number
(
i
[
14
])
==
""
?
"0.0"
:
Number
(
i
[
14
]),
"out_loan_ki_amount_idr"
:
Number
(
i
[
15
])
==
""
?
"0.0"
:
Number
(
i
[
15
]),
"out_loan_kmk_amount_ori"
:
Number
(
i
[
16
])
==
""
?
"0.0"
:
Number
(
i
[
16
]),
"out_loan_kmk_amount_idr"
:
Number
(
i
[
17
])
==
""
?
"0.0"
:
Number
(
i
[
17
]),
"out_loan_other_type"
:
i
[
18
],
"out_loan_other_amount_ori"
:
Number
(
i
[
19
])
==
""
?
"0.0"
:
Number
(
i
[
19
]),
"out_loan_other_amount_idr"
:
Number
(
i
[
20
])
==
""
?
"0.0"
:
Number
(
i
[
20
]),
"total_out_loan_ori"
:
Number
(
i
[
21
])
==
""
?
"0.0"
:
Number
(
i
[
21
]),
"total_out_loan_idr"
:
Number
(
i
[
22
])
==
""
?
"0.0"
:
Number
(
i
[
22
]),
"remaining_plafond_ori"
:
Number
(
i
[
23
])
==
""
?
"0.0"
:
Number
(
i
[
23
]),
"remaining_plafond_idr"
:
Number
(
i
[
24
])
==
""
?
"0.0"
:
Number
(
i
[
24
]),
"current_ratio_financial"
:
Number
(
i
[
25
])
==
""
?
"0.00"
:
Number
(
i
[
25
]),
"current_ratio_current"
:
Number
(
i
[
26
])
==
""
?
"0.00"
:
Number
(
i
[
26
]),
"der_financial"
:
Number
(
i
[
27
])
==
""
?
"0.00"
:
Number
(
i
[
27
]),
"der_current"
:
Number
(
i
[
28
])
==
""
?
"0.00"
:
Number
(
i
[
28
]),
"debt_to_ebitda_financial"
:
Number
(
i
[
29
])
==
""
?
"0.00"
:
Number
(
i
[
29
]),
"debt_to_ebitda_current"
:
Number
(
i
[
30
])
==
""
?
"0.00"
:
Number
(
i
[
30
]),
"ebitda_to_interest_financial"
:
Number
(
i
[
31
])
==
""
?
"0.00"
:
Number
(
i
[
31
]),
"ebitda_to_interest_current"
:
Number
(
i
[
32
])
==
""
?
"0.00"
:
Number
(
i
[
32
]),
"other_ratio1_ratio_name"
:
i
[
33
],
"other_ratio1_financial"
:
Number
(
i
[
34
])
==
""
?
"0.00"
:
Number
(
i
[
34
]),
"other_ratio1_current"
:
Number
(
i
[
35
])
==
""
?
"0.00"
:
Number
(
i
[
35
]),
"other_ratio2_ratio_name"
:
i
[
36
],
"other_ratio2_financial"
:
Number
(
i
[
37
])
==
""
?
"0.00"
:
Number
(
i
[
37
]),
"other_ratio2_current"
:
Number
(
i
[
38
])
==
""
?
"0.00"
:
Number
(
i
[
38
]),
"other_ratio3_ratio_name"
:
i
[
39
],
"other_ratio3_financial"
:
Number
(
i
[
40
])
==
""
?
"0.00"
:
Number
(
i
[
40
]),
"other_ratio3_current"
:
Number
(
i
[
41
])
==
""
?
"0.00"
:
Number
(
i
[
41
]),
"other_ratio4_ratio_name"
:
i
[
42
],
"other_ratio4_financial"
:
Number
(
i
[
43
])
==
""
?
"0.00"
:
Number
(
i
[
43
]),
"other_ratio4_current"
:
Number
(
i
[
44
])
==
""
?
"0.00"
:
Number
(
i
[
44
]),
"notes"
:
i
[
45
],
})
}
else
{
data
.
push
({
"item_report_id"
:
i
[
1
],
"borrower_comp_name"
:
i
[
5
],
"bank_name"
:
i
[
6
]
==
null
?
[
6
]
:
i
[
6
].
value
,
"type_of_credit"
:
i
[
7
]
==
null
?
i
[
7
]
:
i
[
7
].
value
,
"remarks"
:
i
[
8
],
"loan_maturity_date"
:
i
[
9
]
==
undefined
||
i
[
9
]
==
"null"
||
i
[
9
]
==
null
?
""
:
(
String
(
tgl
[
2
]).
length
<=
2
?
tgl
[
2
]
+
'-'
+
tgl
[
1
]
+
'-'
+
tgl
[
0
]
:
String
(
i
[
9
])),
"interest"
:
i
[
10
]
==
""
?
"0.00"
:
i
[
10
],
"currency"
:
i
[
11
],
"loan_plafond_amount_ori"
:
fixNumber
(
Number
(
i
[
12
]),
1
)
==
""
?
"0.0"
:
fixNumber
(
Number
(
i
[
12
]),
1
),
"loan_plafond_amount_idr"
:
fixNumber
(
Number
(
i
[
13
]),
1
)
==
""
?
"0.0"
:
fixNumber
(
Number
(
i
[
13
]),
1
),
"out_loan_ki_amount_ori"
:
fixNumber
(
Number
(
i
[
14
]),
1
)
==
""
?
"0.0"
:
fixNumber
(
Number
(
i
[
14
]),
1
),
"out_loan_ki_amount_idr"
:
fixNumber
(
Number
(
i
[
15
]),
1
)
==
""
?
"0.0"
:
fixNumber
(
Number
(
i
[
15
]),
1
),
"out_loan_kmk_amount_ori"
:
fixNumber
(
Number
(
i
[
16
]),
1
)
==
""
?
"0.0"
:
fixNumber
(
Number
(
i
[
16
]),
1
),
"out_loan_kmk_amount_idr"
:
fixNumber
(
Number
(
i
[
17
]),
1
)
==
""
?
"0.0"
:
fixNumber
(
Number
(
i
[
17
]),
1
),
"out_loan_other_type"
:
i
[
18
],
"out_loan_other_amount_ori"
:
fixNumber
(
Number
(
i
[
19
]),
1
)
==
""
?
"0.0"
:
fixNumber
(
Number
(
i
[
19
]),
1
),
"out_loan_other_amount_idr"
:
fixNumber
(
Number
(
i
[
20
]),
1
)
==
""
?
"0.0"
:
fixNumber
(
Number
(
i
[
20
]),
1
),
"total_out_loan_ori"
:
fixNumber
(
Number
(
i
[
21
]),
1
)
==
""
?
"0.0"
:
fixNumber
(
Number
(
i
[
21
]),
1
),
"total_out_loan_idr"
:
fixNumber
(
Number
(
i
[
22
]),
1
)
==
""
?
"0.0"
:
fixNumber
(
Number
(
i
[
22
]),
1
),
"remaining_plafond_ori"
:
fixNumber
(
Number
(
i
[
23
]),
1
)
==
""
?
"0.0"
:
fixNumber
(
Number
(
i
[
23
]),
1
),
"remaining_plafond_idr"
:
fixNumber
(
Number
(
i
[
24
]),
1
)
==
""
?
"0.0"
:
fixNumber
(
Number
(
i
[
24
]),
1
),
"current_ratio_financial"
:
fixNumber
(
Number
(
i
[
25
]),
2
)
==
""
?
"0.00"
:
fixNumber
(
Number
(
i
[
25
]),
2
),
"current_ratio_current"
:
fixNumber
(
Number
(
i
[
26
]),
2
)
==
""
?
"0.00"
:
fixNumber
(
Number
(
i
[
26
]),
2
),
"der_financial"
:
fixNumber
(
Number
(
i
[
27
]),
2
)
==
""
?
"0.00"
:
fixNumber
(
Number
(
i
[
27
]),
2
),
"der_current"
:
fixNumber
(
Number
(
i
[
28
]),
2
)
==
""
?
"0.00"
:
fixNumber
(
Number
(
i
[
28
]),
2
),
"debt_to_ebitda_financial"
:
fixNumber
(
Number
(
i
[
29
]),
2
)
==
""
?
"0.00"
:
fixNumber
(
Number
(
i
[
29
]),
2
),
"debt_to_ebitda_current"
:
fixNumber
(
Number
(
i
[
30
]),
2
)
==
""
?
"0.00"
:
fixNumber
(
Number
(
i
[
30
]),
2
),
"ebitda_to_interest_financial"
:
fixNumber
(
Number
(
i
[
31
]),
2
)
==
""
?
"0.00"
:
fixNumber
(
Number
(
i
[
31
]),
2
),
"ebitda_to_interest_current"
:
fixNumber
(
Number
(
i
[
32
]),
2
)
==
""
?
"0.00"
:
fixNumber
(
Number
(
i
[
32
]),
2
),
"other_ratio1_ratio_name"
:
i
[
33
],
"other_ratio1_financial"
:
fixNumber
(
Number
(
i
[
34
]),
2
)
==
""
?
"0.00"
:
fixNumber
(
Number
(
i
[
34
]),
2
),
"other_ratio1_current"
:
fixNumber
(
Number
(
i
[
35
]),
2
)
==
""
?
"0.00"
:
fixNumber
(
Number
(
i
[
35
]),
2
),
"other_ratio2_ratio_name"
:
i
[
36
],
"other_ratio2_financial"
:
fixNumber
(
Number
(
i
[
37
]),
2
)
==
""
?
"0.00"
:
fixNumber
(
Number
(
i
[
37
]),
2
),
"other_ratio2_current"
:
fixNumber
(
Number
(
i
[
38
]),
2
)
==
""
?
"0.00"
:
fixNumber
(
Number
(
i
[
38
]),
2
),
"other_ratio3_ratio_name"
:
i
[
39
],
"other_ratio3_financial"
:
fixNumber
(
Number
(
i
[
40
]),
2
)
==
""
?
"0.00"
:
fixNumber
(
Number
(
i
[
40
]),
2
),
"other_ratio3_current"
:
fixNumber
(
Number
(
i
[
41
]),
2
)
==
""
?
"0.00"
:
fixNumber
(
Number
(
i
[
41
]),
2
),
"other_ratio4_ratio_name"
:
i
[
42
],
"other_ratio4_financial"
:
fixNumber
(
Number
(
i
[
43
]),
2
)
==
""
?
"0.00"
:
fixNumber
(
Number
(
i
[
43
]),
2
),
"other_ratio4_current"
:
fixNumber
(
Number
(
i
[
44
]),
2
)
==
""
?
"0.00"
:
fixNumber
(
Number
(
i
[
44
]),
2
),
"notes"
:
i
[
45
],
})
}
}
})
let
body
=
{
"monthly_report_id"
:
this
.
props
.
monthlyReportId
,
"company_id"
:
this
.
props
.
company
.
company_id
,
"periode"
:
this
.
props
.
periode
,
"report_id"
:
this
.
props
.
report_id
,
"status"
:
'submitted'
,
"months"
:
this
.
props
.
month
.
month_id
,
"currency_id"
:
this
.
props
.
defaultCurrency
.
id
,
"locf"
:
data
,
"per_bs"
:
this
.
state
.
perBS
,
"diff"
:
this
.
state
.
diff
,
"total_loan"
:
this
.
state
.
perBS
}
console
.
log
(
body
);
api
.
create
().
validateSaveLOCF
(
body
).
then
((
response
)
=>
{
console
.
log
(
response
);
let
dataTablelov
=
[]
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
const
handlePushChild
=
(
item
)
=>
{
let
indexIDzz
=
dataTablelov
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
let
tgl
=
String
(
item
.
locf
.
loan_maturity_date
).
split
(
'-'
)
if
(
indexIDzz
===
-
1
)
{
dataTablelov
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
formula
,
item
.
level
,
String
(
item
.
locf
.
bank_name
).
includes
(
'Total'
)
?
null
:
item
.
locf
.
borrower_comp_name
===
null
||
item
.
locf
.
borrower_comp_name
===
""
?
this
.
props
.
company
.
company_name
:
item
.
locf
.
borrower_comp_name
,
item
.
locf
.
bank_name
===
null
?
null
:
item
.
locf
.
bank_name
===
""
?
null
:
{
value
:
item
.
locf
.
bank_name
},
item
.
locf
.
type_of_credit
===
null
?
null
:
item
.
locf
.
type_of_credit
===
""
?
null
:
{
value
:
item
.
locf
.
type_of_credit
},
item
.
locf
.
remarks
===
null
||
item
.
locf
.
remarks
===
""
?
""
:
item
.
locf
.
remarks
,
item
.
locf
.
loan_maturity_date
==
null
||
item
.
locf
.
loan_maturity_date
==
""
?
null
:
(
item
.
locf
.
loan_maturity_date
!==
"null"
?
String
(
tgl
[
2
]).
length
>
2
?
tgl
[
2
]
+
'-'
+
tgl
[
1
]
+
'-'
+
tgl
[
0
]
:
String
(
item
.
locf
.
loan_maturity_date
)
:
null
),
item
.
locf
.
interest
===
null
||
item
.
locf
.
interest
===
""
?
"0.00"
:
item
.
locf
.
interest
,
item
.
locf
.
currency
===
null
||
item
.
locf
.
currency
===
""
?
""
:
item
.
locf
.
currency
,
item
.
locf
.
loan_plafond_amount_ori
,
item
.
locf
.
loan_plafond_amount_idr
===
null
?
"0.0"
:
item
.
locf
.
loan_plafond_amount_idr
===
""
?
"0.0"
:
item
.
locf
.
loan_plafond_amount_idr
,
item
.
locf
.
out_loan_ki_amount_ori
,
item
.
locf
.
out_loan_ki_amount_idr
===
null
?
"0.0"
:
item
.
locf
.
out_loan_ki_amount_idr
===
""
?
"0.0"
:
item
.
locf
.
out_loan_ki_amount_idr
,
item
.
locf
.
out_loan_kmk_amount_ori
,
item
.
locf
.
out_loan_kmk_amount_idr
===
null
?
"0.0"
:
item
.
locf
.
out_loan_kmk_amount_idr
===
""
?
"0.0"
:
item
.
locf
.
out_loan_kmk_amount_idr
,
item
.
locf
.
out_loan_other_type
,
item
.
locf
.
out_loan_other_amount_ori
,
item
.
locf
.
out_loan_other_amount_idr
===
null
?
"0.0"
:
item
.
locf
.
out_loan_other_amount_idr
===
""
?
"0.0"
:
item
.
locf
.
out_loan_other_amount_idr
,
item
.
locf
.
total_out_loan_ori
===
null
?
"0.0"
:
item
.
locf
.
total_out_loan_ori
===
""
?
"0.0"
:
item
.
locf
.
total_out_loan_ori
,
item
.
locf
.
total_out_loan_idr
===
null
?
"0.0"
:
item
.
locf
.
total_out_loan_idr
===
""
?
"0.0"
:
item
.
locf
.
total_out_loan_idr
,
item
.
locf
.
remaining_plafond_ori
===
null
?
"0.0"
:
item
.
locf
.
remaining_plafond_ori
===
""
?
"0.0"
:
item
.
locf
.
remaining_plafond_ori
,
item
.
locf
.
remaining_plafond_idr
===
null
?
"0.0"
:
item
.
locf
.
remaining_plafond_idr
===
""
?
"0.0"
:
item
.
locf
.
remaining_plafond_idr
,
item
.
locf
.
current_ratio_financial
,
item
.
locf
.
current_ratio_current
===
null
?
"0.0"
:
item
.
locf
.
current_ratio_current
===
""
?
"0.0"
:
item
.
locf
.
current_ratio_current
,
item
.
locf
.
der_financial
,
item
.
locf
.
der_current
===
null
?
"0.0"
:
item
.
locf
.
der_current
===
""
?
"0.0"
:
item
.
locf
.
der_current
,
item
.
locf
.
debt_to_ebitda_financial
,
item
.
locf
.
debt_to_ebitda_current
===
null
?
"0.0"
:
item
.
locf
.
debt_to_ebitda_current
===
""
?
"0.0"
:
item
.
locf
.
debt_to_ebitda_current
,
item
.
locf
.
ebitda_to_interest_financial
,
item
.
locf
.
ebitda_to_interest_current
===
null
?
"0.0"
:
item
.
locf
.
ebitda_to_interest_current
===
""
?
"0.0"
:
item
.
locf
.
ebitda_to_interest_current
,
item
.
locf
.
other_ratio1_ratio_name
,
item
.
locf
.
other_ratio1_financial
,
item
.
locf
.
other_ratio1_current
===
null
?
"0.0"
:
item
.
locf
.
other_ratio1_current
===
""
?
"0.0"
:
item
.
locf
.
other_ratio1_current
,
item
.
locf
.
other_ratio2_ratio_name
,
item
.
locf
.
other_ratio2_financial
,
item
.
locf
.
other_ratio2_current
===
null
?
"0.0"
:
item
.
locf
.
other_ratio2_current
===
""
?
"0.0"
:
item
.
locf
.
other_ratio2_current
,
item
.
locf
.
other_ratio3_ratio_name
,
item
.
locf
.
other_ratio3_financial
,
item
.
locf
.
other_ratio3_current
===
null
?
"0.0"
:
item
.
locf
.
other_ratio3_current
===
""
?
"0.0"
:
item
.
locf
.
other_ratio3_current
,
item
.
locf
.
other_ratio4_ratio_name
,
item
.
locf
.
other_ratio4_financial
,
item
.
locf
.
other_ratio4_current
===
null
?
"0.0"
:
item
.
locf
.
other_ratio4_current
===
""
?
"0.0"
:
item
.
locf
.
other_ratio4_current
,
item
.
locf
.
notes
,
item
.
diff
,
item
.
total_loan
,
item
.
per_bs
// index
])
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
}
res
.
map
((
item
,
index
)
=>
{
let
tgl
=
String
(
item
.
locf
.
loan_maturity_date
).
split
(
'-'
)
dataTablelov
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
formula
,
item
.
level
,
String
(
item
.
locf
.
bank_name
).
includes
(
'Total'
)
?
null
:
item
.
locf
.
borrower_comp_name
===
null
||
item
.
locf
.
borrower_comp_name
===
""
?
this
.
props
.
company
.
company_name
:
item
.
locf
.
borrower_comp_name
,
item
.
locf
.
bank_name
===
null
?
null
:
item
.
locf
.
bank_name
===
""
?
null
:
{
value
:
item
.
locf
.
bank_name
},
item
.
locf
.
type_of_credit
===
null
?
null
:
item
.
locf
.
type_of_credit
===
""
?
null
:
{
value
:
item
.
locf
.
type_of_credit
},
item
.
locf
.
remarks
===
null
||
item
.
locf
.
remarks
===
""
?
""
:
item
.
locf
.
remarks
,
item
.
locf
.
loan_maturity_date
==
null
||
item
.
locf
.
loan_maturity_date
==
""
?
null
:
(
item
.
locf
.
loan_maturity_date
!==
"null"
?
String
(
tgl
[
2
]).
length
>
2
?
tgl
[
2
]
+
'-'
+
tgl
[
1
]
+
'-'
+
tgl
[
0
]
:
String
(
item
.
locf
.
loan_maturity_date
)
:
null
),
item
.
locf
.
interest
===
null
||
item
.
locf
.
interest
===
""
?
"0.00"
:
item
.
locf
.
interest
,
item
.
locf
.
currency
===
null
||
item
.
locf
.
currency
===
""
?
""
:
item
.
locf
.
currency
,
item
.
locf
.
loan_plafond_amount_ori
,
item
.
locf
.
loan_plafond_amount_idr
===
null
?
"0.0"
:
item
.
locf
.
loan_plafond_amount_idr
===
""
?
"0.0"
:
item
.
locf
.
loan_plafond_amount_idr
,
item
.
locf
.
out_loan_ki_amount_ori
,
item
.
locf
.
out_loan_ki_amount_idr
===
null
?
"0.0"
:
item
.
locf
.
out_loan_ki_amount_idr
===
""
?
"0.0"
:
item
.
locf
.
out_loan_ki_amount_idr
,
item
.
locf
.
out_loan_kmk_amount_ori
,
item
.
locf
.
out_loan_kmk_amount_idr
===
null
?
"0.0"
:
item
.
locf
.
out_loan_kmk_amount_idr
===
""
?
"0.0"
:
item
.
locf
.
out_loan_kmk_amount_idr
,
item
.
locf
.
out_loan_other_type
,
item
.
locf
.
out_loan_other_amount_ori
,
item
.
locf
.
out_loan_other_amount_idr
===
null
?
"0.0"
:
item
.
locf
.
out_loan_other_amount_idr
===
""
?
"0.0"
:
item
.
locf
.
out_loan_other_amount_idr
,
item
.
locf
.
total_out_loan_ori
===
null
?
"0.0"
:
item
.
locf
.
total_out_loan_ori
===
""
?
"0.0"
:
item
.
locf
.
total_out_loan_ori
,
item
.
locf
.
total_out_loan_idr
===
null
?
"0.0"
:
item
.
locf
.
total_out_loan_idr
===
""
?
"0.0"
:
item
.
locf
.
total_out_loan_idr
,
item
.
locf
.
remaining_plafond_ori
===
null
?
"0.0"
:
item
.
locf
.
remaining_plafond_ori
===
""
?
"0.0"
:
item
.
locf
.
remaining_plafond_ori
,
item
.
locf
.
remaining_plafond_idr
===
null
?
"0.0"
:
item
.
locf
.
remaining_plafond_idr
===
""
?
"0.0"
:
item
.
locf
.
remaining_plafond_idr
,
item
.
locf
.
current_ratio_financial
,
item
.
locf
.
current_ratio_current
===
null
?
"0.0"
:
item
.
locf
.
current_ratio_current
===
""
?
"0.0"
:
item
.
locf
.
current_ratio_current
,
item
.
locf
.
der_financial
,
item
.
locf
.
der_current
===
null
?
"0.0"
:
item
.
locf
.
der_current
===
""
?
"0.0"
:
item
.
locf
.
der_current
,
item
.
locf
.
debt_to_ebitda_financial
,
item
.
locf
.
debt_to_ebitda_current
===
null
?
"0.0"
:
item
.
locf
.
debt_to_ebitda_current
===
""
?
"0.0"
:
item
.
locf
.
debt_to_ebitda_current
,
item
.
locf
.
ebitda_to_interest_financial
,
item
.
locf
.
ebitda_to_interest_current
===
null
?
"0.0"
:
item
.
locf
.
ebitda_to_interest_current
===
""
?
"0.0"
:
item
.
locf
.
ebitda_to_interest_current
,
item
.
locf
.
other_ratio1_ratio_name
,
item
.
locf
.
other_ratio1_financial
,
item
.
locf
.
other_ratio1_current
===
null
?
"0.0"
:
item
.
locf
.
other_ratio1_current
===
""
?
"0.0"
:
item
.
locf
.
other_ratio1_current
,
item
.
locf
.
other_ratio2_ratio_name
,
item
.
locf
.
other_ratio2_financial
,
item
.
locf
.
other_ratio2_current
===
null
?
"0.0"
:
item
.
locf
.
other_ratio2_current
===
""
?
"0.0"
:
item
.
locf
.
other_ratio2_current
,
item
.
locf
.
other_ratio3_ratio_name
,
item
.
locf
.
other_ratio3_financial
,
item
.
locf
.
other_ratio3_current
===
null
?
"0.0"
:
item
.
locf
.
other_ratio3_current
===
""
?
"0.0"
:
item
.
locf
.
other_ratio3_current
,
item
.
locf
.
other_ratio4_ratio_name
,
item
.
locf
.
other_ratio4_financial
,
item
.
locf
.
other_ratio4_current
===
null
?
"0.0"
:
item
.
locf
.
other_ratio4_current
===
""
?
"0.0"
:
item
.
locf
.
other_ratio4_current
,
item
.
locf
.
notes
,
item
.
diff
,
item
.
total_loan
,
item
.
per_bs
// index
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
})
let
lastArrayLOV
=
dataTablelov
[
res
.
length
-
1
]
this
.
setState
({
dataTablelov
,
diff
:
lastArrayLOV
[
46
],
perBS
:
lastArrayLOV
[
48
],
loading
:
false
,
visibleLOVFMR
:
true
},
()
=>
{
// this.handleCalculateLOV()
})
console
.
log
(
this
.
state
.
diff
);
}
})
}
// handleCalculateLOV = () => {
...
...
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