From 654460758d633bd0d18dbd4c60f4e7cc887fa31a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 7 Sep 2022 21:27:53 +1000 Subject: [PATCH] Fixes for bank service query --- app/Services/Bank/BankService.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Services/Bank/BankService.php b/app/Services/Bank/BankService.php index 2e89835ac1ad..9397409eb4aa 100644 --- a/app/Services/Bank/BankService.php +++ b/app/Services/Bank/BankService.php @@ -14,6 +14,7 @@ namespace App\Services\Bank; use App\Libraries\MultiDB; use App\Models\BankTransaction; use App\Models\Company; +use App\Models\Invoice; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; @@ -45,9 +46,10 @@ class BankService implements ShouldQueue $this->company = Company::find($this->company_id); - $this->invoices = $this->company->invoices()->whereIn('status_id', [1,2,3]) - ->where('is_deleted', 0) - ->get(); + $this->invoices = Invoice::where('company_id', $this->company->id) + ->whereIn('status_id', [1,2,3]) + ->where('is_deleted', 0) + ->get(); $this->match(); }