Skip to content

Commit

Permalink
Merge pull request #206 from Nihantra-Patel/company_filter_and_path
Browse files Browse the repository at this point in the history
fix: method name and company wise filter in accouts field
  • Loading branch information
deepeshgarg007 authored Oct 23, 2024
2 parents 84ce6e9 + d8e07d1 commit a548d58
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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())
)
Expand Down Expand Up @@ -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())
)
Expand Down
18 changes: 18 additions & 0 deletions lending/loan_management/doctype/loan_product/loan_product.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
};
});
});
}
});

Expand Down

0 comments on commit a548d58

Please sign in to comment.