mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-01 04:28:27 +00:00
test: test voucher subtype for sales invoice
(cherry picked from commit ad6cc352f1)
This commit is contained in:
@@ -4005,6 +4005,25 @@ class TestSalesInvoice(FrappeTestCase):
|
||||
si.submit()
|
||||
self.assertEqual(si.remarks, f"Against Customer Order Test PO dated {format_date(nowdate())}")
|
||||
|
||||
def test_gl_voucher_subtype(self):
|
||||
si = create_sales_invoice()
|
||||
gl_entries = frappe.get_all(
|
||||
"GL Entry",
|
||||
filters={"voucher_type": "Sales Invoice", "voucher_no": si.name},
|
||||
pluck="voucher_subtype",
|
||||
)
|
||||
|
||||
self.assertTrue(all([x == "Sales Invoice" for x in gl_entries]))
|
||||
|
||||
si = create_sales_invoice(is_return=1, qty=-1)
|
||||
gl_entries = frappe.get_all(
|
||||
"GL Entry",
|
||||
filters={"voucher_type": "Sales Invoice", "voucher_no": si.name},
|
||||
pluck="voucher_subtype",
|
||||
)
|
||||
|
||||
self.assertTrue(all([x == "Credit Note" for x in gl_entries]))
|
||||
|
||||
|
||||
def set_advance_flag(company, flag, default_account):
|
||||
frappe.db.set_value(
|
||||
|
||||
Reference in New Issue
Block a user