mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 00:14:50 +00:00
fix: added total column
This commit is contained in:
@@ -120,6 +120,7 @@ def prepare_data(accounts, filters, parent_children_map, company_currency, dimen
|
|||||||
|
|
||||||
for d in accounts:
|
for d in accounts:
|
||||||
has_value = False
|
has_value = False
|
||||||
|
total = 0
|
||||||
row = {
|
row = {
|
||||||
"account": d.name,
|
"account": d.name,
|
||||||
"parent_account": d.parent_account,
|
"parent_account": d.parent_account,
|
||||||
@@ -137,8 +138,10 @@ def prepare_data(accounts, filters, parent_children_map, company_currency, dimen
|
|||||||
if abs(row[frappe.scrub(item)]) >= 0.005:
|
if abs(row[frappe.scrub(item)]) >= 0.005:
|
||||||
# ignore zero values
|
# ignore zero values
|
||||||
has_value = True
|
has_value = True
|
||||||
|
total += flt(d.get(frappe.scrub(item), 0.0), 3)
|
||||||
|
|
||||||
row["has_value"] = has_value
|
row["has_value"] = has_value
|
||||||
|
row["total"] = total
|
||||||
data.append(row)
|
data.append(row)
|
||||||
|
|
||||||
return data
|
return data
|
||||||
@@ -199,5 +202,12 @@ def get_columns(dimension_items_list, accumulated_values=1, company=None):
|
|||||||
"options": "currency",
|
"options": "currency",
|
||||||
"width": 150
|
"width": 150
|
||||||
})
|
})
|
||||||
|
columns.append({
|
||||||
|
"fieldname": "total",
|
||||||
|
"label": "Total",
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"options": "currency",
|
||||||
|
"width": 150
|
||||||
|
})
|
||||||
|
|
||||||
return columns
|
return columns
|
||||||
|
|||||||
Reference in New Issue
Block a user