@if($isLoading) @include('skeletons.invoices') @else
@slot('title') {{ __('invoices.invoices') }} @endslot

{{ __('invoices.invoices') }}

{{ __('invoices.filter_by') }}
@role('tutor') @elserole('student') @endrole @if (!$orders->isEmpty()) @foreach($orders as $order) @php $options = $order?->options; $subject = !empty($options['subject']) ? $options['subject'] : ''; $image = !empty($options['image']) ? $options['image'] : ''; $subjectGroup = !empty($options['subject_group']) ? $options['subject_group'] : ''; $orderTotal = is_numeric($order?->total) ? $order?->total : 0; $commission = is_numeric(getCommission($orderTotal)) ? getCommission($orderTotal) : 0; $tutor_payout = !empty($options['tutor_payout']) && is_numeric($options['tutor_payout']) ? $options['tutor_payout'] : ($orderTotal - $commission); @endphp @role('student') @elserole('tutor') @endrole @endforeach @endif
{{ __('booking.id') }} {{ __('booking.date') }} {{ __('booking.transaction_id') }} {{ __('general.item' )}}{{ __('booking.student_name') }} {{ __('booking.amount') }} {{ __('booking.tutor_payout') }}{{ __('booking.tutor_name') }} {{ __('booking.amount') }}{{ __('booking.status') }}
{{ $order?->order_id }} {{ $order?->created_at->format('F j, Y') }} {{ !empty($order?->orders?->transaction_id) ? $order?->orders?->transaction_id : '-' }}
@if (!empty($image) && Storage::disk(getStorageDisk())->exists($image)) {{$image}} @else {{ $image }} @endif @if($order->orderable_type == App\Models\SlotBooking::class) {{ $subject }}{{ $subjectGroup }} @elseif($order->orderable_type == \Modules\Courses\Models\Course::class && !empty($options['title'])) {{ $options['title'] }} @elseif(\Nwidart\Modules\Facades\Module::has('subscriptions') && \Nwidart\Modules\Facades\Module::isEnabled('subscriptions') && $order->orderable_type == 'Modules\Subscriptions\Models\Subscription') {{ $order->options['name'] }} {{ __($order->options['period']) }} @elseif(\Nwidart\Modules\Facades\Module::has('courseBundles') && \Nwidart\Modules\Facades\Module::isEnabled('courseBundles') && $order->orderable_type == 'Modules\CourseBundles\Models\Bundle') {{ $order->options['title'] }} @endif
@if($order?->orderable_type == \Modules\Courses\Models\Course::class) @if (!empty($order?->orderable?->instructor?->profile?->image) && Storage::disk(getStorageDisk())->exists($order?->orderable?->instructor?->profile?->image)) {{$order?->orderable?->instructor?->profile?->image}} @else {{ $order?->orderable?->instructor?->profile?->image }} @endif {{ $order?->orderable?->instructor?->profile?->first_name }} @elseif($order?->orderable_type == App\Models\SlotBooking::class) @if (!empty($order?->orderable?->tutor?->image) && Storage::disk(getStorageDisk())->exists($order?->orderable?->tutor?->image)) {{$order?->orderable?->tutor?->image}} @else {{ $order?->orderable?->tutor?->image }} @endif {{ $order?->orderable?->tutor?->first_name }} @elseif($order?->orderable_type == \Modules\CourseBundles\Models\Bundle::class) @if (!empty($order?->orderable?->instructor?->profile?->image) && Storage::disk(getStorageDisk())->exists($order?->orderable?->instructor?->profile?->image)) {{$order?->orderable?->instructor?->profile?->image}} @else {{ $order?->orderable?->instructor?->profile?->image }} @endif {{ $order?->orderable?->instructor?->profile?->first_name }} @else - @endif
{!! formatAmount($order?->total) !!}
@if($order->orderable_type != 'Modules\Subscriptions\Models\Subscription') @if (!empty($order?->orders?->userProfile?->image) && Storage::disk(getStorageDisk())->exists($order?->orders?->userProfile?->image)) {{$order?->orders?->userProfile?->image}} @else {{ $order?->orderable?->student?->image }} @endif {{ $order?->orders?->userProfile?->first_name }} @else - @endif
{!! formatAmount($order?->total) !!} @if ($order->orderable_type != 'Modules\Subscriptions\Models\Subscription') {!! formatAmount($tutor_payout) !!} @else - @endif
{{ $order?->orders?->status}}
@if ($orders->isEmpty()) @else
{{ $orders->links('pagination.pagination') }} @endif
@endif @if(!empty($invoice)) @endif
@push('scripts' ) @endpush