mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-20 11:48:27 -06:00
Merge pull request #4207 from sephrat/develop
Fix 'spent per day' budget box
This commit is contained in:
commit
459d57befa
@ -97,7 +97,9 @@ class BoxController extends Controller
|
||||
// also calculate spent per day.
|
||||
$spent = $opsRepository->sumExpenses($start, $end, null, null, $currency);
|
||||
$spentAmount = $spent[(int) $currency->id]['sum'] ?? '0';
|
||||
$spentPerDay = '-1';
|
||||
|
||||
$days = $today->between($start, $end) ? $today->diffInDays($start) + 1 : $end->diffInDays($start) + 1;
|
||||
$spentPerDay = bcdiv($spentAmount, (string) $days);
|
||||
if ($availableBudgets->count() > 0) {
|
||||
$display = 0; // assume user overspent
|
||||
$boxTitle = (string) trans('firefly.overspent');
|
||||
|
Loading…
Reference in New Issue
Block a user