From 4dfb857dab57bd2678725e541fd6b6206791a5b0 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 11 Dec 2023 10:50:31 +0530 Subject: [PATCH] fix: Remove charges receivable GL Entries (cherry picked from commit 730b81a8e7d4b2f1f6301863b2b03426f1144a1d) --- .../doctype/loan_repayment/loan_repayment.py | 42 +------------------ 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/lending/loan_management/doctype/loan_repayment/loan_repayment.py b/lending/loan_management/doctype/loan_repayment/loan_repayment.py index 9d9a7908..9f324e9c 100644 --- a/lending/loan_management/doctype/loan_repayment/loan_repayment.py +++ b/lending/loan_management/doctype/loan_repayment/loan_repayment.py @@ -79,7 +79,7 @@ def make_credit_note(self): item_details = frappe.db.get_value( "Loan Product", self.loan_product, - ["charges_waiver_item", "charges_receivable_account"], + ["charges_waiver_item"], as_dict=1, ) @@ -105,7 +105,6 @@ def make_credit_note(self): si.set_missing_values() si.is_return = 1 si.loan = self.against_loan - si.debit_to = item_details.charges_receivable_account si.save() for tax in si.get("taxes"): tax.included_in_print_rate = 1 @@ -639,7 +638,6 @@ def make_gl_entries(self, cancel=0, adv_adj=0): "suspense_interest_receivable", "suspense_interest_income", "interest_income_account", - "charges_receivable_account", ], as_dict=1, ) @@ -684,44 +682,6 @@ def make_gl_entries(self, cancel=0, adv_adj=0): ) ) - if self.total_paid_charges and self.repayment_type != "Charges Waiver": - for charges in self.get("pending_charges"): - gle_map.append( - self.get_gl_dict( - { - "account": account_details.charges_receivable_account, - "party_type": self.applicant_type, - "party": self.applicant, - "against": payment_account, - "credit": charges.allocated_amount, - "credit_in_account_currency": charges.allocated_amount, - "against_voucher_type": "Sales Invoice", - "against_voucher": charges.sales_invoice, - "remarks": _(remarks), - "cost_center": self.cost_center, - "posting_date": getdate(self.posting_date), - } - ) - ) - - gle_map.append( - self.get_gl_dict( - { - "account": payment_account, - "against": account_details.charges_receivable_account, - "debit": charges.allocated_amount, - "debit_in_account_currency": charges.allocated_amount, - "against_voucher_type": "Loan", - "against_voucher": self.against_loan, - "remarks": _(remarks), - "cost_center": self.cost_center, - "posting_date": getdate(self.posting_date), - "party_type": payment_party_type, - "party": payment_party, - } - ) - ) - for repayment in self.get("repayment_details"): if repayment.paid_interest_amount: gle_map.append(