Month report optimised.

This commit is contained in:
James Cole
2016-01-01 19:46:12 +01:00
parent 54ede8aa18
commit 59731878f6
7 changed files with 177 additions and 52 deletions

View File

@@ -26,9 +26,6 @@ class BalanceLine
/** @var BudgetModel */
protected $budget;
/** @var LimitRepetition */
protected $repetition;
protected $role = self::ROLE_DEFAULTROLE;
/**
@@ -110,7 +107,7 @@ class BalanceLine
*/
public function leftOfRepetition()
{
$start = $this->getRepetition() ? $this->getRepetition()->amount : 0;
$start = isset($this->budget->amount) ? $this->budget->amount : 0;
/** @var BalanceEntry $balanceEntry */
foreach ($this->getBalanceEntries() as $balanceEntry) {
$start += $balanceEntry->getSpent();
@@ -119,22 +116,6 @@ class BalanceLine
return $start;
}
/**
* @return LimitRepetition
*/
public function getRepetition()
{
return $this->repetition;
}
/**
* @param LimitRepetition $repetition
*/
public function setRepetition($repetition)
{
$this->repetition = $repetition;
}
/**
* @return Collection
*/