Fix for #219 - multiple currencies on dashboard

This commit is contained in:
Hillel Coren 2015-01-27 00:38:54 +02:00
parent 39c6656e49
commit 1a7a4499af

View File

@ -31,7 +31,7 @@ class DashboardController extends \BaseController
->where('accounts.id', '=', Auth::user()->account_id) ->where('accounts.id', '=', Auth::user()->account_id)
->where('clients.is_deleted', '=', false) ->where('clients.is_deleted', '=', false)
->groupBy('accounts.id') ->groupBy('accounts.id')
->groupBy('clients.currency_id') ->groupBy(DB::raw('CASE WHEN clients.currency_id IS NULL THEN CASE WHEN accounts.currency_id IS NULL THEN 1 ELSE accounts.currency_id END ELSE clients.currency_id END'))
->get(); ->get();
$activities = Activity::where('activities.account_id', '=', Auth::user()->account_id) $activities = Activity::where('activities.account_id', '=', Auth::user()->account_id)