From 086a445f93ff8298ffe92cf24bc20801bfed7ec8 Mon Sep 17 00:00:00 2001 From: Brandon Olivares Date: Mon, 13 Oct 2014 08:56:10 -0400 Subject: [PATCH] Fixed previous budget search. Resolves #19 * Fixes an issue that when previous budget is searched, user was not taken into account. --- src/Devbanana/BudgetBundle/Entity/BudgetRepository.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Devbanana/BudgetBundle/Entity/BudgetRepository.php b/src/Devbanana/BudgetBundle/Entity/BudgetRepository.php index 0b18728..924b373 100644 --- a/src/Devbanana/BudgetBundle/Entity/BudgetRepository.php +++ b/src/Devbanana/BudgetBundle/Entity/BudgetRepository.php @@ -119,7 +119,10 @@ public function getNotBudgetedLastMonth(Budget $budget) $lastMonth = clone $budget->getMonth(); $lastMonth->modify('-1 month'); - $lastMonthBudget = $this->findOneByMonth($lastMonth); + $lastMonthBudget = $this->findOneBy(array( + 'month' => $lastMonth, + 'user' => $budget->getUser(), + )); if ($lastMonthBudget) { return $this->getAvailableToBudget($lastMonthBudget);