diff --git a/app/Helpers/Collection/BalanceLine.php b/app/Helpers/Collection/BalanceLine.php index 0c8ca55853..daa2f028a9 100644 --- a/app/Helpers/Collection/BalanceLine.php +++ b/app/Helpers/Collection/BalanceLine.php @@ -113,7 +113,7 @@ class BalanceLine $start = $this->getRepetition() ? $this->getRepetition()->amount : 0; /** @var BalanceEntry $balanceEntry */ foreach ($this->getBalanceEntries() as $balanceEntry) { - $start += $balanceEntry->getSpent(); + $start -= $balanceEntry->getSpent(); } return $start; diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.php index 9419c173aa..ae9bd4ca1a 100644 --- a/app/Helpers/Report/ReportHelper.php +++ b/app/Helpers/Report/ReportHelper.php @@ -134,6 +134,7 @@ class ReportHelper implements ReportHelperInterface // get budget amount for current period: $rep = $repository->getCurrentRepetition($budget, $start, $end); + // could be null? $line->setRepetition($rep); // loop accounts: diff --git a/resources/twig/partials/reports/balance.twig b/resources/twig/partials/reports/balance.twig index 2fb091b949..6dd4da9c49 100644 --- a/resources/twig/partials/reports/balance.twig +++ b/resources/twig/partials/reports/balance.twig @@ -35,7 +35,7 @@ {% for balanceEntry in balanceLine.getBalanceEntries %} {% if balanceEntry.getSpent != 0 %} - {{ (balanceEntry.getSpent*-1)|formatAmountPlain }} + {{ (balanceEntry.getSpent)|formatAmountPlain }} {% endif %} {% if balanceEntry.getLeft != 0 %} {{ (balanceEntry.getLeft)|formatAmountPlain }}