mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-05 21:53:08 -06:00
Expand query, let's see what happens.
This commit is contained in:
parent
152d0eb1d0
commit
1423d5b314
@ -279,12 +279,15 @@ class ReportQuery implements ReportQueryInterface
|
|||||||
$ids[] = $account->id;
|
$ids[] = $account->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// only get deposits not to a shared account
|
|
||||||
// and transfers to a shared account.
|
|
||||||
|
|
||||||
// OR is a deposit
|
// OR is a deposit
|
||||||
// OR is a transfer FROM a shared account to NOT a shared account.
|
// OR is a transfer FROM a shared account to NOT a shared account.
|
||||||
//
|
//
|
||||||
|
// New idea: from the perspective of a shared account,
|
||||||
|
// a transfer from a not-shared account is income!
|
||||||
|
// so:
|
||||||
|
// OR is a transfer from NOT a shared account to a shared account.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$query->where(
|
$query->where(
|
||||||
function (Builder $query) {
|
function (Builder $query) {
|
||||||
@ -300,6 +303,13 @@ class ReportQuery implements ReportQueryInterface
|
|||||||
$q->where('acm_to.data', '!=', '"sharedAsset"');
|
$q->where('acm_to.data', '!=', '"sharedAsset"');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
$query->orWhere(
|
||||||
|
function (Builder $q) {
|
||||||
|
$q->where('transaction_types.type', TransactionType::TRANSFER);
|
||||||
|
$q->where('acm_from.data', '!=', '"sharedAsset"');
|
||||||
|
$q->where('acm_to.data', '=', '"sharedAsset"');
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user