diff --git a/app/Services/Reports/OnePercentService.php b/app/Services/Reports/OnePercentService.php index aeb93e3..bd63f56 100644 --- a/app/Services/Reports/OnePercentService.php +++ b/app/Services/Reports/OnePercentService.php @@ -469,7 +469,12 @@ class OnePercentService } private function filterCollection($collection,$type,$sumtype) : Float{ - return $collection->filter(function ($item) use($type) { + + $array_type = ['T','S','P','AT']; + return $collection->filter(function ($item) use($type,$array_type) { + if($type == 'T') + return in_array($type, $array_type); + return $item->trans_type === $type; })->sum($sumtype); }