Update available budgets code.

This commit is contained in:
James Cole
2024-12-30 10:51:34 +01:00
parent 760da08ab7
commit 62f4da6063
28 changed files with 65 additions and 61 deletions

View File

@@ -91,10 +91,9 @@ class EditController extends Controller
// code to handle active-checkboxes
$hasOldInput = null !== $request->old('_token');
$currency = app('amount')->getDefaultCurrency();
$preFilled = [
'active' => $hasOldInput ? (bool) $request->old('active') : $budget->active,
'auto_budget_currency_id' => $hasOldInput ? (int) $request->old('auto_budget_currency_id') : $currency->id,
'auto_budget_currency_id' => $hasOldInput ? (int) $request->old('auto_budget_currency_id') : $this->defaultCurrency->id,
];
if (null !== $autoBudget) {
$amount = $hasOldInput ? $request->old('auto_budget_amount') : $autoBudget->amount;