diff --git a/app/Services/Client/ClientService.php b/app/Services/Client/ClientService.php index d12bc48ea930..2355639f70d2 100644 --- a/app/Services/Client/ClientService.php +++ b/app/Services/Client/ClientService.php @@ -69,7 +69,7 @@ class ClientService $query->whereDate('due_date', '<=', now()->format('Y-m-d')) ->orWhereNull('due_date'); }) - ->orderBy('created_at','ASC'); + ->orderBy('created_at','ASC')->get(); } public function getPaymentMethods(float $amount) diff --git a/app/Services/Payment/PaymentService.php b/app/Services/Payment/PaymentService.php index f6aba1e7f4ac..5e89ea905c31 100644 --- a/app/Services/Payment/PaymentService.php +++ b/app/Services/Payment/PaymentService.php @@ -119,6 +119,7 @@ class PaymentService ->service() ->getCredits(); + foreach ($credits as $credit) { //starting invoice balance $invoice_balance = $invoice->balance;