mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-04 22:18:27 +00:00
Merge pull request #47367 from Abdeali099/gl-report-field-float-to-currency
fix: Use `Currency` instead of `Float` in GL report to show details
This commit is contained in:
committed by
GitHub
parent
963d1e502e
commit
e4e0bb68ec
@@ -587,17 +587,20 @@ def get_account_type_map(company):
|
|||||||
|
|
||||||
|
|
||||||
def get_result_as_list(data, filters):
|
def get_result_as_list(data, filters):
|
||||||
balance, _balance_in_account_currency = 0, 0
|
balance = 0
|
||||||
|
|
||||||
for d in data:
|
for d in data:
|
||||||
if not d.get("posting_date"):
|
if not d.get("posting_date"):
|
||||||
balance, _balance_in_account_currency = 0, 0
|
balance = 0
|
||||||
|
|
||||||
balance = get_balance(d, balance, "debit", "credit")
|
balance = get_balance(d, balance, "debit", "credit")
|
||||||
|
|
||||||
d["balance"] = balance
|
d["balance"] = balance
|
||||||
|
|
||||||
d["account_currency"] = filters.account_currency
|
d["account_currency"] = filters.account_currency
|
||||||
|
|
||||||
|
d["presentation_currency"] = filters.presentation_currency
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
@@ -623,11 +626,8 @@ def get_columns(filters):
|
|||||||
if filters.get("presentation_currency"):
|
if filters.get("presentation_currency"):
|
||||||
currency = filters["presentation_currency"]
|
currency = filters["presentation_currency"]
|
||||||
else:
|
else:
|
||||||
if filters.get("company"):
|
company = filters.get("company") or get_default_company()
|
||||||
currency = get_company_currency(filters["company"])
|
filters["presentation_currency"] = currency = get_company_currency(company)
|
||||||
else:
|
|
||||||
company = get_default_company()
|
|
||||||
currency = get_company_currency(company)
|
|
||||||
|
|
||||||
columns = [
|
columns = [
|
||||||
{
|
{
|
||||||
@@ -648,19 +648,22 @@ def get_columns(filters):
|
|||||||
{
|
{
|
||||||
"label": _("Debit ({0})").format(currency),
|
"label": _("Debit ({0})").format(currency),
|
||||||
"fieldname": "debit",
|
"fieldname": "debit",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Currency",
|
||||||
|
"options": "presentation_currency",
|
||||||
"width": 130,
|
"width": 130,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": _("Credit ({0})").format(currency),
|
"label": _("Credit ({0})").format(currency),
|
||||||
"fieldname": "credit",
|
"fieldname": "credit",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Currency",
|
||||||
|
"options": "presentation_currency",
|
||||||
"width": 130,
|
"width": 130,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": _("Balance ({0})").format(currency),
|
"label": _("Balance ({0})").format(currency),
|
||||||
"fieldname": "balance",
|
"fieldname": "balance",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Currency",
|
||||||
|
"options": "presentation_currency",
|
||||||
"width": 130,
|
"width": 130,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user