mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
change from ->get() to ->cursor() for client statements
This commit is contained in:
parent
6d9b4dbbca
commit
d3d5429015
@ -30,6 +30,7 @@ use App\Utils\PhantomJS\Phantom;
|
|||||||
use App\Utils\Traits\Pdf\PdfMaker as PdfMakerTrait;
|
use App\Utils\Traits\Pdf\PdfMaker as PdfMakerTrait;
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\LazyCollection;
|
||||||
|
|
||||||
class Statement
|
class Statement
|
||||||
{
|
{
|
||||||
@ -217,7 +218,7 @@ class Statement
|
|||||||
*
|
*
|
||||||
* @return Invoice[]|\Illuminate\Database\Eloquent\Collection
|
* @return Invoice[]|\Illuminate\Database\Eloquent\Collection
|
||||||
*/
|
*/
|
||||||
protected function getInvoices(): Collection
|
protected function getInvoices(): LazyCollection
|
||||||
{
|
{
|
||||||
return Invoice::withTrashed()
|
return Invoice::withTrashed()
|
||||||
->where('is_deleted', false)
|
->where('is_deleted', false)
|
||||||
@ -226,7 +227,7 @@ class Statement
|
|||||||
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL, Invoice::STATUS_PAID])
|
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL, Invoice::STATUS_PAID])
|
||||||
->whereBetween('date', [$this->options['start_date'], $this->options['end_date']])
|
->whereBetween('date', [$this->options['start_date'], $this->options['end_date']])
|
||||||
->orderBy('number', 'ASC')
|
->orderBy('number', 'ASC')
|
||||||
->get();
|
->cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -234,7 +235,7 @@ class Statement
|
|||||||
*
|
*
|
||||||
* @return Payment[]|\Illuminate\Database\Eloquent\Collection
|
* @return Payment[]|\Illuminate\Database\Eloquent\Collection
|
||||||
*/
|
*/
|
||||||
protected function getPayments(): Collection
|
protected function getPayments(): LazyCollection
|
||||||
{
|
{
|
||||||
return Payment::withTrashed()
|
return Payment::withTrashed()
|
||||||
->with('client.country','invoices')
|
->with('client.country','invoices')
|
||||||
@ -244,7 +245,7 @@ class Statement
|
|||||||
->whereIn('status_id', [Payment::STATUS_COMPLETED, Payment::STATUS_PARTIALLY_REFUNDED, Payment::STATUS_REFUNDED])
|
->whereIn('status_id', [Payment::STATUS_COMPLETED, Payment::STATUS_PARTIALLY_REFUNDED, Payment::STATUS_REFUNDED])
|
||||||
->whereBetween('date', [$this->options['start_date'], $this->options['end_date']])
|
->whereBetween('date', [$this->options['start_date'], $this->options['end_date']])
|
||||||
->orderBy('number', 'ASC')
|
->orderBy('number', 'ASC')
|
||||||
->get();
|
->cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user