Added test cases

This commit is contained in:
Rohit Waghchaure
2019-04-01 01:02:06 +05:30
parent 5fa9a7a1b4
commit 9835c89e17
5 changed files with 57 additions and 10 deletions

View File

@@ -556,11 +556,13 @@ class AccountsController(TransactionBase):
from erpnext.accounts.utils import unlink_ref_doc_from_payment_entries
if self.doctype in ["Sales Invoice", "Purchase Invoice"]:
if self.is_return: return
if frappe.db.get_single_value('Accounts Settings', 'unlink_payment_on_cancellation_of_invoice'):
unlink_ref_doc_from_payment_entries(self)
elif self.doctype in ["Sales Order", "Purchase Order"]:
if frappe.db.get_single_value('Accounts Settings', 'unlink_advance_payment_on_cancellation_of_order'):
if frappe.db.get_single_value('Accounts Settings', 'unlink_advance_payment_on_cancelation_of_order'):
unlink_ref_doc_from_payment_entries(self)
def validate_multiple_billing(self, ref_dt, item_ref_dn, based_on, parentfield):