From 1a7a4499af470e57036151eb2ebb942f11f3f04c Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 27 Jan 2015 00:38:54 +0200 Subject: [PATCH] Fix for #219 - multiple currencies on dashboard --- app/controllers/DashboardController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/DashboardController.php b/app/controllers/DashboardController.php index debe28872c84..5c42d2a3cb28 100644 --- a/app/controllers/DashboardController.php +++ b/app/controllers/DashboardController.php @@ -31,7 +31,7 @@ class DashboardController extends \BaseController ->where('accounts.id', '=', Auth::user()->account_id) ->where('clients.is_deleted', '=', false) ->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(); $activities = Activity::where('activities.account_id', '=', Auth::user()->account_id)