fix keuntungan akru percent

This commit is contained in:
Hafifie PKB
2024-07-03 16:09:29 +08:00
parent c97ea041cd
commit cee2495641
+6 -1
View File
@@ -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);
}