fix: unreconcile Bank Transaction on cancel of payment voucher
(cherry picked from commit 0a95b38166)
# Conflicts:
# erpnext/accounts/doctype/bank_transaction/bank_transaction.py
# erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
# erpnext/accounts/doctype/sales_invoice/sales_invoice.js
This commit is contained in:
@@ -1414,11 +1414,16 @@ class AccountsController(TransactionBase):
|
||||
reconcile_against_document(lst)
|
||||
|
||||
def on_cancel(self):
|
||||
from erpnext.accounts.doctype.bank_transaction.bank_transaction import (
|
||||
remove_from_bank_transaction,
|
||||
)
|
||||
from erpnext.accounts.utils import (
|
||||
cancel_exchange_gain_loss_journal,
|
||||
unlink_ref_doc_from_payment_entries,
|
||||
)
|
||||
|
||||
remove_from_bank_transaction(self.doctype, self.name)
|
||||
|
||||
if self.doctype in ["Sales Invoice", "Purchase Invoice", "Payment Entry", "Journal Entry"]:
|
||||
# Cancel Exchange Gain/Loss Journal before unlinking
|
||||
cancel_exchange_gain_loss_journal(self)
|
||||
|
||||
Reference in New Issue
Block a user