tweak new function get_currency

This commit is contained in:
tundebabzy
2018-01-22 17:39:18 +01:00
parent c2b6c9ba04
commit d93f2ddd4e

View File

@@ -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):