fix: delete linked payment ledger entries no source doc deletion
This commit is contained in:
parent
3c055f94e1
commit
70313df531
@ -205,6 +205,10 @@ class AccountsController(TransactionBase):
|
|||||||
def on_trash(self):
|
def on_trash(self):
|
||||||
# delete sl and gl entries on deletion of transaction
|
# delete sl and gl entries on deletion of transaction
|
||||||
if frappe.db.get_single_value("Accounts Settings", "delete_linked_ledger_entries"):
|
if frappe.db.get_single_value("Accounts Settings", "delete_linked_ledger_entries"):
|
||||||
|
ple = frappe.qb.DocType("Payment Ledger Entry")
|
||||||
|
frappe.qb.from_(ple).delete().where(
|
||||||
|
(ple.voucher_type == self.doctype) & (ple.voucher_no == self.name)
|
||||||
|
).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…
Reference in New Issue
Block a user