fix: Reverse GL Entry on cancel fix

This commit is contained in:
Deepesh Garg 2020-05-02 18:05:33 +05:30
parent 1c8cbd07b8
commit cea4eeaa53
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ class PeriodClosingVoucher(AccountsController):
def on_cancel(self):
self.ignore_linked_doctypes = ('GL Entry', 'Stock Ledger Entry')
from erpnext.accounts.general_ledger import make_reverse_gl_entries
make_reverse_gl_entries(voucher_type="Period Closing Voucher", voucher_no=self.name, cancel=True)
make_reverse_gl_entries(voucher_type="Period Closing Voucher", voucher_no=self.name)
def validate_account_head(self):
closing_account_type = frappe.db.get_value("Account", self.closing_account_head, "root_type")

View File

@ -82,7 +82,7 @@ class Fees(AccountsController):
def on_cancel(self):
self.ignore_linked_doctypes = ('GL Entry', 'Stock Ledger Entry')
make_reverse_gl_entries(voucher_type=self.doctype, voucher_no=self.name, cancel=True)
make_reverse_gl_entries(voucher_type=self.doctype, voucher_no=self.name)
# frappe.db.set(self, 'status', 'Cancelled')