Merge branch 'develop' into refactor/report/process-loss-report

This commit is contained in:
Sagar Sharma 2022-09-11 19:15:16 +05:30 committed by GitHub
commit a86023eb09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -489,7 +489,6 @@ def make_reverse_gl_entries(
).run(as_dict=1) ).run(as_dict=1)
if gl_entries: if gl_entries:
create_payment_ledger_entry(gl_entries, cancel=1)
create_payment_ledger_entry( create_payment_ledger_entry(
gl_entries, cancel=1, adv_adj=adv_adj, update_outstanding=update_outstanding gl_entries, cancel=1, adv_adj=adv_adj, update_outstanding=update_outstanding
) )

View File

@ -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)
) )