From 40ed85f096fb3db4770c62aa8eb3948e62101134 Mon Sep 17 00:00:00 2001 From: David Mouse Date: Thu, 6 Feb 2025 03:12:11 -0500 Subject: [PATCH] Fix Location Content Sheet filter checkbox Previously, the query parameter functioned as expected, but the checkbox always appeared checked. Additionally, clicking the checkbox would always result in the "unchecked" state despite remaining visually checked. This adds the required context to the controller and an @if directive to the checkbox's checked attribute in the view to match. --- controllers/StockController.php | 3 ++- views/locationcontentsheet.blade.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/controllers/StockController.php b/controllers/StockController.php index 408c29c7..835b6d06 100644 --- a/controllers/StockController.php +++ b/controllers/StockController.php @@ -93,7 +93,8 @@ class StockController extends BaseController 'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'), 'quantityunits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'), 'locations' => $this->getDatabase()->locations()->orderBy('name', 'COLLATE NOCASE'), - 'currentStockLocationContent' => $this->getStockService()->GetCurrentStockLocationContent(isset($request->getQueryParams()['include_out_of_stock'])) + 'currentStockLocationContent' => $this->getStockService()->GetCurrentStockLocationContent(isset($request->getQueryParams()['include_out_of_stock'])), + 'includeOutOfStockProductsAtTheDefaultLocation' => isset($request->getQueryParams()['include_out_of_stock']) ]); } diff --git a/views/locationcontentsheet.blade.php b/views/locationcontentsheet.blade.php index 12337bf0..fb5d6245 100644 --- a/views/locationcontentsheet.blade.php +++ b/views/locationcontentsheet.blade.php @@ -40,7 +40,7 @@ + @if(!$includeOutOfStockProductsAtTheDefaultLocation) checked @endif>