From 9bd1503cb46a6af86e7974cad349712be8c3cb0c Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 12 Dec 2015 20:07:33 +0100 Subject: [PATCH] Expand query to catch all expenses. --- app/Helpers/Report/ReportQuery.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Helpers/Report/ReportQuery.php b/app/Helpers/Report/ReportQuery.php index 5f39c72dd0..e97e4ec370 100644 --- a/app/Helpers/Report/ReportQuery.php +++ b/app/Helpers/Report/ReportQuery.php @@ -383,6 +383,14 @@ class ReportQuery implements ReportQueryInterface $q->where('acm_from.data', '!=', '"sharedAsset"'); } ); + // OR transfers from a NOT shared account to a shared account. + $query->orWhere( + function (Builder $q) { // and transfers from a shared account to a not-shared account. + $q->where('transaction_types.type', TransactionType::TRANSFER); + $q->where('acm_to.data', '!=', '"sharedAsset"'); + $q->where('acm_from.data', '=', '"sharedAsset"'); + } + ); } );