Fine tune query.

This commit is contained in:
James Cole 2015-03-10 20:01:49 +01:00
parent 2396b75e3c
commit c38c9608da

View File

@ -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)