diff --git a/lending/loan_management/doctype/loan_application/loan_application.js b/lending/loan_management/doctype/loan_application/loan_application.js index b061884a..7080bf3f 100644 --- a/lending/loan_management/doctype/loan_application/loan_application.js +++ b/lending/loan_management/doctype/loan_application/loan_application.js @@ -71,7 +71,7 @@ frappe.ui.form.on('Loan Application', { } frappe.call({ - method: "lending.loan_management.doctype.loan_application.loan_application.create_loan_security_assignment_from_loan_application", + method: "lending.loan_management.doctype.loan_application.loan_application.create_loan_security_assignment", args: { loan_application: frm.doc.name }, diff --git a/lending/loan_management/doctype/loan_disbursement/test_loan_disbursement.py b/lending/loan_management/doctype/loan_disbursement/test_loan_disbursement.py index 41602b5c..7bc8c2a6 100644 --- a/lending/loan_management/doctype/loan_disbursement/test_loan_disbursement.py +++ b/lending/loan_management/doctype/loan_disbursement/test_loan_disbursement.py @@ -30,7 +30,7 @@ set_loan_settings_in_company, ) from lending.loan_management.doctype.loan_application.loan_application import ( - create_loan_security_assignment_from_loan_application, + create_loan_security_assignment, ) from lending.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import ( days_in_year, @@ -85,7 +85,7 @@ def test_loan_topup(self): loan_application = create_loan_application( "_Test Company", self.applicant, "Demand Loan", pledge ) - create_loan_security_assignment_from_loan_application(loan_application) + create_loan_security_assignment(loan_application) loan = create_demand_loan( self.applicant, "Demand Loan", loan_application, posting_date=get_first_day(nowdate()) @@ -134,7 +134,7 @@ def test_loan_topup_with_additional_pledge(self): loan_application = create_loan_application( "_Test Company", self.applicant, "Demand Loan", pledge ) - create_loan_security_assignment_from_loan_application(loan_application) + create_loan_security_assignment(loan_application) loan = create_demand_loan( self.applicant, "Demand Loan", loan_application, posting_date="2019-10-01" diff --git a/lending/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py b/lending/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py index 122fdc8d..587e55fe 100644 --- a/lending/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py +++ b/lending/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py @@ -18,7 +18,7 @@ set_loan_settings_in_company, ) from lending.loan_management.doctype.loan_application.loan_application import ( - create_loan_security_assignment_from_loan_application, + create_loan_security_assignment, ) from lending.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import ( days_in_year, @@ -93,7 +93,7 @@ def test_loan_interest_accural(self): loan_application = create_loan_application( "_Test Company", self.applicant, "Demand Loan", pledge ) - create_loan_security_assignment_from_loan_application(loan_application) + create_loan_security_assignment(loan_application) loan = create_demand_loan( self.applicant, "Demand Loan", loan_application, posting_date=get_first_day(nowdate()) ) @@ -188,7 +188,7 @@ def test_accumulated_amounts(self): loan_application = create_loan_application( "_Test Company", self.applicant, "Demand Loan", pledge ) - create_loan_security_assignment_from_loan_application(loan_application) + create_loan_security_assignment(loan_application) loan = create_demand_loan( self.applicant, "Demand Loan", loan_application, posting_date=get_first_day(nowdate()) ) diff --git a/lending/loan_management/doctype/loan_product/loan_product.js b/lending/loan_management/doctype/loan_product/loan_product.js index 7744ff90..5945312d 100644 --- a/lending/loan_management/doctype/loan_product/loan_product.js +++ b/lending/loan_management/doctype/loan_product/loan_product.js @@ -30,6 +30,24 @@ frappe.ui.form.on('Loan Product', { }; }); }); + + $.each(["subsidy_adjustment_account", "security_deposit_account", "suspense_collection_account", + "customer_refund_account", "interest_accrued_account", "interest_waiver_account", + "interest_receivable_account", "suspense_interest_income", "broken_period_interest_recovery_account", + "additional_interest_income", "additional_interest_accrued", "additional_interest_receivable", + "additional_interest_suspense", "additional_interest_waiver", "penalty_accrued_account", + "penalty_waiver_account", "penalty_receivable_account", "penalty_suspense_account", + "write_off_account", "write_off_recovery_account" + ], function (i, field) { + frm.set_query(field, function () { + return { + "filters": { + "company": frm.doc.company, + "is_group": 0 + } + }; + }); + }); } });