fix: delete PLE containing invoice in against

(cherry picked from commit c1e1fd8829)
This commit is contained in:
Gursheen Anand
2024-02-22 15:12:02 +05:30
committed by Mergify
parent 05a9f766bc
commit 08459cef4a

View File

@@ -325,6 +325,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)