From 0c90171a4900c6d7bc5e5cc95df06c47ad1e2f73 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 1 Jul 2020 19:47:32 +0200 Subject: [PATCH] Fix range for #3513 --- app/Http/Controllers/Chart/BudgetController.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index 856773f78e..c0280aae91 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -216,7 +216,6 @@ class BudgetController extends Controller $cache->addProperty($budget->id); $cache->addProperty($budgetLimitId); $cache->addProperty('chart.budget.expense-asset'); - $collector->setRange(session()->get('start'), session()->get('end')); $start = session()->get('start'); $end = session()->get('end'); if (null !== $budgetLimit) { @@ -230,6 +229,7 @@ class BudgetController extends Controller if ($cache->has()) { return response()->json($cache->get()); // @codeCoverageIgnore } + $collector->setRange($start, $end); $collector->setBudget($budget); $journals = $collector->getExtractedJournals(); $result = []; @@ -282,13 +282,12 @@ class BudgetController extends Controller $cache->addProperty($budget->id); $cache->addProperty($budgetLimitId); $cache->addProperty('chart.budget.expense-category'); - $collector->setRange(session()->get('start'), session()->get('end')); $start = session()->get('start'); $end = session()->get('end'); if (null !== $budgetLimit) { $start = $budgetLimit->start_date; $end = $budgetLimit->end_date; - $collector->setRange($budgetLimit->start_date, $budgetLimit->end_date)->setCurrency($budgetLimit->transactionCurrency); + $collector->setCurrency($budgetLimit->transactionCurrency); } $cache->addProperty($start); $cache->addProperty($end); @@ -296,6 +295,7 @@ class BudgetController extends Controller if ($cache->has()) { return response()->json($cache->get()); // @codeCoverageIgnore } + $collector->setRange($start, $end); $collector->setBudget($budget)->withCategoryInformation(); $journals = $collector->getExtractedJournals(); $result = []; @@ -345,7 +345,6 @@ class BudgetController extends Controller $cache->addProperty($budget->id); $cache->addProperty($budgetLimitId); $cache->addProperty('chart.budget.expense-expense'); - $collector->setRange(session()->get('start'), session()->get('end')); $start = session()->get('start'); $end = session()->get('end'); if (null !== $budgetLimit) { @@ -359,7 +358,7 @@ class BudgetController extends Controller if ($cache->has()) { return response()->json($cache->get()); // @codeCoverageIgnore } - + $collector->setRange($start, $end); $collector->setTypes([TransactionType::WITHDRAWAL])->setBudget($budget)->withAccountInformation(); $journals = $collector->getExtractedJournals(); $result = [];