From c38c9608da37ce441d6536110ffef7a8a04da9e0 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 10 Mar 2015 20:01:49 +0100 Subject: [PATCH] Fine tune query. --- app/Helpers/Report/ReportQuery.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Helpers/Report/ReportQuery.php b/app/Helpers/Report/ReportQuery.php index ea10847ce4..b41ac1928f 100644 --- a/app/Helpers/Report/ReportQuery.php +++ b/app/Helpers/Report/ReportQuery.php @@ -416,6 +416,8 @@ class ReportQuery implements ReportQueryInterface ->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id'); if ($showSharedReports === false) { + // get all withdrawals not from a shared accounts + // and all transfers to a shared account $query->where( function ($query) { $query->where( @@ -432,6 +434,9 @@ class ReportQuery implements ReportQueryInterface ); } ); + } else { + // any withdrawal goes: + $query->where('transaction_types.type', 'Withdrawal'); } $query->before($end) ->after($start)