mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
InvoiceReport: avoid additional queries in the result items loop
(cherry picked from commit 9fd6ac0d7108a7e19faa5b3eae360974c1093d73)
This commit is contained in:
parent
a469870b2a
commit
4476c9eea2
@ -56,7 +56,7 @@ class InvoiceReport extends AbstractReport
|
|||||||
$clients = Client::scope()
|
$clients = Client::scope()
|
||||||
->orderBy('name')
|
->orderBy('name')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->with('contacts', 'user')
|
->with('contacts', 'user', 'country', 'shipping_country')
|
||||||
->with(['invoices' => function ($query) use ($statusIds) {
|
->with(['invoices' => function ($query) use ($statusIds) {
|
||||||
$query->invoices()
|
$query->invoices()
|
||||||
->withArchived()
|
->withArchived()
|
||||||
@ -122,7 +122,7 @@ class InvoiceReport extends AbstractReport
|
|||||||
$invoice->po_number,
|
$invoice->po_number,
|
||||||
$invoice->private_notes,
|
$invoice->private_notes,
|
||||||
$client->vat_number,
|
$client->vat_number,
|
||||||
$invoice->user->getDisplayName(),
|
$client->user->getDisplayName(),
|
||||||
trim(str_replace('<br/>', ', ', $client->present()->address()), ', '),
|
trim(str_replace('<br/>', ', ', $client->present()->address()), ', '),
|
||||||
trim(str_replace('<br/>', ', ', $client->present()->address(ADDRESS_SHIPPING)), ', '),
|
trim(str_replace('<br/>', ', ', $client->present()->address(ADDRESS_SHIPPING)), ', '),
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user