Skip to content

Commit

Permalink
fix: currency symbol in the Supplier Quotation Comparison report (#37337
Browse files Browse the repository at this point in the history
)

fix: currency in the Supplier Quotation Comparison report
  • Loading branch information
rohitwaghchaure authored Oct 3, 2023
1 parent 6daea6c commit 82e8606
Showing 1 changed file with 33 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ def get_data(filters):
sq_item.parent,
sq_item.item_code,
sq_item.qty,
sq.currency,
sq_item.stock_qty,
sq_item.amount,
sq_item.base_rate,
sq_item.base_amount,
sq.price_list_currency,
sq_item.uom,
sq_item.stock_uom,
sq_item.request_for_quotation,
Expand Down Expand Up @@ -105,7 +109,11 @@ def prepare_data(supplier_quotation_data, filters):
"qty": data.get("qty"),
"price": flt(data.get("amount") * exchange_rate, float_precision),
"uom": data.get("uom"),
"price_list_currency": data.get("price_list_currency"),
"currency": data.get("currency"),
"stock_uom": data.get("stock_uom"),
"base_amount": flt(data.get("base_amount"), float_precision),
"base_rate": flt(data.get("base_rate"), float_precision),
"request_for_quotation": data.get("request_for_quotation"),
"valid_till": data.get("valid_till"),
"lead_time_days": data.get("lead_time_days"),
Expand Down Expand Up @@ -183,6 +191,8 @@ def prepare_chart_data(suppliers, qty_list, supplier_qty_price_map):


def get_columns(filters):
currency = frappe.get_cached_value("Company", filters.get("company"), "default_currency")

group_by_columns = [
{
"fieldname": "supplier_name",
Expand All @@ -203,11 +213,18 @@ def get_columns(filters):
columns = [
{"fieldname": "uom", "label": _("UOM"), "fieldtype": "Link", "options": "UOM", "width": 90},
{"fieldname": "qty", "label": _("Quantity"), "fieldtype": "Float", "width": 80},
{
"fieldname": "currency",
"label": _("Currency"),
"fieldtype": "Link",
"options": "Currency",
"width": 110,
},
{
"fieldname": "price",
"label": _("Price"),
"fieldtype": "Currency",
"options": "Company:company:default_currency",
"options": "currency",
"width": 110,
},
{
Expand All @@ -221,9 +238,23 @@ def get_columns(filters):
"fieldname": "price_per_unit",
"label": _("Price per Unit (Stock UOM)"),
"fieldtype": "Currency",
"options": "Company:company:default_currency",
"options": "currency",
"width": 120,
},
{
"fieldname": "base_amount",
"label": _("Price ({0})").format(currency),
"fieldtype": "Currency",
"options": "price_list_currency",
"width": 180,
},
{
"fieldname": "base_rate",
"label": _("Price Per Unit ({0})").format(currency),
"fieldtype": "Currency",
"options": "price_list_currency",
"width": 180,
},
{
"fieldname": "quotation",
"label": _("Supplier Quotation"),
Expand Down

0 comments on commit 82e8606

Please sign in to comment.