From 2396b75e3c22f6a82886e800744823e549ad42ed Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 10 Mar 2015 20:00:43 +0100 Subject: [PATCH] Fine tune income. --- 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 e9355eac14..ea10847ce4 100644 --- a/app/Helpers/Report/ReportQuery.php +++ b/app/Helpers/Report/ReportQuery.php @@ -479,6 +479,8 @@ class ReportQuery implements ReportQueryInterface ->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id'); if ($showSharedReports === false) { + // show queries where transfer type is deposit, and its not to a shared account + // or where its a transfer and its from a shared account (both count as incomes) $query->where( function ($query) { $query->where( @@ -495,6 +497,9 @@ class ReportQuery implements ReportQueryInterface ); } ); + } else { + // any deposit goes: + $query->where('transaction_types.type', 'Deposit'); } $query->before($end)->after($start) ->where('transaction_journals.user_id', Auth::user()->id)