mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Hide draft invoices from the dashboard
This commit is contained in:
parent
5d6d578b46
commit
c65f09d6ab
@ -141,6 +141,7 @@ class DashboardRepository
|
||||
if ($entityType == ENTITY_INVOICE) {
|
||||
$records->select(DB::raw('sum(invoices.amount) as total, sum(invoices.balance) as balance, count(invoices.id) as count, '.$timeframe.' as '.$groupBy))
|
||||
->where('invoice_type_id', '=', INVOICE_TYPE_STANDARD)
|
||||
->where('invoices.is_public', '=', true)
|
||||
->where('is_recurring', '=', false);
|
||||
} elseif ($entityType == ENTITY_PAYMENT) {
|
||||
$records->select(DB::raw('sum(payments.amount - payments.refunded) as total, count(payments.id) as count, '.$timeframe.' as '.$groupBy))
|
||||
@ -171,6 +172,7 @@ class DashboardRepository
|
||||
->where('clients.is_deleted', '=', false)
|
||||
->where('invoices.is_deleted', '=', false)
|
||||
->where('invoices.is_recurring', '=', false)
|
||||
->where('invoices.is_public', '=', true)
|
||||
->where('invoices.invoice_type_id', '=', INVOICE_TYPE_STANDARD);
|
||||
|
||||
if (! $viewAll) {
|
||||
@ -232,6 +234,7 @@ class DashboardRepository
|
||||
->where('accounts.id', '=', $accountId)
|
||||
->where('clients.is_deleted', '=', false)
|
||||
->where('invoices.is_deleted', '=', false)
|
||||
->where('invoices.is_public', '=', true)
|
||||
->where('invoices.invoice_type_id', '=', INVOICE_TYPE_STANDARD)
|
||||
->where('invoices.is_recurring', '=', false);
|
||||
|
||||
@ -297,6 +300,7 @@ class DashboardRepository
|
||||
->where('invoices.balance', '>', 0)
|
||||
->where('invoices.is_deleted', '=', false)
|
||||
->where('invoices.deleted_at', '=', null)
|
||||
->where('invoices.is_public', '=', true)
|
||||
->where('contacts.is_primary', '=', true)
|
||||
->where('invoices.due_date', '<', date('Y-m-d'));
|
||||
|
||||
@ -323,6 +327,7 @@ class DashboardRepository
|
||||
->where('invoices.quote_invoice_id', '=', null)
|
||||
->where('invoices.balance', '>', 0)
|
||||
->where('invoices.is_deleted', '=', false)
|
||||
->where('invoices.is_public', '=', true)
|
||||
->where('contacts.is_primary', '=', true)
|
||||
->where('invoices.due_date', '>=', date('Y-m-d'))
|
||||
->orderBy('invoices.due_date', 'asc');
|
||||
|
Loading…
Reference in New Issue
Block a user