Merge pull request #17678 from rohitwaghchaure/show_opening_entries_gl_report_v12
feat: added checkbox in the filter of general ledger to show opening entries
This commit is contained in:
commit
9982576ea6
@ -211,6 +211,11 @@ frappe.query_reports["General Ledger"] = {
|
|||||||
"label": __("Currency"),
|
"label": __("Currency"),
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"options": erpnext.get_presentation_currency_list()
|
"options": erpnext.get_presentation_currency_list()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "show_opening_entries",
|
||||||
|
"label": __("Show Opening Entries"),
|
||||||
|
"fieldtype": "Check"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -283,7 +283,8 @@ def get_accountwise_gle(filters, gl_entries, gle_map):
|
|||||||
|
|
||||||
from_date, to_date = getdate(filters.from_date), getdate(filters.to_date)
|
from_date, to_date = getdate(filters.from_date), getdate(filters.to_date)
|
||||||
for gle in gl_entries:
|
for gle in gl_entries:
|
||||||
if gle.posting_date < from_date or cstr(gle.is_opening) == "Yes":
|
if (gle.posting_date < from_date or
|
||||||
|
(cstr(gle.is_opening) == "Yes" and not filters.get("show_opening_entries"))):
|
||||||
update_value_in_dict(gle_map[gle.get(group_by)].totals, 'opening', gle)
|
update_value_in_dict(gle_map[gle.get(group_by)].totals, 'opening', gle)
|
||||||
update_value_in_dict(totals, 'opening', gle)
|
update_value_in_dict(totals, 'opening', gle)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user