fix: on cancel for loan refund

(cherry picked from commit 13b7ed1e2c)
This commit is contained in:
Abhinav Raut
2022-07-08 17:58:36 +05:30
committed by Mergify
parent 0713a240a7
commit 8237d94b11

View File

@@ -3,7 +3,7 @@
import frappe
from frappe import _
from frappe.model.document import Document
from erpnext.controllers.accounts_controller import AccountsController
from frappe.utils import cint, getdate
import erpnext
@@ -13,7 +13,7 @@ from erpnext.loan_management.doctype.loan_repayment.loan_repayment import (
)
class LoanRefund(Document):
class LoanRefund(AccountsController):
"""
Add refund if total repayment is more than that is owed.
"""
@@ -50,7 +50,7 @@ class LoanRefund(Document):
def on_cancel(self):
self.update_outstanding_amount(cancel=1)
self.ignore_linked_doctypes = ["GL Entry"]
self.ignore_linked_doctypes = ["GL Entry", "Payment Ledger Entry"]
self.make_gl_entries(cancel=1)
def update_outstanding_amount(self, cancel=0):