Commit e9da2cab authored by Mahmoud Aglan's avatar Mahmoud Aglan

Pre-fill participant in collect-payment wizard when launched from profile

Passing ?participant=uuid from the participant profile button now skips
step 1 entirely — the wizard opens directly on step 2 (invoice selection)
with the participant already selected.
Co-Authored-By: 's avatarClaude Sonnet 4.6 <noreply@anthropic.com>
parent ca341bc6
......@@ -44,10 +44,19 @@ class CollectPaymentWizard extends Component
public ?string $participant_uuid = null;
public ?string $invoice_uuid = null;
public function mount(): void
public function mount(?string $participant = null): void
{
$this->authorize('invoices.create');
$this->branchId = $this->getActiveBranchIdOrFail();
if ($participant) {
$p = Participant::with('person')->where('uuid', $participant)->first();
if ($p) {
$this->selected_participant_id = $p->id;
$this->selected_participant_name = $p->person?->name_ar ?? $p->person?->name ?? '';
$this->currentStep = 2;
}
}
}
public function rules(): array
......
......@@ -166,7 +166,7 @@ class="inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium bg-green
@endcan
@can('payments.create')
<a href="{{ route('receptionist.collect-payment') }}" wire:navigate
<a href="{{ route('receptionist.collect-payment', ['participant' => $participant->uuid]) }}" wire:navigate
class="inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium bg-emerald-50 text-emerald-700 border border-emerald-200 rounded-lg hover:bg-emerald-100 transition">
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2m2 4h10a2 2 0 002-2v-6a2 2 0 00-2-2H9a2 2 0 00-2 2v6a2 2 0 002 2zm7-5a2 2 0 11-4 0 2 2 0 014 0z"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment