From f3b9cfb43a67f6661a8d9fe0c9545c6aae674464 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Tue, 1 Oct 2024 10:46:29 +0530 Subject: [PATCH] chore: fix conflicts --- .../purchase_invoice/test_purchase_invoice.py | 62 ------------------- 1 file changed, 62 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index d0cd7b4cc86b..cf5bfedaebdd 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -2292,67 +2292,6 @@ def test_adjust_incoming_rate_from_pi_with_multi_currency(self): frappe.db.set_single_value("Buying Settings", "maintain_same_rate", 1) -<<<<<<< HEAD -======= - def test_opening_invoice_rounding_adjustment_validation(self): - pi = make_purchase_invoice(do_not_save=1) - pi.items[0].rate = 99.98 - pi.items[0].qty = 1 - pi.items[0].expense_account = "Temporary Opening - _TC" - pi.is_opening = "Yes" - pi.save() - self.assertRaises(frappe.ValidationError, pi.submit) - - def _create_opening_roundoff_account(self, company_name): - liability_root = frappe.db.get_all( - "Account", - filters={"company": company_name, "root_type": "Liability", "disabled": 0}, - order_by="lft", - limit=1, - )[0] - - # setup round off account - if acc := frappe.db.exists( - "Account", - { - "account_name": "Round Off for Opening", - "account_type": "Round Off for Opening", - "company": company_name, - }, - ): - frappe.db.set_value("Company", company_name, "round_off_for_opening", acc) - else: - acc = frappe.new_doc("Account") - acc.company = company_name - acc.parent_account = liability_root.name - acc.account_name = "Round Off for Opening" - acc.account_type = "Round Off for Opening" - acc.save() - frappe.db.set_value("Company", company_name, "round_off_for_opening", acc.name) - - def test_ledger_entries_of_opening_invoice_with_rounding_adjustment(self): - pi = make_purchase_invoice(do_not_save=1) - pi.items[0].rate = 99.98 - pi.items[0].qty = 1 - pi.items[0].expense_account = "Temporary Opening - _TC" - pi.is_opening = "Yes" - pi.save() - self._create_opening_roundoff_account(pi.company) - pi.submit() - actual = frappe.db.get_all( - "GL Entry", - filters={"voucher_no": pi.name, "is_opening": "Yes", "is_cancelled": False}, - fields=["account", "debit", "credit", "is_opening"], - order_by="account,debit", - ) - expected = [ - {"account": "Creditors - _TC", "debit": 0.0, "credit": 100.0, "is_opening": "Yes"}, - {"account": "Round Off for Opening - _TC", "debit": 0.02, "credit": 0.0, "is_opening": "Yes"}, - {"account": "Temporary Opening - _TC", "debit": 99.98, "credit": 0.0, "is_opening": "Yes"}, - ] - self.assertEqual(len(actual), 3) - self.assertEqual(expected, actual) - def test_last_purchase_rate(self): item = create_item("_Test Item For Last Purchase Rate from PI", is_stock_item=1) pi1 = make_purchase_invoice(item_code=item.item_code, qty=10, rate=100) @@ -2371,7 +2310,6 @@ def test_last_purchase_rate(self): item.reload() self.assertEqual(item.last_purchase_rate, 0) ->>>>>>> fb9d106633 (fix: last purchase rate for purchase invoice) def set_advance_flag(company, flag, default_account): frappe.db.set_value(