Various code to fix checkboxes.

This commit is contained in:
James Cole
2018-06-18 21:07:09 +02:00
parent 0374c32236
commit 56bc79d64e
21 changed files with 97 additions and 24 deletions

View File

@@ -161,10 +161,13 @@ class BillController extends Controller
$bill->amount_max = round($bill->amount_max, $currency->decimal_places);
$defaultCurrency = app('amount')->getDefaultCurrency();
// code to handle active-checkboxes
$hasOldInput = null !== $request->old('_token');
$preFilled = [
'notes' => $this->billRepository->getNoteText($bill),
'transaction_currency_id' => $bill->transaction_currency_id,
'active' => $bill->active,
'active' => $hasOldInput ? (bool)$request->old('active') : $bill->active,
];
$request->session()->flash('preFilled', $preFilled);