From 67cb2b32151eb3c70838835dd6371bbd74acbee0 Mon Sep 17 00:00:00 2001 From: "Aleksander V. Dyomin" Date: Mon, 5 Aug 2019 13:16:03 +0300 Subject: [PATCH] TaxRateReport: avoid additional queries in the result items loop (cherry picked from commit d00d1e926628e5e0e83eb7570716eb3f332d6b27) --- app/Ninja/Reports/TaxRateReport.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Ninja/Reports/TaxRateReport.php b/app/Ninja/Reports/TaxRateReport.php index 4cc9df12468c..588432b3596e 100644 --- a/app/Ninja/Reports/TaxRateReport.php +++ b/app/Ninja/Reports/TaxRateReport.php @@ -31,7 +31,9 @@ class TaxRateReport extends AbstractReport ->withArchived() ->with('contacts', 'user') ->with(['invoices' => function ($query) { - $query->with('invoice_items') + $query + ->with('account', 'client') + ->with('invoice_items') ->withArchived() ->invoices() ->where('is_public', '=', true);