From 6b1b30a4a613341ac3724230ac1712d826f347ed Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Thu, 24 Apr 2025 16:10:12 +0530 Subject: [PATCH] fix: price currency in supplier quotation comparison (cherry picked from commit 88926eb2a7bb8e6814064236a133b3b3bbc9301b) --- .../supplier_quotation_comparison.py | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.py b/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.py index 085f30f84d9..ad181802c79 100644 --- a/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.py +++ b/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.py @@ -83,19 +83,11 @@ def prepare_data(supplier_quotation_data, filters): supplier_qty_price_map = {} group_by_field = "supplier_name" if filters.get("group_by") == "Group by Supplier" else "item_code" - company_currency = frappe.db.get_default("currency") float_precision = cint(frappe.db.get_default("float_precision")) or 2 for data in supplier_quotation_data: group = data.get(group_by_field) # get item or supplier value for this row - supplier_currency = frappe.db.get_value("Supplier", data.get("supplier_name"), "default_currency") - - if supplier_currency: - exchange_rate = get_exchange_rate(supplier_currency, company_currency) - else: - exchange_rate = 1 - row = { "item_code": "" if group_by_field == "item_code" @@ -103,7 +95,7 @@ def prepare_data(supplier_quotation_data, filters): "supplier_name": "" if group_by_field == "supplier_name" else data.get("supplier_name"), "quotation": data.get("parent"), "qty": data.get("qty"), - "price": flt(data.get("amount") * exchange_rate, float_precision), + "price": flt(data.get("amount"), float_precision), "uom": data.get("uom"), "price_list_currency": data.get("price_list_currency"), "currency": data.get("currency"), @@ -209,6 +201,13 @@ def get_columns(filters): columns = [ {"fieldname": "uom", "label": _("UOM"), "fieldtype": "Link", "options": "UOM", "width": 90}, {"fieldname": "qty", "label": _("Quantity"), "fieldtype": "Float", "width": 80}, + { + "fieldname": "stock_uom", + "label": _("Stock UOM"), + "fieldtype": "Link", + "options": "UOM", + "width": 90, + }, { "fieldname": "currency", "label": _("Currency"), @@ -223,13 +222,6 @@ def get_columns(filters): "options": "currency", "width": 110, }, - { - "fieldname": "stock_uom", - "label": _("Stock UOM"), - "fieldtype": "Link", - "options": "UOM", - "width": 90, - }, { "fieldname": "price_per_unit", "label": _("Price per Unit (Stock UOM)"),