From 190bd45bd76a9e48a023514e09f5803964496edf Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Thu, 22 Feb 2024 15:12:02 +0530 Subject: [PATCH] fix: delete PLE containing invoice in against (cherry picked from commit c1e1fd882950352c61e5881076c34fe3436142c6) --- erpnext/controllers/accounts_controller.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index a4f1cbf5a4..e3c59d4dab 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -346,6 +346,7 @@ class AccountsController(TransactionBase): ple = frappe.qb.DocType("Payment Ledger Entry") frappe.qb.from_(ple).delete().where( (ple.voucher_type == self.doctype) & (ple.voucher_no == self.name) + | ((ple.against_voucher_type == self.doctype) & (ple.against_voucher_no == self.name)) ).run() frappe.db.sql( "delete from `tabGL Entry` where voucher_type=%s and voucher_no=%s", (self.doctype, self.name)