@include('admin.partials.navbar')

{{ $type === 'commission' ? __('messages.menu_viki_invoices') : __('messages.menu_invoices') }}

{{ $orders->total() }} {{ __('messages.orders_total_suffix') }}

header
@if(session('success'))
{{ session('success') }}
@endif @php $listRoute = $type === 'commission' ? 'admin.invoices.commission' : 'admin.invoices.index'; $tabs = [ 'orders' => __('messages.invoice_src_orders'), 'restaurants' => __('messages.invoice_src_restaurants'), 'rentals' => __('messages.invoice_src_rentals'), 'courses' => __('messages.invoice_src_courses'), ]; @endphp
@forelse($orders as $row) @php $suffix = $type === 'commission' ? '.commission.pdf' : '.pdf'; switch ($source) { case 'rentals': $ref = '#' . $row->id; $party = $row->maison?->owner; $client = $row->client; $amount = $row->total_amount; $currency = $row->currency ?: '€'; $date = $row->paid_at ?? $row->created_at; $url = route('admin.invoices.rental' . $suffix, $row); break; case 'courses': $ref = '#' . $row->id; $party = $row->chauffeur; $client = $row->client; $amount = $row->total_amount; $currency = $row->currency ?: '€'; $date = $row->paid_at ?? $row->created_at; $url = route('admin.invoices.course' . $suffix, $row); break; default: $ref = $row->order_number ?? '-'; $party = $row->payee(); $client = $row->buyer; $amount = $row->total; $currency = '€'; $date = $row->created_at; $url = $type === 'commission' ? route('admin.invoices.commission.pdf', $row) : route('admin.invoices.pdf', $row); } @endphp @empty @endforelse
{{ in_array($source, ['orders', 'restaurants']) ? __('messages.order_number_col') : 'ID' }} {{ __('messages.seller') }} {{ __('messages.buyer') }} {{ __('messages.total') }} {{ __('messages.date') }} PDF
{{ $ref }}
{{ ($party->company_name ?? $party->company ?? null) ?: ($party->name ?? '-') }}
{{ $party->email ?? '' }}
{{ $client->name ?? '-' }}
{{ $client->email ?? '' }}
{{ number_format((float) $amount, 2, ',', ' ') }} {{ $currency }} {{ $date?->format('d/m/Y') }}
{{ __('messages.no_orders_found') }}
{{ $orders->links() }}