[fix] Currency in Gross Profit report
This commit is contained in:
parent
c978b9c36a
commit
6d8688f8b4
@ -7,7 +7,9 @@ from frappe import _, scrub
|
|||||||
from frappe.utils import flt
|
from frappe.utils import flt
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
if not filters: filters = {}
|
if not filters: filters = frappe._dict()
|
||||||
|
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
|
||||||
|
|
||||||
gross_profit_data = GrossProfitGenerator(filters)
|
gross_profit_data = GrossProfitGenerator(filters)
|
||||||
|
|
||||||
data = []
|
data = []
|
||||||
@ -43,6 +45,8 @@ def execute(filters=None):
|
|||||||
row = []
|
row = []
|
||||||
for col in group_wise_columns.get(scrub(filters.group_by)):
|
for col in group_wise_columns.get(scrub(filters.group_by)):
|
||||||
row.append(src.get(col))
|
row.append(src.get(col))
|
||||||
|
|
||||||
|
row.append(company_currency)
|
||||||
data.append(row)
|
data.append(row)
|
||||||
|
|
||||||
return columns, data
|
return columns, data
|
||||||
@ -60,15 +64,15 @@ def get_columns(group_wise_columns, filters):
|
|||||||
"description": _("Description"),
|
"description": _("Description"),
|
||||||
"warehouse": _("Warehouse") + ":Link/Warehouse",
|
"warehouse": _("Warehouse") + ":Link/Warehouse",
|
||||||
"qty": _("Qty") + ":Float",
|
"qty": _("Qty") + ":Float",
|
||||||
"base_rate": _("Avg. Selling Rate") + ":Currency",
|
"base_rate": _("Avg. Selling Rate") + ":Currency/currency",
|
||||||
"buying_rate": _("Avg. Buying Rate") + ":Currency",
|
"buying_rate": _("Avg. Buying Rate") + ":Currency/currency",
|
||||||
"base_amount": _("Selling Amount") + ":Currency",
|
"base_amount": _("Selling Amount") + ":Currency/currency",
|
||||||
"buying_amount": _("Buying Amount") + ":Currency",
|
"buying_amount": _("Buying Amount") + ":Currency/currency",
|
||||||
"gross_profit": _("Gross Profit") + ":Currency",
|
"gross_profit": _("Gross Profit") + ":Currency/currency",
|
||||||
"gross_profit_percent": _("Gross Profit %") + ":Percent",
|
"gross_profit_percent": _("Gross Profit %") + ":Percent",
|
||||||
"project": _("Project") + ":Link/Project",
|
"project": _("Project") + ":Link/Project",
|
||||||
"sales_person": _("Sales person"),
|
"sales_person": _("Sales person"),
|
||||||
"allocated_amount": _("Allocated Amount") + ":Currency",
|
"allocated_amount": _("Allocated Amount") + ":Currency/currency",
|
||||||
"customer": _("Customer") + ":Link/Customer",
|
"customer": _("Customer") + ":Link/Customer",
|
||||||
"customer_group": _("Customer Group") + ":Link/Customer Group",
|
"customer_group": _("Customer Group") + ":Link/Customer Group",
|
||||||
"territory": _("Territory") + ":Link/Territory"
|
"territory": _("Territory") + ":Link/Territory"
|
||||||
@ -76,6 +80,13 @@ def get_columns(group_wise_columns, filters):
|
|||||||
|
|
||||||
for col in group_wise_columns.get(scrub(filters.group_by)):
|
for col in group_wise_columns.get(scrub(filters.group_by)):
|
||||||
columns.append(column_map.get(col))
|
columns.append(column_map.get(col))
|
||||||
|
|
||||||
|
columns.append({
|
||||||
|
"fieldname": "currency",
|
||||||
|
"label" : _("Currency"),
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"options": "Currency"
|
||||||
|
})
|
||||||
|
|
||||||
return columns
|
return columns
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user