Commit 7f52ca38 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix broken links, add cross-links, and wire up navigation across views

- Fix "Record Payment" button on participant-show (was linking to list)
- Add clickable links in enrollment-list (participant, group, program)
- Add participant links on invoice contact names (list + show)
- Add print button on invoice-show, print link on group-list
- Add bulk-status link on participant-list
- Link wizard success screens to participant/invoice views
- Fix guardian dashboard: child names, invoices, groups now clickable
- Add missing model relationships: Branch (participants, groups,
  facilities, cashSessions), Payment (branch, cashSession),
  CashSession (payments, posTransactions), TrainingSchedule (facility),
  Participant (branch, wallet, invoices, payments, attendance, POS,
  evaluations), Invoice (enrollments, posTransaction)
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 1e55b9c5
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
use App\Models\User; use App\Models\User;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
class CashSession extends Model class CashSession extends Model
{ {
...@@ -51,6 +52,16 @@ public function closedBy(): BelongsTo ...@@ -51,6 +52,16 @@ public function closedBy(): BelongsTo
return $this->belongsTo(User::class, 'closed_by'); return $this->belongsTo(User::class, 'closed_by');
} }
public function payments(): HasMany
{
return $this->hasMany(Payment::class);
}
public function posTransactions(): HasMany
{
return $this->hasMany(\App\Domain\POS\Models\POSTransaction::class);
}
public function isOpen(): bool public function isOpen(): bool
{ {
return $this->status === 'open'; return $this->status === 'open';
......
...@@ -100,6 +100,16 @@ public function approver(): BelongsTo ...@@ -100,6 +100,16 @@ public function approver(): BelongsTo
return $this->belongsTo(User::class, 'approved_by'); return $this->belongsTo(User::class, 'approved_by');
} }
public function enrollments(): HasMany
{
return $this->hasMany(\App\Domain\Training\Models\Enrollment::class);
}
public function posTransaction(): HasOne
{
return $this->hasOne(\App\Domain\POS\Models\POSTransaction::class);
}
public function recalculateTotals(): void public function recalculateTotals(): void
{ {
$this->subtotal_amount = $this->items()->sum('total_amount'); $this->subtotal_amount = $this->items()->sum('total_amount');
......
...@@ -79,6 +79,16 @@ public function creator(): BelongsTo ...@@ -79,6 +79,16 @@ public function creator(): BelongsTo
return $this->belongsTo(User::class, 'created_by'); return $this->belongsTo(User::class, 'created_by');
} }
public function branch(): BelongsTo
{
return $this->belongsTo(\App\Domain\Identity\Models\Branch::class);
}
public function cashSession(): BelongsTo
{
return $this->belongsTo(CashSession::class);
}
public function isInbound(): bool public function isInbound(): bool
{ {
return $this->direction === 'inbound'; return $this->direction === 'inbound';
......
...@@ -37,4 +37,24 @@ public function users(): HasMany ...@@ -37,4 +37,24 @@ public function users(): HasMany
{ {
return $this->hasMany(\App\Models\User::class); return $this->hasMany(\App\Models\User::class);
} }
public function participants(): HasMany
{
return $this->hasMany(\App\Domain\Participant\Models\Participant::class);
}
public function groups(): HasMany
{
return $this->hasMany(\App\Domain\Training\Models\TrainingGroup::class);
}
public function facilities(): HasMany
{
return $this->hasMany(\App\Domain\Facility\Models\Facility::class);
}
public function cashSessions(): HasMany
{
return $this->hasMany(\App\Domain\Financial\Models\CashSession::class);
}
} }
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Database\Eloquent\Relations\MorphOne;
use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\SoftDeletes;
class Participant extends Model class Participant extends Model
...@@ -130,6 +132,41 @@ public function activeEnrollments(): HasMany ...@@ -130,6 +132,41 @@ public function activeEnrollments(): HasMany
->where('status', 'active'); ->where('status', 'active');
} }
public function branch(): BelongsTo
{
return $this->belongsTo(\App\Domain\Identity\Models\Branch::class);
}
public function wallet(): MorphOne
{
return $this->morphOne(\App\Domain\Financial\Models\Wallet::class, 'owner');
}
public function invoices(): MorphMany
{
return $this->morphMany(\App\Domain\Financial\Models\Invoice::class, 'billable');
}
public function payments(): MorphMany
{
return $this->morphMany(\App\Domain\Financial\Models\Payment::class, 'payer');
}
public function attendanceRecords(): MorphMany
{
return $this->morphMany(\App\Domain\Attendance\Models\AttendanceRecord::class, 'subject');
}
public function posTransactions(): HasMany
{
return $this->hasMany(\App\Domain\POS\Models\POSTransaction::class);
}
public function evaluations(): HasMany
{
return $this->hasMany(\App\Domain\Training\Models\Evaluation::class);
}
// ─── Accessors ──────────────────────────────────────────── // ─── Accessors ────────────────────────────────────────────
public function getFullNameAttribute(): string public function getFullNameAttribute(): string
......
...@@ -44,6 +44,11 @@ public function assistantTrainer(): BelongsTo ...@@ -44,6 +44,11 @@ public function assistantTrainer(): BelongsTo
return $this->belongsTo(User::class, 'assistant_trainer_id'); return $this->belongsTo(User::class, 'assistant_trainer_id');
} }
public function facility(): BelongsTo
{
return $this->belongsTo(\App\Domain\Facility\Models\Facility::class);
}
public function sessions(): HasMany public function sessions(): HasMany
{ {
return $this->hasMany(TrainingSession::class, 'schedule_id'); return $this->hasMany(TrainingSession::class, 'schedule_id');
......
...@@ -41,6 +41,8 @@ class CollectPaymentWizard extends Component ...@@ -41,6 +41,8 @@ class CollectPaymentWizard extends Component
public ?string $receipt_number = null; public ?string $receipt_number = null;
public ?string $last_payment_uuid = null; public ?string $last_payment_uuid = null;
public int $paid_amount = 0; public int $paid_amount = 0;
public ?string $participant_uuid = null;
public ?string $invoice_uuid = null;
public function mount(): void public function mount(): void
{ {
...@@ -165,6 +167,12 @@ public function confirm(PaymentService $service): void ...@@ -165,6 +167,12 @@ public function confirm(PaymentService $service): void
$this->paid_amount = $amountPiasters; $this->paid_amount = $amountPiasters;
$this->currentStep = 5; $this->currentStep = 5;
// Store UUIDs for navigation links
$participant = \App\Domain\Participant\Models\Participant::find($this->selected_participant_id);
$this->participant_uuid = $participant?->uuid;
$invoice = \App\Domain\Financial\Models\Invoice::find($this->selected_invoice_id);
$this->invoice_uuid = $invoice?->uuid;
session()->flash('success', __('تم تسجيل الدفع بنجاح')); session()->flash('success', __('تم تسجيل الدفع بنجاح'));
} catch (DomainException $e) { } catch (DomainException $e) {
session()->flash('error', $e->getMessage()); session()->flash('error', $e->getMessage());
......
...@@ -38,6 +38,8 @@ class EnrollExistingWizard extends Component ...@@ -38,6 +38,8 @@ class EnrollExistingWizard extends Component
// Result // Result
public bool $completed = false; public bool $completed = false;
public ?string $created_participant_uuid = null;
public ?string $created_invoice_uuid = null;
public function mount(): void public function mount(): void
{ {
...@@ -119,7 +121,7 @@ public function confirm(): void ...@@ -119,7 +121,7 @@ public function confirm(): void
/** @var \App\Domain\Training\Services\EnrollmentService $enrollmentService */ /** @var \App\Domain\Training\Services\EnrollmentService $enrollmentService */
$enrollmentService = app(\App\Domain\Training\Services\EnrollmentService::class); $enrollmentService = app(\App\Domain\Training\Services\EnrollmentService::class);
$enrollmentService->enrollInProgram([ $enrollment = $enrollmentService->enrollInProgram([
'participant_id' => $this->selected_participant_id, 'participant_id' => $this->selected_participant_id,
'program_id' => $this->selected_program_id, 'program_id' => $this->selected_program_id,
'pay_now' => $this->pay_now, 'pay_now' => $this->pay_now,
...@@ -129,6 +131,14 @@ public function confirm(): void ...@@ -129,6 +131,14 @@ public function confirm(): void
$this->completed = true; $this->completed = true;
$this->currentStep = 4; $this->currentStep = 4;
// Store UUIDs for navigation links
$participant = Participant::find($this->selected_participant_id);
$this->created_participant_uuid = $participant?->uuid;
if ($enrollment && $enrollment->invoice_id) {
$invoice = \App\Domain\Financial\Models\Invoice::find($enrollment->invoice_id);
$this->created_invoice_uuid = $invoice?->uuid;
}
session()->flash('success', __('تم التسجيل في البرنامج بنجاح')); session()->flash('success', __('تم التسجيل في البرنامج بنجاح'));
} catch (DomainException $e) { } catch (DomainException $e) {
session()->flash('error', $e->getMessage()); session()->flash('error', $e->getMessage());
......
...@@ -69,10 +69,12 @@ class NewRegistrationWizard extends Component ...@@ -69,10 +69,12 @@ class NewRegistrationWizard extends Component
// Result // Result
public bool $completed = false; public bool $completed = false;
public ?string $participant_number = null; public ?string $participant_number = null;
public ?string $participant_uuid = null;
public ?string $enrollment_summary = null; public ?string $enrollment_summary = null;
public ?int $invoice_amount = null; public ?int $invoice_amount = null;
public ?string $invoice_number = null; public ?string $invoice_number = null;
public ?int $invoiceId = null; public ?int $invoiceId = null;
public ?string $invoice_uuid = null;
public bool $payment_recorded = false; public bool $payment_recorded = false;
// Pre-flight errors — blocks wizard from starting // Pre-flight errors — blocks wizard from starting
...@@ -424,7 +426,11 @@ public function confirm(): void ...@@ -424,7 +426,11 @@ public function confirm(): void
$this->completed = true; $this->completed = true;
$this->participant_number = $participant->participant_number; $this->participant_number = $participant->participant_number;
$this->participant_uuid = $participant->uuid;
$this->enrollment_summary = $program->name_ar . ' — ' . ($enrollment->group?->name_ar ?? ''); $this->enrollment_summary = $program->name_ar . ' — ' . ($enrollment->group?->name_ar ?? '');
if ($invoice) {
$this->invoice_uuid = $invoice->uuid;
}
$this->currentStep = 6; $this->currentStep = 6;
}); });
......
...@@ -71,20 +71,24 @@ class="w-full px-3 py-2 text-sm border border-gray-300 rounded-lg focus:ring-2 f ...@@ -71,20 +71,24 @@ class="w-full px-3 py-2 text-sm border border-gray-300 rounded-lg focus:ring-2 f
@forelse($enrollments as $enrollment) @forelse($enrollments as $enrollment)
<tr class="hover:bg-gray-50"> <tr class="hover:bg-gray-50">
<td class="px-4 py-3"> <td class="px-4 py-3">
<span class="font-medium text-gray-800"> <a href="{{ route('participants.show', $enrollment->participant) }}" wire:navigate class="text-blue-600 hover:text-blue-800 hover:underline font-medium">
{{ $enrollment->participant?->person?->name_ar ?? '—' }} {{ $enrollment->participant?->person?->name_ar ?? '—' }}
</span> </a>
@if($enrollment->participant?->participant_number) @if($enrollment->participant?->participant_number)
<p class="text-xs text-gray-500" dir="ltr"> <p class="text-xs text-gray-500" dir="ltr">
{{ $enrollment->participant->participant_number }} {{ $enrollment->participant->participant_number }}
</p> </p>
@endif @endif
</td> </td>
<td class="px-4 py-3 text-gray-600"> <td class="px-4 py-3">
<a href="{{ route('groups.edit', $enrollment->group) }}" wire:navigate class="text-gray-700 hover:text-blue-600 hover:underline">
{{ $enrollment->group?->name_ar ?? '—' }} {{ $enrollment->group?->name_ar ?? '—' }}
</a>
</td> </td>
<td class="px-4 py-3 text-gray-600"> <td class="px-4 py-3">
<a href="{{ route('programs.edit', $enrollment->program) }}" wire:navigate class="text-gray-500 hover:text-blue-600 hover:underline text-xs">
{{ $enrollment->program?->name_ar ?? '—' }} {{ $enrollment->program?->name_ar ?? '—' }}
</a>
</td> </td>
<td class="px-4 py-3 text-center"> <td class="px-4 py-3 text-center">
@php @php
...@@ -227,8 +231,10 @@ class="mt-2 text-blue-600 hover:text-blue-800 text-sm font-medium py-2"> ...@@ -227,8 +231,10 @@ class="mt-2 text-blue-600 hover:text-blue-800 text-sm font-medium py-2">
<div class="bg-white rounded-xl shadow-sm border border-gray-200 p-4"> <div class="bg-white rounded-xl shadow-sm border border-gray-200 p-4">
<div class="flex items-start justify-between gap-3 mb-3"> <div class="flex items-start justify-between gap-3 mb-3">
<div class="min-w-0 flex-1"> <div class="min-w-0 flex-1">
<h3 class="font-medium text-gray-800 truncate"> <h3 class="truncate">
<a href="{{ route('participants.show', $enrollment->participant) }}" wire:navigate class="text-blue-600 hover:text-blue-800 hover:underline font-medium">
{{ $enrollment->participant?->person?->name_ar ?? '—' }} {{ $enrollment->participant?->person?->name_ar ?? '—' }}
</a>
</h3> </h3>
@if($enrollment->participant?->participant_number) @if($enrollment->participant?->participant_number)
<p class="text-xs text-gray-500 mt-0.5" dir="ltr"> <p class="text-xs text-gray-500 mt-0.5" dir="ltr">
...@@ -246,12 +252,19 @@ class="mt-2 text-blue-600 hover:text-blue-800 text-sm font-medium py-2"> ...@@ -246,12 +252,19 @@ class="mt-2 text-blue-600 hover:text-blue-800 text-sm font-medium py-2">
</div> </div>
</div> </div>
<div class="flex items-center gap-4 text-sm text-gray-600 mb-3"> <div class="flex items-center gap-4 text-sm mb-3">
@if($enrollment->group?->name_ar) @if($enrollment->group?->name_ar)
<span class="truncate">{{ $enrollment->group->name_ar }}</span> <a href="{{ route('groups.edit', $enrollment->group) }}" wire:navigate class="text-gray-700 hover:text-blue-600 hover:underline truncate">
{{ $enrollment->group->name_ar }}
</a>
@endif
@if($enrollment->program?->name_ar)
<a href="{{ route('programs.edit', $enrollment->program) }}" wire:navigate class="text-gray-500 hover:text-blue-600 hover:underline text-xs truncate">
{{ $enrollment->program->name_ar }}
</a>
@endif @endif
@if($enrollment->enrollment_date) @if($enrollment->enrollment_date)
<span class="flex-shrink-0" dir="ltr">{{ $enrollment->enrollment_date->format('Y-m-d') }}</span> <span class="flex-shrink-0 text-gray-600" dir="ltr">{{ $enrollment->enrollment_date->format('Y-m-d') }}</span>
@endif @endif
</div> </div>
......
...@@ -86,10 +86,13 @@ class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:rin ...@@ -86,10 +86,13 @@ class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:rin
</td> </td>
<td class="px-4 py-3 text-gray-600">{{ $group->headTrainer?->name_ar ?? '—' }}</td> <td class="px-4 py-3 text-gray-600">{{ $group->headTrainer?->name_ar ?? '—' }}</td>
<td class="px-4 py-3 text-center"> <td class="px-4 py-3 text-center">
<div class="flex items-center justify-center gap-3">
@can('groups.update') @can('groups.update')
<a href="{{ route('groups.edit', $group) }}" wire:navigate <a href="{{ route('groups.edit', $group) }}" wire:navigate
class="text-green-600 hover:text-green-800 text-sm">{{ __('تعديل') }}</a> class="text-green-600 hover:text-green-800 text-sm">{{ __('تعديل') }}</a>
@endcan @endcan
<a href="{{ route('groups.print', $group) }}" target="_blank" class="text-green-600 hover:text-green-700 active:text-green-800 text-sm transition-colors">{{ __('طباعة') }}</a>
</div>
</td> </td>
</tr> </tr>
@empty @empty
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
<span class="text-lg font-bold text-indigo-600">{{ mb_substr($child->person?->name_ar ?? '?', 0, 1) }}</span> <span class="text-lg font-bold text-indigo-600">{{ mb_substr($child->person?->name_ar ?? '?', 0, 1) }}</span>
</div> </div>
<div> <div>
<h3 class="font-semibold text-gray-800">{{ $child->person?->name_ar ?? '-' }}</h3> <a href="{{ route('participants.show', $child) }}" wire:navigate class="text-blue-600 hover:text-blue-800 hover:underline font-semibold">{{ $child->person?->name_ar ?? '-' }}</a>
<p class="text-sm text-gray-500">{{ $child->participant_number ?? '' }}</p> <p class="text-sm text-gray-500">{{ $child->participant_number ?? '' }}</p>
</div> </div>
</div> </div>
...@@ -146,9 +146,15 @@ ...@@ -146,9 +146,15 @@
<p class="text-sm font-medium text-gray-600 mb-2">{{ __('المجموعات النشطة') }}</p> <p class="text-sm font-medium text-gray-600 mb-2">{{ __('المجموعات النشطة') }}</p>
<div class="flex flex-wrap gap-2"> <div class="flex flex-wrap gap-2">
@foreach($child->activeEnrollments as $enrollment) @foreach($child->activeEnrollments as $enrollment)
@if($enrollment->group)
<a href="{{ route('groups.edit', $enrollment->group) }}" wire:navigate class="inline-flex items-center px-2.5 py-1 rounded-lg text-xs font-medium bg-indigo-50 text-indigo-700 border border-indigo-200 hover:underline hover:bg-indigo-100 transition-colors">
{{ $enrollment->group->name_ar ?? '-' }}
</a>
@else
<span class="inline-flex items-center px-2.5 py-1 rounded-lg text-xs font-medium bg-indigo-50 text-indigo-700 border border-indigo-200"> <span class="inline-flex items-center px-2.5 py-1 rounded-lg text-xs font-medium bg-indigo-50 text-indigo-700 border border-indigo-200">
{{ $enrollment->group?->name_ar ?? $enrollment->program?->name_ar ?? '-' }} {{ $enrollment->program?->name_ar ?? '-' }}
</span> </span>
@endif
@endforeach @endforeach
</div> </div>
</div> </div>
...@@ -255,7 +261,7 @@ ...@@ -255,7 +261,7 @@
@endphp @endphp
<tr class="hover:bg-gray-50"> <tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap"> <td class="px-6 py-4 whitespace-nowrap">
<span class="text-sm font-medium text-gray-900" dir="ltr">{{ $invoice->number ?? '-' }}</span> <a href="{{ route('invoices.show', $invoice) }}" wire:navigate class="text-sm font-medium text-blue-600 hover:text-blue-800 hover:underline" dir="ltr">{{ $invoice->number ?? '-' }}</a>
</td> </td>
<td class="px-6 py-4 whitespace-nowrap"> <td class="px-6 py-4 whitespace-nowrap">
<span class="text-sm text-gray-700">{{ $invoice->issue_date?->format('Y-m-d') ?? '-' }}</span> <span class="text-sm text-gray-700">{{ $invoice->issue_date?->format('Y-m-d') ?? '-' }}</span>
......
...@@ -69,7 +69,11 @@ class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:rin ...@@ -69,7 +69,11 @@ class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:rin
{{ $invoice->number }} {{ $invoice->number }}
</td> </td>
<td class="px-4 py-3"> <td class="px-4 py-3">
@if($invoice->billable_type === 'App\\Domain\\Participant\\Models\\Participant')
<a href="{{ route('participants.show', $invoice->billable_id) }}" wire:navigate class="text-blue-600 hover:text-blue-800 hover:underline font-medium">{{ $invoice->contact_name }}</a>
@else
<span class="font-medium text-gray-800">{{ $invoice->contact_name }}</span> <span class="font-medium text-gray-800">{{ $invoice->contact_name }}</span>
@endif
</td> </td>
<td class="px-4 py-3 text-center font-medium" dir="ltr"> <td class="px-4 py-3 text-center font-medium" dir="ltr">
{{ number_format($invoice->total_amount / 100, 2) }} {{ __('ج.م') }} {{ number_format($invoice->total_amount / 100, 2) }} {{ __('ج.م') }}
......
<div> <div>
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4 sm:mb-6"> <div class="flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4 sm:mb-6">
<h1 class="text-xl sm:text-2xl font-bold text-gray-800">{{ __('فاتورة') }} #{{ $invoice->number }}</h1> <h1 class="text-xl sm:text-2xl font-bold text-gray-800">{{ __('فاتورة') }} #{{ $invoice->number }}</h1>
<div class="flex items-center gap-3">
<a href="{{ route('invoices.print', $invoice) }}" target="_blank"
class="inline-flex items-center gap-1.5 text-sm font-medium text-green-600 hover:text-green-800 active:text-green-900 transition-colors">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"/></svg>
{{ __('طباعة') }}
</a>
<a href="{{ route('invoices.list') }}" wire:navigate <a href="{{ route('invoices.list') }}" wire:navigate
class="text-gray-600 hover:text-gray-800 text-sm font-medium"> class="text-gray-600 hover:text-gray-800 text-sm font-medium">
{{ __('العودة للفواتير') }} {{ __('العودة للفواتير') }}
</a> </a>
</div> </div>
</div>
{{-- Flash Messages --}} {{-- Flash Messages --}}
@if(session('success')) @if(session('success'))
...@@ -56,7 +63,11 @@ class="text-gray-600 hover:text-gray-800 text-sm font-medium"> ...@@ -56,7 +63,11 @@ class="text-gray-600 hover:text-gray-800 text-sm font-medium">
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 text-sm"> <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 text-sm">
<div> <div>
<p class="text-gray-500">{{ __('العميل') }}</p> <p class="text-gray-500">{{ __('العميل') }}</p>
@if($invoice->billable_type === 'App\\Domain\\Participant\\Models\\Participant')
<a href="{{ route('participants.show', $invoice->billable_id) }}" wire:navigate class="text-blue-600 hover:text-blue-800 hover:underline font-medium">{{ $invoice->contact_name }}</a>
@else
<p class="font-medium text-gray-800">{{ $invoice->contact_name }}</p> <p class="font-medium text-gray-800">{{ $invoice->contact_name }}</p>
@endif
@if($invoice->contact_phone) @if($invoice->contact_phone)
<p class="text-gray-500" dir="ltr">{{ $invoice->contact_phone }}</p> <p class="text-gray-500" dir="ltr">{{ $invoice->contact_phone }}</p>
@endif @endif
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4 sm:mb-6"> <div class="flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4 sm:mb-6">
<h1 class="text-xl sm:text-2xl font-bold text-gray-800">{{ __('المشتركين') }}</h1> <h1 class="text-xl sm:text-2xl font-bold text-gray-800">{{ __('المشتركين') }}</h1>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<a href="{{ route('participants.bulk-status') }}" wire:navigate class="inline-flex items-center gap-1.5 px-3 py-2 min-h-[44px] text-sm font-medium text-gray-600 border border-gray-300 rounded-lg hover:bg-gray-50 active:bg-gray-100 transition-colors">{{ __('تغيير جماعي') }}</a>
<a href="{{ route('export.participants', ['status' => $status ?? '']) }}" <a href="{{ route('export.participants', ['status' => $status ?? '']) }}"
class="inline-flex items-center gap-2 px-3 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 text-xs sm:text-sm font-medium transition-colors"> class="inline-flex items-center gap-2 px-3 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 text-xs sm:text-sm font-medium transition-colors">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/></svg> <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/></svg>
......
...@@ -166,7 +166,7 @@ class="inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium bg-green ...@@ -166,7 +166,7 @@ class="inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium bg-green
@endcan @endcan
@can('payments.create') @can('payments.create')
<a href="{{ route('participants.list') }}" <a href="{{ route('receptionist.collect-payment') }}" 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"> 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"> <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"/> <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"/>
...@@ -500,16 +500,24 @@ class="pb-3 border-b-2 text-sm font-medium transition whitespace-nowrap"> ...@@ -500,16 +500,24 @@ class="pb-3 border-b-2 text-sm font-medium transition whitespace-nowrap">
<div class="flex items-start justify-between"> <div class="flex items-start justify-between">
<div class="flex-1"> <div class="flex-1">
<div class="flex items-center gap-2 mb-1"> <div class="flex items-center gap-2 mb-1">
<span class="text-sm font-semibold text-gray-800"> @if($enrollment->group)
{{ $enrollment->group?->name_ar ?? $enrollment->group?->name ?? '—' }} <a href="{{ route('groups.edit', $enrollment->group) }}" wire:navigate
</span> class="text-sm font-semibold text-blue-600 hover:text-blue-800 hover:underline">
{{ $enrollment->group->name_ar ?? $enrollment->group->name ?? '—' }}
</a>
@else
<span class="text-sm font-semibold text-gray-800"></span>
@endif
<span class="px-2 py-0.5 text-xs bg-green-100 text-green-700 rounded-full">{{ __('نشط') }}</span> <span class="px-2 py-0.5 text-xs bg-green-100 text-green-700 rounded-full">{{ __('نشط') }}</span>
</div> </div>
@if($enrollment->program) @if($enrollment->program)
<p class="text-sm text-gray-600 mb-1"> <p class="text-sm text-gray-600 mb-1">
<span class="text-gray-400">{{ __('البرنامج') }}:</span> <span class="text-gray-400">{{ __('البرنامج') }}:</span>
<a href="{{ route('programs.edit', $enrollment->program) }}" wire:navigate
class="text-blue-600 hover:text-blue-800 hover:underline">
{{ $enrollment->program->name_ar ?? $enrollment->program->name }} {{ $enrollment->program->name_ar ?? $enrollment->program->name }}
</a>
</p> </p>
@endif @endif
...@@ -601,7 +609,14 @@ class="pb-3 border-b-2 text-sm font-medium transition whitespace-nowrap"> ...@@ -601,7 +609,14 @@ class="pb-3 border-b-2 text-sm font-medium transition whitespace-nowrap">
</div> </div>
<div> <div>
<p class="text-sm font-medium text-gray-800" dir="ltr"> <p class="text-sm font-medium text-gray-800" dir="ltr">
@if($payment->invoice_id)
<a href="{{ route('invoices.show', $payment->invoice) }}" wire:navigate
class="text-blue-600 hover:text-blue-800 hover:underline">
{{ number_format($payment->amount / 100, 2) }} {{ __('ج.م') }} {{ number_format($payment->amount / 100, 2) }} {{ __('ج.م') }}
</a>
@else
{{ number_format($payment->amount / 100, 2) }} {{ __('ج.م') }}
@endif
</p> </p>
<p class="text-xs text-gray-500"> <p class="text-xs text-gray-500">
{{ $payment->method->label() }} {{ $payment->method->label() }}
......
...@@ -867,6 +867,28 @@ class="inline-flex items-center gap-2 px-6 py-3 bg-gray-100 text-gray-700 rounde ...@@ -867,6 +867,28 @@ class="inline-flex items-center gap-2 px-6 py-3 bg-gray-100 text-gray-700 rounde
{{ __('العودة للاستقبال') }} {{ __('العودة للاستقبال') }}
</a> </a>
</div> </div>
{{-- Navigation Links --}}
<div class="flex items-center justify-center gap-3 mt-4 print:hidden">
@if($participant_uuid)
<a href="{{ route('participants.show', $participant_uuid) }}" wire:navigate
class="inline-flex items-center gap-2 px-4 py-2.5 min-h-[44px] border border-blue-300 rounded-lg text-sm font-medium text-blue-700 hover:bg-blue-50 active:bg-blue-100 transition-colors">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/>
</svg>
{{ __('عرض المشترك') }}
</a>
@endif
@if($invoice_uuid)
<a href="{{ route('invoices.show', $invoice_uuid) }}" wire:navigate
class="inline-flex items-center gap-2 px-4 py-2.5 min-h-[44px] border border-gray-300 rounded-lg text-sm font-medium text-gray-700 hover:bg-gray-50 active:bg-gray-100 transition-colors">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
{{ __('عرض الفاتورة') }}
</a>
@endif
</div>
@else @else
{{-- No invoice (free program) --}} {{-- No invoice (free program) --}}
<div class="flex items-center justify-center gap-4 mt-6"> <div class="flex items-center justify-center gap-4 mt-6">
...@@ -879,6 +901,19 @@ class="inline-flex items-center gap-2 px-6 py-3 bg-gray-100 text-gray-700 rounde ...@@ -879,6 +901,19 @@ class="inline-flex items-center gap-2 px-6 py-3 bg-gray-100 text-gray-700 rounde
{{ __('العودة للاستقبال') }} {{ __('العودة للاستقبال') }}
</a> </a>
</div> </div>
{{-- Navigation Links --}}
@if($participant_uuid)
<div class="flex items-center justify-center gap-3 mt-4">
<a href="{{ route('participants.show', $participant_uuid) }}" wire:navigate
class="inline-flex items-center gap-2 px-4 py-2.5 min-h-[44px] border border-blue-300 rounded-lg text-sm font-medium text-blue-700 hover:bg-blue-50 active:bg-blue-100 transition-colors">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/>
</svg>
{{ __('عرض المشترك') }}
</a>
</div>
@endif
@endif @endif
</div> </div>
@endif @endif
......
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