mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Fix for income entry.
This commit is contained in:
@@ -223,11 +223,14 @@ class ReportController extends Controller
|
|||||||
$journals = $repository->journalsInPeriod(new Collection([$account]), $types, $attributes['startDate'], $attributes['endDate']);
|
$journals = $repository->journalsInPeriod(new Collection([$account]), $types, $attributes['startDate'], $attributes['endDate']);
|
||||||
$destinations = $attributes['accounts']->pluck('id')->toArray();
|
$destinations = $attributes['accounts']->pluck('id')->toArray();
|
||||||
// filter for transfers and withdrawals FROM the given $account
|
// filter for transfers and withdrawals FROM the given $account
|
||||||
|
|
||||||
$journals = $journals->filter(
|
$journals = $journals->filter(
|
||||||
function (TransactionJournal $journal) use ($account, $destinations) {
|
function (TransactionJournal $journal) use ($account, $destinations) {
|
||||||
|
$currentSources = TransactionJournal::sourceAccountList($journal)->pluck('id')->toArray();
|
||||||
|
$currentDest = TransactionJournal::destinationAccountList($journal)->pluck('id')->toArray();
|
||||||
if (
|
if (
|
||||||
$journal->source_account_id === $account->id
|
!empty(array_intersect([$account->id], $currentSources))
|
||||||
&& in_array($journal->destination_account_id, $destinations)
|
&& !empty(array_intersect($destinations, $currentDest))
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user