From cee249564145a961f883c93bef97224c6907b6ea Mon Sep 17 00:00:00 2001 From: Hafifie PKB Date: Wed, 3 Jul 2024 16:09:29 +0800 Subject: [PATCH] fix keuntungan akru percent --- app/Services/Reports/OnePercentService.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); }