fix: show zero stock items filter in the stock balance report (#42147)

This commit is contained in:
rohitwaghchaure
2024-07-03 07:39:47 +05:30
committed by GitHub
parent dc5d3b69be
commit 1dae2156e3
2 changed files with 12 additions and 1 deletions

View File

@@ -101,6 +101,12 @@ frappe.query_reports["Stock Balance"] = {
fieldtype: "Check",
default: 0,
},
{
fieldname: "include_zero_stock_items",
label: __("Include Zero Stock Items"),
fieldtype: "Check",
default: 0,
},
],
formatter: function (value, row, column, data, default_formatter) {

View File

@@ -138,7 +138,12 @@ class StockBalanceReport:
{"reserved_stock": sre_details.get((report_data.item_code, report_data.warehouse), 0.0)}
)
if report_data and report_data.bal_qty == 0 and report_data.bal_val == 0:
if (
not self.filters.get("include_zero_stock_items")
and report_data
and report_data.bal_qty == 0
and report_data.bal_val == 0
):
continue
self.data.append(report_data)