mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-13 22:54:25 +01:00
Remove draft invoices from the dashboard
This commit is contained in:
parent
a919f8dc72
commit
459d662e76
@ -136,6 +136,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))
|
||||
@ -166,6 +167,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){
|
||||
@ -227,6 +229,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);
|
||||
|
||||
@ -292,6 +295,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'));
|
||||
|
||||
@ -318,6 +322,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