fix: Create new supplier for test case
diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
index 319808a..2610a69 100644
--- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
@@ -16,6 +16,7 @@
from erpnext.projects.doctype.project.test_project import make_project
from erpnext.accounts.doctype.account.test_account import get_inventory_account, create_account
from erpnext.stock.doctype.item.test_item import create_item
+from erpnext.buying.doctype.supplier.test_supplier import create_supplier
test_dependencies = ["Item", "Cost Center", "Payment Term", "Payment Terms Template"]
test_ignore = ["Serial No"]
@@ -955,11 +956,15 @@
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.buying.doctype.purchase_order.purchase_order import get_mapped_purchase_invoice
+ # create a new supplier to test
+ supplier = create_supplier(supplier_name = '_Test TDS Advance Supplier',
+ tax_withholding_category = 'TDS - 194 - Dividends - Individual')
+
# Update tax withholding category with current fiscal year and rate details
update_tax_witholding_category('_Test Company', 'TDS Payable - _TC', nowdate())
# Create Purchase Order with TDS applied
- po = create_purchase_order(do_not_save=1, rate=3000)
+ po = create_purchase_order(do_not_save=1, supplier=supplier.name, rate=3000)
po.apply_tds = 1
po.tax_withholding_category = 'TDS - 194 - Dividends - Individual'
po.save()
@@ -976,8 +981,8 @@
# Check GLE for Payment Entry
expected_gle = [
['_Test Account Excise Duty - _TC', 3000, 0],
- ['Cash - _TC', 0, 24000],
- ['Creditors - _TC', 24000, 0],
+ ['Cash - _TC', 0, 27000],
+ ['Creditors - _TC', 27000, 0],
['TDS Payable - _TC', 0, 3000],
]
@@ -1002,8 +1007,8 @@
expected_gle = [
['_Test Account Excise Duty - _TC', 0, 3000],
['Cost of Goods Sold - _TC', 30000, 0],
- ['Creditors - _TC', 0, 24000],
- ['TDS Payable - _TC', 6000, 3000],
+ ['Creditors - _TC', 0, 27000],
+ ['TDS Payable - _TC', 3000, 3000],
]
gl_entries = frappe.db.sql("""select account, debit, credit
diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py
index aaa98f2..3917196 100644
--- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py
+++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py
@@ -1111,7 +1111,7 @@
po.schedule_date = add_days(nowdate(), 1)
po.company = args.company or "_Test Company"
- po.supplier = args.customer or "_Test Supplier"
+ po.supplier = args.supplier or "_Test Supplier"
po.is_subcontracted = args.is_subcontracted or "No"
po.currency = args.currency or frappe.get_cached_value('Company', po.company, "default_currency")
po.conversion_factor = args.conversion_factor or 1