commit 08-2025

This commit is contained in:
Kevin Adametz 2025-08-12 15:51:04 +02:00
parent 9b54eb0512
commit 02f2a4c23e
184 changed files with 31653 additions and 22327 deletions

View file

@ -44,7 +44,11 @@ class UserMarign
return $sum_net_amount;
}
public static function getMontlyAmount(User $user, $date = null, $format = false){
public static function getMontlyAmount($user, $date = null, $format = false){
if(!$user instanceof User){
return 0;
}
$now = $date ? Carbon::parse($date) : Carbon::now();
$startDay = $now->startOfMonth()->toDateString();
@ -202,7 +206,8 @@ class UserMarign
->whereOutPaid(false)
->whereCancellation(false)
->whereMarginPaid(false)
->whereNotNull('margin_pending_to');
->whereNotNull('margin_pending_to')
->whereIn('status', [7,8]);
if ($isPending) {
$query->where('margin_pending_to', '>=', Carbon::now());