Add cleanup method for issue #7853 and some more debug info.

This commit is contained in:
James Cole
2023-08-15 17:57:02 +02:00
parent 9787561000
commit e3c4dde4ff
4 changed files with 58 additions and 25 deletions

View File

@@ -60,6 +60,7 @@ class BoxController extends Controller
$opsRepository = app(OperationsRepositoryInterface::class);
/** @var AvailableBudgetRepositoryInterface $abRepository */
$abRepository = app(AvailableBudgetRepositoryInterface::class);
$abRepository->cleanup();
/** @var Carbon $start */
$start = session('start', today(config('app.timezone'))->startOfMonth());
/** @var Carbon $end */
@@ -86,6 +87,11 @@ class BoxController extends Controller
$availableBudgets = $availableBudgets->filter(
static function (AvailableBudget $availableBudget) use ($currency) {
if ($availableBudget->transaction_currency_id === $currency->id) {
app('log')->debug(sprintf('Will include AB #%d: from %s-%s amount %s',
$availableBudget->id,
$availableBudget->start_date->format('Y-m-d'),
$availableBudget->end_date->format('Y-m-d'),
$availableBudget->amount));
return $availableBudget;
}