diff --git a/app/Services/Client/ClientService.php b/app/Services/Client/ClientService.php index a7f1021bb377..a33a576909f2 100644 --- a/app/Services/Client/ClientService.php +++ b/app/Services/Client/ClientService.php @@ -65,8 +65,10 @@ class ClientService return $this->client->credits() ->where('is_deleted', false) ->where('balance', '>', 0) - ->whereDate('due_date', '<=', now()->format('Y-m-d')) - ->orWhere('due_date', NULL) + ->where(function ($query){ + $query->whereDate('due_date', '<=', now()->format('Y-m-d')) + ->orWhereNull('due_date'); + }) ->orderBy('created_at','ASC'); }