feat: add show zero value filter in profit and loss and balance sheet

(cherry picked from commit 33ab24943c)

# Conflicts:
#	erpnext/accounts/report/balance_sheet/balance_sheet.js
#	erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.js
This commit is contained in:
ravibharathi656
2025-09-24 13:18:25 +05:30
committed by ruthra kumar
parent f6842041c9
commit c32ad9711f
3 changed files with 62 additions and 52 deletions

View File

@@ -5,7 +5,8 @@ frappe.query_reports["Balance Sheet"] = $.extend({}, erpnext.financial_statement
erpnext.utils.add_dimensions("Balance Sheet", 10); erpnext.utils.add_dimensions("Balance Sheet", 10);
frappe.query_reports["Balance Sheet"]["filters"].push({ frappe.query_reports["Balance Sheet"]["filters"].push(
{
fieldname: "selected_view", fieldname: "selected_view",
label: __("Select View"), label: __("Select View"),
fieldtype: "Select", fieldtype: "Select",
@@ -15,18 +16,22 @@ frappe.query_reports["Balance Sheet"]["filters"].push({
], ],
default: "Report", default: "Report",
reqd: 1, reqd: 1,
}); },
{
frappe.query_reports["Balance Sheet"]["filters"].push({
fieldname: "accumulated_values", fieldname: "accumulated_values",
label: __("Accumulated Values"), label: __("Accumulated Values"),
fieldtype: "Check", fieldtype: "Check",
default: 1, default: 1,
}); },
{
frappe.query_reports["Balance Sheet"]["filters"].push({
fieldname: "include_default_book_entries", fieldname: "include_default_book_entries",
label: __("Include Default FB Entries"), label: __("Include Default FB Entries"),
fieldtype: "Check", fieldtype: "Check",
default: 1, default: 1,
}); },
{
fieldname: "show_zero_values",
label: __("Show zero values"),
fieldtype: "Check",
}
);

View File

@@ -212,7 +212,7 @@ def get_data(
company_currency, company_currency,
accumulated_values=filters.accumulated_values, accumulated_values=filters.accumulated_values,
) )
out = filter_out_zero_value_rows(out, parent_children_map) out = filter_out_zero_value_rows(out, parent_children_map, filters.show_zero_values)
if out and total: if out and total:
add_total_row(out, root_type, balance_must_be, period_list, company_currency) add_total_row(out, root_type, balance_must_be, period_list, company_currency)

View File

@@ -5,7 +5,8 @@ frappe.query_reports["Profit and Loss Statement"] = $.extend({}, erpnext.financi
erpnext.utils.add_dimensions("Profit and Loss Statement", 10); erpnext.utils.add_dimensions("Profit and Loss Statement", 10);
frappe.query_reports["Profit and Loss Statement"]["filters"].push({ frappe.query_reports["Profit and Loss Statement"]["filters"].push(
{
fieldname: "selected_view", fieldname: "selected_view",
label: __("Select View"), label: __("Select View"),
fieldtype: "Select", fieldtype: "Select",
@@ -16,18 +17,22 @@ frappe.query_reports["Profit and Loss Statement"]["filters"].push({
], ],
default: "Report", default: "Report",
reqd: 1, reqd: 1,
}); },
{
frappe.query_reports["Profit and Loss Statement"]["filters"].push({
fieldname: "accumulated_values", fieldname: "accumulated_values",
label: __("Accumulated Values"), label: __("Accumulated Values"),
fieldtype: "Check", fieldtype: "Check",
default: 1, default: 1,
}); },
{
frappe.query_reports["Profit and Loss Statement"]["filters"].push({
fieldname: "include_default_book_entries", fieldname: "include_default_book_entries",
label: __("Include Default FB Entries"), label: __("Include Default FB Entries"),
fieldtype: "Check", fieldtype: "Check",
default: 1, default: 1,
}); },
{
fieldname: "show_zero_values",
label: __("Show zero values"),
fieldtype: "Check",
}
);