From 074adf409484149ba404a84ed5506bc1bfe7baa7 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 24 Jan 2018 10:00:27 +0200 Subject: [PATCH] Merge quote report fix --- app/Ninja/Reports/QuoteReport.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/Ninja/Reports/QuoteReport.php b/app/Ninja/Reports/QuoteReport.php index d7ed1f0ade76..704bc4820bd7 100644 --- a/app/Ninja/Reports/QuoteReport.php +++ b/app/Ninja/Reports/QuoteReport.php @@ -19,19 +19,17 @@ class QuoteReport extends AbstractReport public function run() { $account = Auth::user()->account; - $status = $this->options['invoice_status']; + $statusIds = $this->options['status_ids']; $exportFormat = $this->options['export_format']; $clients = Client::scope() ->orderBy('name') ->withArchived() ->with('contacts') - ->with(['invoices' => function ($query) use ($status) { - if ($status == 'draft') { - $query->whereIsPublic(false); - } + ->with(['invoices' => function ($query) use ($statusIds) { $query->quotes() ->withArchived() + ->statusIds($statusIds) ->where('invoice_date', '>=', $this->startDate) ->where('invoice_date', '<=', $this->endDate) ->with(['invoice_items']);