Add invoice w/o due date in dashboard

This commit is contained in:
Hillel Coren 2017-12-23 21:25:58 +02:00
parent 569cfdb5d2
commit b12b07a8f6

View File

@ -337,7 +337,8 @@ class DashboardRepository
->where('invoices.is_public', '=', true) ->where('invoices.is_public', '=', true)
->where('contacts.is_primary', '=', true) ->where('contacts.is_primary', '=', true)
->where(function($query) { ->where(function($query) {
$query->where(DB::raw("coalesce(invoices.partial_due_date, invoices.due_date)"), '>=', date('Y-m-d')); $query->where(DB::raw("coalesce(invoices.partial_due_date, invoices.due_date)"), '>=', date('Y-m-d'))
->orWhereNull('invoices.due_date');
}) })
->orderBy('invoices.due_date', 'asc'); ->orderBy('invoices.due_date', 'asc');