From 2dd3dd581439caeb77f2488f0f0f74420ad25165 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Sat, 12 Sep 2020 15:17:10 -0400 Subject: [PATCH] Make sure we're getting only active expenses --- app/Repositories/ExpenseRepository.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Repositories/ExpenseRepository.php b/app/Repositories/ExpenseRepository.php index 668b098d..62fef43f 100644 --- a/app/Repositories/ExpenseRepository.php +++ b/app/Repositories/ExpenseRepository.php @@ -8,9 +8,6 @@ use Illuminate\Support\Collection; use Prettus\Repository\Contracts\CacheableInterface; use Prettus\Repository\Traits\CacheableRepository; -/** - * Class ExpenseRepository - */ class ExpenseRepository extends Repository implements CacheableInterface { use CacheableRepository; @@ -34,7 +31,8 @@ class ExpenseRepository extends Repository implements CacheableInterface public function getAllForType($type, $airline_id = null, $ref_model = null, $ref_model_id = null) { $where = [ - 'type' => $type, + 'type' => $type, + 'active' => true, ['airline_id', '=', null], ]; @@ -59,6 +57,7 @@ class ExpenseRepository extends Repository implements CacheableInterface if ($airline_id) { $where = [ 'type' => $type, + 'active' => true, 'airline_id' => $airline_id, ];