diff --git a/lending/loan_management/doctype/loan_repayment/loan_repayment.py b/lending/loan_management/doctype/loan_repayment/loan_repayment.py index 62469fd1..d7fd0e9b 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(