From bd58a502b4df5a5bfb598bcb0c8820d4ec2eed24 Mon Sep 17 00:00:00 2001 From: Kenneth Trecy Tobias Date: Thu, 30 Nov 2023 22:24:56 +0800 Subject: [PATCH] internal(frozen period): retain summary on used currencies only --- app/Controllers/FrozenPeriodController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Controllers/FrozenPeriodController.php b/app/Controllers/FrozenPeriodController.php index ca9e848..59028c5 100644 --- a/app/Controllers/FrozenPeriodController.php +++ b/app/Controllers/FrozenPeriodController.php @@ -655,6 +655,11 @@ function ($groups, $account) use ($keyed_calculations) { $statements = array_reduce( $currencies, function ($statements, $currency) use ($grouped_summaries) { + if (!isset($grouped_summaries[$currency->id])) { + // Include currencies only used in statements + return $statements; + } + $summaries = $grouped_summaries[$currency->id]; $unadjusted_total_income = array_reduce(