@extends('layouts.app') @section('content')

Panier

@if($cart->items->isNotEmpty()) Passer au paiement @endif
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @if($cart->items->isEmpty())
Votre panier est vide.
@else
@foreach($cart->items as $item) @php($remaining = max(0, (float) $item->line_total - (float) $item->line_deposit)) @endforeach
Article Qté Total Acompte Reste
@php($p = $item->purchasable) @if($p instanceof \App\Models\Booking) Réservation #{{ $p->booking_number ?? $p->id }} @elseif($p instanceof \App\Models\EquipmentRentalRequest) Location matériel #{{ $p->id }} @elseif($p instanceof \App\Models\UrgentSale) {{ $p->title ?? ('Produit #' . $p->id) }} @else Article #{{ $item->id }} @endif
{{ class_basename($item->purchasable_type) }}
@if($item->purchasable instanceof \App\Models\UrgentSale)
@csrf @method('PATCH')
@else {{ $item->quantity }} @endif
{{ number_format($item->line_total, 2) }} € {{ number_format($item->line_deposit, 2) }} €{{ number_format($remaining, 2) }} €
@csrf @method('DELETE')
Total (paiement complet): {{ number_format($totals['full'], 2) }} €
Total acompte (mode 2): {{ number_format($totals['deposit'], 2) }} €
Reste à payer plus tard: {{ number_format(max(0, (float) $totals['full'] - (float) $totals['deposit']), 2) }} €
@if(function_exists('feature_enabled') && feature_enabled('payments_enabled') && feature_enabled('checkout_enabled')) Payer maintenant @else
Paiement en ligne indisponible
@endif
@endif
@endsection