Allow parameter passing to pre-payments

This commit is contained in:
David Bomba 2024-06-12 08:30:22 +10:00
parent 1e7b8e9111
commit 6972d4d4b0
2 changed files with 7 additions and 3 deletions

View File

@ -48,6 +48,9 @@ class PrePaymentController extends Controller
'allows_recurring' => true, 'allows_recurring' => true,
'minimum' => $minimum, 'minimum' => $minimum,
'minimum_amount' => $minimum_amount, 'minimum_amount' => $minimum_amount,
'notes' => request()->has('notes') ? request()->input('notes') : "",
'amount' => request()->has('amount') ? request()->input('amount') : "",
'show' => request()->has('is_recurring') ? "true" : "false",
]; ];
return $this->render('pre_payments.index', $data); return $this->render('pre_payments.index', $data);

View File

@ -27,7 +27,7 @@
</div> </div>
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_details')]) @component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_details')])
<textarea name="notes" class="focus:shadow-soft-primary-outline min-h-unset text-sm leading-5.6 ease-soft block h-auto w-full appearance-none rounded-lg border border-solid border-gray-300 bg-white bg-clip-padding px-3 py-2 font-normal text-gray-700 outline-none transition-all placeholder:text-gray-500 focus:border-fuchsia-300 focus:outline-none"></textarea> <textarea name="notes" class="focus:shadow-soft-primary-outline min-h-unset text-sm leading-5.6 ease-soft block h-auto w-full appearance-none rounded-lg border border-solid border-gray-300 bg-white bg-clip-padding px-3 py-2 font-normal text-gray-700 outline-none transition-all placeholder:text-gray-500 focus:border-fuchsia-300 focus:outline-none">{{ $notes }}</textarea>
@if($errors->has('notes')) @if($errors->has('notes'))
<p class="mt-2 text-red-900 border-red-300 px-2 py-1 bg-gray-100">{{ $errors->first('notes') }}</p> <p class="mt-2 text-red-900 border-red-300 px-2 py-1 bg-gray-100">{{ $errors->first('notes') }}</p>
@ -41,6 +41,7 @@
type="text" type="text"
class="input mt-0 mr-4 relative" class="input mt-0 mr-4 relative"
name="amount" name="amount"
value="{{ $amount }}"
placeholder=""/> placeholder=""/>
@if($minimum > 0) @if($minimum > 0)
@ -54,9 +55,9 @@
@endcomponent @endcomponent
@if($allows_recurring) @if($allows_recurring)
<div x-data="{ show: false }"> <div x-data="{ show: {!! $show !!}, toggle() { this.show = ! this.show } }">
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.enable_recurring')]) @component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.enable_recurring')])
<input x-on:click="show = !show" id="is_recurring" aria-describedby="recurring-description" name="is_recurring" type="checkbox" class="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600"> <input x-on:click="toggle()" id="is_recurring" aria-describedby="recurring-description" name="is_recurring" type="checkbox" class="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" @if($show == "true") checked @endif>
@endcomponent @endcomponent
<div x-cloak x-show="show"> <div x-cloak x-show="show">