fix: only check for delinked PLEs
(cherry picked from commit 146c5b3e16b0521f0590aa6dfa957979fc6f3d9a)
This commit is contained in:
parent
190bd45bd7
commit
a75a69a01e
@ -346,7 +346,12 @@ class AccountsController(TransactionBase):
|
|||||||
ple = frappe.qb.DocType("Payment Ledger Entry")
|
ple = frappe.qb.DocType("Payment Ledger Entry")
|
||||||
frappe.qb.from_(ple).delete().where(
|
frappe.qb.from_(ple).delete().where(
|
||||||
(ple.voucher_type == self.doctype) & (ple.voucher_no == self.name)
|
(ple.voucher_type == self.doctype) & (ple.voucher_no == self.name)
|
||||||
| ((ple.against_voucher_type == self.doctype) & (ple.against_voucher_no == self.name))
|
| (
|
||||||
|
(ple.against_voucher_type == self.doctype)
|
||||||
|
& (ple.against_voucher_no == self.name)
|
||||||
|
& ple.delinked
|
||||||
|
== 1
|
||||||
|
)
|
||||||
).run()
|
).run()
|
||||||
frappe.db.sql(
|
frappe.db.sql(
|
||||||
"delete from `tabGL Entry` where voucher_type=%s and voucher_no=%s", (self.doctype, self.name)
|
"delete from `tabGL Entry` where voucher_type=%s and voucher_no=%s", (self.doctype, self.name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user