Restore old behavior

This commit is contained in:
James Cole
2024-03-17 12:00:28 +01:00
parent ab2772abe0
commit 3913fa5086
18 changed files with 51 additions and 51 deletions

View File

@@ -97,10 +97,10 @@ class HomeController extends Controller
app('log')->debug('Range is now marked as "custom".');
}
$diff = $start->diffInDays($end) + 1;
$diff = $start->diffInDays($end, true) + 1;
if ($diff > 50) {
$request->session()->flash('warning', (string)trans('firefly.warning_much_data', ['days' => $diff]));
$request->session()->flash('warning', (string)trans('firefly.warning_much_data', ['days' => (int)$diff]));
}
$request->session()->put('is_custom_range', $isCustomRange);

View File

@@ -113,7 +113,7 @@ class BoxController extends Controller
$spentAmount = $spent[$currency->id]['sum'] ?? '0';
app('log')->debug(sprintf('Spent for default currency for all budgets in this period: %s', $spentAmount));
$days = $today->between($start, $end) ? $today->diffInDays($start) + 1 : $end->diffInDays($start) + 1;
$days = (int)($today->between($start, $end) ? $today->diffInDays($start, true) + 1 : $end->diffInDays($start, true) + 1);
app('log')->debug(sprintf('Number of days left: %d', $days));
$spentPerDay = bcdiv($spentAmount, (string)$days);
app('log')->debug(sprintf('Available to spend per day: %s', $spentPerDay));