From d93f2ddd4e962c3c92c468b9fed0a2d907099b81 Mon Sep 17 00:00:00 2001 From: tundebabzy Date: Mon, 22 Jan 2018 17:39:18 +0100 Subject: [PATCH] tweak new function `get_currency` --- .../report/general_ledger/general_ledger.py | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index c8c3111e048..838663308f2 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -128,16 +128,22 @@ def get_currency(filters): :return: str - Currency """ - 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) + currency_map = {} + company = None + presentation_currency = None + company_currency = None - return currency + if filters.get('company'): + company = filters['company'] + else: + company = get_default_company() + + company_currency = get_company_currency(company) + presentation_currency = filters['presentation_currency'] if filters.get('presentation_currency') else company_currency + currency_map = dict( + company=company, company_currency=company_currency, presentation_currency=presentation_currency + ) + return currency_map def get_gl_entries(filters):