Added filter to show unclosed fiscal year's P&L balances in trail balance

This commit is contained in:
Nabin Hait 2016-10-17 16:57:52 +05:30
parent 425bdee0ec
commit 437b32d32c
2 changed files with 8 additions and 0 deletions

View File

@ -55,6 +55,11 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() {
"label": __("Show zero values"),
"fieldtype": "Check"
},
{
"fieldname": "show_unclosed_fy_pl_balances",
"label": __("Show unclosed fiscal year's P&L balances"),
"fieldtype": "Check"
}
],
"formatter": erpnext.financial_statements.formatter,
"tree": true,

View File

@ -88,6 +88,9 @@ def get_opening_balances(filters):
def get_rootwise_opening_balances(filters, report_type):
additional_conditions = ""
if not filters.show_unclosed_fy_pl_balances:
additional_conditions = " and posting_date >= %(year_start_date)s" \
if report_type == "Profit and Loss" else ""
if not flt(filters.with_period_closing_entry):
additional_conditions += " and ifnull(voucher_type, '')!='Period Closing Voucher'"