mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-22 17:06:39 -06:00
Skip non-existing tags.
This commit is contained in:
parent
c269be7f07
commit
1e31a1184a
@ -155,6 +155,7 @@ class TagController extends Controller
|
||||
*/
|
||||
public function accounts(Collection $accounts, Collection $tags, Carbon $start, Carbon $end)
|
||||
{
|
||||
$tagIds = $tags->pluck('id')->toArray();
|
||||
$spent = $this->opsRepository->listExpenses($start, $end, $accounts, $tags);
|
||||
$earned = $this->opsRepository->listIncome($start, $end, $accounts, $tags);
|
||||
$report = [];
|
||||
@ -184,6 +185,9 @@ class TagController extends Controller
|
||||
'total_sum' => '0',
|
||||
];
|
||||
foreach ($currency['tags'] as $tag) {
|
||||
if(!array_key_exists($tag['id'], $tagIds)) {
|
||||
continue;
|
||||
}
|
||||
foreach ($tag['transaction_journals'] as $journal) {
|
||||
$sourceAccountId = $journal['source_account_id'];
|
||||
$report[$sourceAccountId]['currencies'][$currencyId] ??= [
|
||||
@ -222,6 +226,9 @@ class TagController extends Controller
|
||||
'total_sum' => '0',
|
||||
];
|
||||
foreach ($currency['tags'] as $tag) {
|
||||
if(!array_key_exists($tag['id'], $tagIds)) {
|
||||
continue;
|
||||
}
|
||||
foreach ($tag['transaction_journals'] as $journal) {
|
||||
$destinationAccountId = $journal['destination_account_id'];
|
||||
$report[$destinationAccountId]['currencies'][$currencyId] ??= [
|
||||
@ -446,7 +453,6 @@ class TagController extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
Log::info('Temp report', $report);
|
||||
return view('reports.tag.partials.tags', compact('sums', 'report'));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user