Skip to content

Commit

Permalink
Fixed previous budget search.
Browse files Browse the repository at this point in the history
Resolves #19

* Fixes an issue that when previous budget is searched, user was not taken into account.
  • Loading branch information
devbanana committed Oct 13, 2014
1 parent 671ae2a commit 086a445
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Devbanana/BudgetBundle/Entity/BudgetRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 086a445

Please sign in to comment.