Fixes for client credits

This commit is contained in:
David Bomba 2021-07-04 09:02:16 +10:00
parent fc4e21c5cb
commit 5c1b9d5b2d

View File

@ -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');
}