From d49988ed7a3c722aadf04d9fa728710b6270fa22 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 29 Dec 2016 14:30:23 +0200 Subject: [PATCH] Only show paid invoices for ninja accounts --- app/Ninja/Repositories/InvoiceRepository.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Ninja/Repositories/InvoiceRepository.php b/app/Ninja/Repositories/InvoiceRepository.php index acf7d80033..a63eda9862 100644 --- a/app/Ninja/Repositories/InvoiceRepository.php +++ b/app/Ninja/Repositories/InvoiceRepository.php @@ -234,6 +234,8 @@ class InvoiceRepository extends BaseRepository ->where('contacts.is_primary', '=', true) ->where('invoices.is_recurring', '=', false) ->where('invoices.is_public', '=', true) + // Only show paid invoices for ninja accounts + ->whereRaw(sprintf("((accounts.account_key != '%s' and accounts.account_key != '%s') or invoices.invoice_status_id = %d)", env('NINJA_LICENSE_ACCOUNT_KEY'), NINJA_ACCOUNT_KEY, INVOICE_STATUS_PAID)) // This needs to be a setting to also hide the activity on the dashboard page //->where('invoices.invoice_status_id', '>=', INVOICE_STATUS_SENT) ->select(