feat: added checkbox in the filter of general ledger to show opening entries

This commit is contained in:
Rohit Waghchaure 2019-05-20 12:25:53 +05:30
parent c356fef9c4
commit 97d2a46052
2 changed files with 7 additions and 1 deletions

View File

@ -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"
} }
] ]
} }

View File

@ -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)