From 5629056ec267e9bb72b316f5f661f7a99e534e7d Mon Sep 17 00:00:00 2001 From: ljain112 Date: Tue, 9 Jun 2026 18:12:53 +0530 Subject: [PATCH] chore: resolve conflicts --- erpnext/controllers/taxes_and_totals.py | 13 +++---------- erpnext/controllers/tests/test_taxes_and_totals.py | 6 ++---- erpnext/public/js/controllers/taxes_and_totals.js | 12 ++---------- 3 files changed, 7 insertions(+), 24 deletions(-) diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index 8b2a02ce290..09318b6725f 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -26,14 +26,9 @@ from erpnext.utilities.regional import temporary_flag class calculate_taxes_and_totals: def __init__(self, doc: Document): self.doc = doc -<<<<<<< HEAD frappe.flags.round_off_applicable_accounts = [] frappe.flags.round_row_wise_tax = frappe.db.get_single_value( "Accounts Settings", "round_row_wise_tax" -======= - frappe.flags.round_off_applicable_accounts = ( - get_round_off_applicable_accounts(self.doc.company, [], self.doc) or [] ->>>>>>> 08129ff71c (fix: update round off account functions to accept document context for regional overrides (#55758)) ) if doc.get("round_off_applicable_accounts_for_tax_withholding"): @@ -43,7 +38,9 @@ class calculate_taxes_and_totals: self._items = self.filter_rows() if self.doc.doctype == "Quotation" else self.doc.get("items") - get_round_off_applicable_accounts(self.doc.company, frappe.flags.round_off_applicable_accounts) + get_round_off_applicable_accounts( + self.doc.company, frappe.flags.round_off_applicable_accounts, self.doc + ) self.calculate() def filter_rows(self): @@ -1133,13 +1130,9 @@ def get_itemised_tax_breakup_html(doc): @frappe.whitelist() -<<<<<<< HEAD -def get_round_off_applicable_accounts(company, account_list): -======= def get_round_off_applicable_accounts( company: str, account_list: list | str, doc: str | dict | Document | None = None ): ->>>>>>> 08129ff71c (fix: update round off account functions to accept document context for regional overrides (#55758)) # required to set correct region with temporary_flag("company", company): return get_regional_round_off_accounts(company, account_list, doc) diff --git a/erpnext/controllers/tests/test_taxes_and_totals.py b/erpnext/controllers/tests/test_taxes_and_totals.py index b86e60a027b..715acf8782f 100644 --- a/erpnext/controllers/tests/test_taxes_and_totals.py +++ b/erpnext/controllers/tests/test_taxes_and_totals.py @@ -1,3 +1,5 @@ +from unittest.mock import patch + import frappe from frappe.tests.utils import FrappeTestCase @@ -5,10 +7,7 @@ from erpnext.controllers.taxes_and_totals import calculate_taxes_and_totals from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order -<<<<<<< HEAD class TestTaxesAndTotals(FrappeTestCase): -======= -class TestTaxesAndTotals(ERPNextTestSuite): def test_regional_round_off_accounts(self): """ Regional overrides cannot extend the list in-place — the return @@ -31,7 +30,6 @@ class TestTaxesAndTotals(ERPNextTestSuite): self.assertIn(test_account, frappe.flags.round_off_applicable_accounts) ->>>>>>> 08129ff71c (fix: update round off account functions to accept document context for regional overrides (#55758)) def test_disabling_rounded_total_resets_base_fields(self): """Disabling rounded total should also clear base rounded values.""" so = make_sales_order(do_not_save=True) diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js index 924bf4534ac..0df4cabfb4f 100644 --- a/erpnext/public/js/controllers/taxes_and_totals.js +++ b/erpnext/public/js/controllers/taxes_and_totals.js @@ -204,19 +204,11 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments { if (me.frm.doc.company) { frappe.call({ -<<<<<<< HEAD "method": "erpnext.controllers.taxes_and_totals.get_round_off_applicable_accounts", "args": { "company": me.frm.doc.company, - "account_list": frappe.flags.round_off_applicable_accounts -======= - method: "erpnext.controllers.taxes_and_totals.get_round_off_applicable_accounts", - args: { - company: me.frm.doc.company, - account_list: frappe.flags.round_off_applicable_accounts, - // pass the doc so regional overrides can inspect it - doc: me.frm.doc, ->>>>>>> 08129ff71c (fix: update round off account functions to accept document context for regional overrides (#55758)) + "account_list": frappe.flags.round_off_applicable_accounts, + "doc": me.frm.doc, }, callback(r) { if (r.message) {