Make sure sorting doesnt break opening balance.

This commit is contained in:
James Cole
2020-07-26 15:05:48 +02:00
parent c86673f3ec
commit fdea25051c
11 changed files with 162 additions and 9 deletions

View File

@@ -91,7 +91,7 @@ trait ChartGeneration
while ($currentStart <= $end) {
$format = $currentStart->format('Y-m-d');
$label = trim($currentStart->formatLocalized((string)trans('config.month_and_day', [], $locale)));
$balance = isset($range[$format]) ? round($range[$format], 12) : $previous;
$balance = $range[$format] ?? $previous;
$previous = $balance;
$currentStart->addDay();
$currentSet['entries'][$label] = $balance;