From e4e0bb68ecc3ff2dce679481051ff53c0a77dcd1 Mon Sep 17 00:00:00 2001 From: Abdeali Chharchhodawala <99460106+Abdeali099@users.noreply.github.com> Date: Tue, 13 May 2025 11:26:21 +0530 Subject: [PATCH] Merge pull request #47367 from Abdeali099/gl-report-field-float-to-currency fix: Use `Currency` instead of `Float` in GL report to show details --- .../report/general_ledger/general_ledger.py | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index d7e0264093f..48193c87822 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -587,17 +587,20 @@ def get_account_type_map(company): def get_result_as_list(data, filters): - balance, _balance_in_account_currency = 0, 0 + balance = 0 for d in data: if not d.get("posting_date"): - balance, _balance_in_account_currency = 0, 0 + balance = 0 balance = get_balance(d, balance, "debit", "credit") + d["balance"] = balance d["account_currency"] = filters.account_currency + d["presentation_currency"] = filters.presentation_currency + return data @@ -623,11 +626,8 @@ def get_columns(filters): if filters.get("presentation_currency"): currency = filters["presentation_currency"] else: - if filters.get("company"): - currency = get_company_currency(filters["company"]) - else: - company = get_default_company() - currency = get_company_currency(company) + company = filters.get("company") or get_default_company() + filters["presentation_currency"] = currency = get_company_currency(company) columns = [ { @@ -648,19 +648,22 @@ def get_columns(filters): { "label": _("Debit ({0})").format(currency), "fieldname": "debit", - "fieldtype": "Float", + "fieldtype": "Currency", + "options": "presentation_currency", "width": 130, }, { "label": _("Credit ({0})").format(currency), "fieldname": "credit", - "fieldtype": "Float", + "fieldtype": "Currency", + "options": "presentation_currency", "width": 130, }, { "label": _("Balance ({0})").format(currency), "fieldname": "balance", - "fieldtype": "Float", + "fieldtype": "Currency", + "options": "presentation_currency", "width": 130, }, ]