fix(gl-report): group by cost center only if include_dimensions is checked (#28883)
This commit is contained in:
parent
962dd5eaec
commit
c62083653b
@ -167,7 +167,7 @@ frappe.query_reports["General Ledger"] = {
|
|||||||
"fieldname": "include_dimensions",
|
"fieldname": "include_dimensions",
|
||||||
"label": __("Consider Accounting Dimensions"),
|
"label": __("Consider Accounting Dimensions"),
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"default": 0
|
"default": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "show_opening_entries",
|
"fieldname": "show_opening_entries",
|
||||||
|
@ -448,9 +448,11 @@ def get_accountwise_gle(filters, accounting_dimensions, gl_entries, gle_map):
|
|||||||
|
|
||||||
elif group_by_voucher_consolidated:
|
elif group_by_voucher_consolidated:
|
||||||
keylist = [gle.get("voucher_type"), gle.get("voucher_no"), gle.get("account")]
|
keylist = [gle.get("voucher_type"), gle.get("voucher_no"), gle.get("account")]
|
||||||
for dim in accounting_dimensions:
|
if filters.get("include_dimensions"):
|
||||||
keylist.append(gle.get(dim))
|
for dim in accounting_dimensions:
|
||||||
keylist.append(gle.get("cost_center"))
|
keylist.append(gle.get(dim))
|
||||||
|
keylist.append(gle.get("cost_center"))
|
||||||
|
|
||||||
key = tuple(keylist)
|
key = tuple(keylist)
|
||||||
if key not in consolidated_gle:
|
if key not in consolidated_gle:
|
||||||
consolidated_gle.setdefault(key, gle)
|
consolidated_gle.setdefault(key, gle)
|
||||||
@ -591,14 +593,14 @@ def get_columns(filters):
|
|||||||
"fieldname": dim.fieldname,
|
"fieldname": dim.fieldname,
|
||||||
"width": 100
|
"width": 100
|
||||||
})
|
})
|
||||||
|
columns.append({
|
||||||
columns.extend([
|
|
||||||
{
|
|
||||||
"label": _("Cost Center"),
|
"label": _("Cost Center"),
|
||||||
"options": "Cost Center",
|
"options": "Cost Center",
|
||||||
"fieldname": "cost_center",
|
"fieldname": "cost_center",
|
||||||
"width": 100
|
"width": 100
|
||||||
},
|
})
|
||||||
|
|
||||||
|
columns.extend([
|
||||||
{
|
{
|
||||||
"label": _("Against Voucher Type"),
|
"label": _("Against Voucher Type"),
|
||||||
"fieldname": "against_voucher_type",
|
"fieldname": "against_voucher_type",
|
||||||
|
Loading…
Reference in New Issue
Block a user