diff --git a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py index a61f32c3d1e..8a8e186a826 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py @@ -79,9 +79,14 @@ class TestPeriodClosingVoucher(unittest.TestCase): rate=400, debit_to="Debtors - TPC", <<<<<<< HEAD +<<<<<<< HEAD ======= currency="USD" >>>>>>> 60915e874d (test: Update test cases for currency change validation) +======= + currency="USD", + customer="_Test Customer USD", +>>>>>>> 65232edfd5 (test: Update test cases) ) create_sales_invoice( company=company, @@ -91,9 +96,14 @@ class TestPeriodClosingVoucher(unittest.TestCase): rate=200, debit_to="Debtors - TPC", <<<<<<< HEAD +<<<<<<< HEAD ======= currency="USD" >>>>>>> 60915e874d (test: Update test cases for currency change validation) +======= + currency="USD", + customer="_Test Customer USD", +>>>>>>> 65232edfd5 (test: Update test cases) ) pcv = self.make_period_closing_voucher(submit=False) @@ -127,14 +137,17 @@ class TestPeriodClosingVoucher(unittest.TestCase): surplus_account = create_account() cost_center = create_cost_center("Test Cost Center 1") - create_sales_invoice( + si = create_sales_invoice( company=company, income_account="Sales - TPC", expense_account="Cost of Goods Sold - TPC", cost_center=cost_center, rate=400, debit_to="Debtors - TPC", + currency="USD", + customer="_Test Customer USD", ) + jv = make_journal_entry( account1="Cash - TPC", account2="Sales - TPC", diff --git a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py index 4b81a7d6a23..709f0a52eec 100644 --- a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py @@ -768,6 +768,41 @@ class TestPricingRule(unittest.TestCase): frappe.get_doc("Item Price", {"item_code": "Water Flask"}).delete() item.delete() +<<<<<<< HEAD +======= + def test_multiple_pricing_rules_with_min_qty(self): + make_pricing_rule( + discount_percentage=20, + selling=1, + priority=1, + min_qty=4, + apply_multiple_pricing_rules=1, + title="_Test Pricing Rule with Min Qty - 1", + ) + make_pricing_rule( + discount_percentage=10, + selling=1, + priority=2, + min_qty=4, + apply_multiple_pricing_rules=1, + title="_Test Pricing Rule with Min Qty - 2", + ) + + si = create_sales_invoice(do_not_submit=True, customer="_Test Customer 1", qty=1) + item = si.items[0] + item.stock_qty = 1 + si.save() + self.assertFalse(item.discount_percentage) + item.qty = 5 + item.stock_qty = 5 + si.save() + self.assertEqual(item.discount_percentage, 30) + si.delete() + + frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule with Min Qty - 1") + frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule with Min Qty - 2") + +>>>>>>> 65232edfd5 (test: Update test cases) test_dependencies = ["Campaign"]