From a7697735922776804f3cf48da2fd195d3f30a016 Mon Sep 17 00:00:00 2001 From: Dean Blackborough Date: Sun, 10 Nov 2019 23:58:59 +0000 Subject: [PATCH] Incorrect conditions for includeUnpublished - Incorrect conditions for includeUnpublished --- app/Models/ResourceTypeItemType/Summary/AllocatedExpense.php | 4 ++-- app/Models/Summary/ItemType/AllocatedExpense.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Models/ResourceTypeItemType/Summary/AllocatedExpense.php b/app/Models/ResourceTypeItemType/Summary/AllocatedExpense.php index b7810e04..70f14bc4 100644 --- a/app/Models/ResourceTypeItemType/Summary/AllocatedExpense.php +++ b/app/Models/ResourceTypeItemType/Summary/AllocatedExpense.php @@ -438,8 +438,8 @@ public function subcategorySummary( private function includeUnpublished($collection, array $parameters): Builder { if ( - array_key_exists('include-unpublished', $parameters) === true && - $parameters['include-unpublished'] === true + array_key_exists('include-unpublished', $parameters) === false || + $parameters['include-unpublished'] === false ) { $collection->where(function ($sql) { $sql->whereNull('item_type_allocated_expense.publish_after')-> diff --git a/app/Models/Summary/ItemType/AllocatedExpense.php b/app/Models/Summary/ItemType/AllocatedExpense.php index be10373d..2ebdf0e8 100644 --- a/app/Models/Summary/ItemType/AllocatedExpense.php +++ b/app/Models/Summary/ItemType/AllocatedExpense.php @@ -420,8 +420,8 @@ public function yearSummary( private function includeUnpublished($collection, array $parameters): Builder { if ( - array_key_exists('include-unpublished', $parameters) === true && - $parameters['include-unpublished'] === true + array_key_exists('include-unpublished', $parameters) === false || + $parameters['include-unpublished'] === false ) { $collection->where(function ($sql) { $sql->whereNull('item_type_allocated_expense.publish_after')->