def test_payment_entry_unlink_against_invoice(self): from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry si = frappe.copy_doc(test_records[0]) si.is_pos = 0 si.insert() si.submit() pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Bank - _TC") pe.reference_no = "1" pe.reference_date = nowdate() pe.paid_from_account_currency = si.currency pe.paid_to_account_currency = si.currency pe.source_exchange_rate = 1 pe.target_exchange_rate = 1 pe.paid_amount = si.grand_total pe.insert() pe.submit() link_data = get_dynamic_link_map().get('Sales Invoice', []) link_doctypes = [d.parent for d in link_data] self.assertEquals(link_doctypes[-1], 'GL Entry') unlink_payment_on_cancel_of_invoice(0) si = frappe.get_doc('Sales Invoice', si.name) self.assertRaises(frappe.LinkExistsError, si.cancel)
def test_payment_entry_unlink_against_invoice(self): from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry si = frappe.copy_doc(test_records[0]) si.is_pos = 0 si.insert() si.submit() pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Bank - _TC") pe.reference_no = "1" pe.reference_date = nowdate() pe.paid_from_account_currency = si.currency pe.paid_to_account_currency = si.currency pe.source_exchange_rate = 1 pe.target_exchange_rate = 1 pe.paid_amount = si.grand_total pe.insert() pe.submit() unlink_payment_on_cancel_of_invoice(0) si = frappe.get_doc('Sales Invoice', si.name) self.assertRaises(frappe.LinkExistsError, si.cancel)
def tearDown(self): unlink_payment_on_cancel_of_invoice(0)
def setUp(self): unlink_payment_on_cancel_of_invoice()
def setUpClass(self): create_dunning_type() unlink_payment_on_cancel_of_invoice()
def setUpClass(self): create_dunning_type() create_dunning_type_with_zero_interest_rate() unlink_payment_on_cancel_of_invoice()