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:
Deepesh Garg 2019-05-20 15:20:53 +05:30 committed by GitHub
commit 9982576ea6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -211,6 +211,11 @@ frappe.query_reports["General Ledger"] = {
"label": __("Currency"),
"fieldtype": "Select",
"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)
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(totals, 'opening', gle)