Some math fixes. Not bugs.

This commit is contained in:
James Cole
2015-07-06 18:04:13 +02:00
parent a4cc25175a
commit 93b6c68938
6 changed files with 26 additions and 18 deletions

View File

@@ -93,6 +93,7 @@ class BudgetController extends Controller
{
$start = clone $repetition->startdate;
$end = $repetition->enddate;
bcscale(2);
// chart properties for cache:
$cache = new CacheProperties();
@@ -113,8 +114,8 @@ class BudgetController extends Controller
/*
* Sum of expenses on this day:
*/
$sum = $repository->expensesOnDayCorrected($budget, $start);
$amount += $sum;
$sum = $repository->expensesOnDayCorrected($budget, $start);
$amount = bcadd($amount, $sum);
$entries->push([clone $start, $amount]);
$start->addDay();
}