@extends('layouts.dashboard') @section('content') @php /** * Vendor → Orders → one order. Thin wrapper: the owner's back bar over the * shared order-detail body (partials/order-detail-body.php), which the admin * order page renders too. The view-model is assembled by App\Services\OrderDetail. * * @var array $order @var array $items @var array $journey @var array $journeyStats * @var array|null $customer @var string $driverName @var array|null $restaurant @var array|null $deliveryRoute */ $paid = ($order['payment_status'] ?? '') === 'paid'; $refundable = []; foreach ($items as $it) { $rem = (int) ($it['quantity'] ?? 0) - (int) ($it['refunded_qty'] ?? 0); if ($rem > 0) { $refundable[] = $it + ['remaining' => $rem]; } } $showRefund = !empty($canRefund) && $paid && $refundable; @endphp @php /* .qm-d2: the dashboard density standard (app.css §35) */ @endphp
@php $hasEmail = trim((string) ($order['customer_email'] ?? '')) !== ''; @endphp
{{ t_raw('vendor.order_detail.back_to_orders_btn') }} @if ($showRefund || $hasEmail)
@if ($hasEmail)
@csrf
@endif @if ($showRefund) @endif
@endif
@partial('order-detail-body', compact('order', 'items', 'journey', 'journeyStats', 'customer', 'driverName', 'tableLabel', 'couponCode', 'restaurant', 'deliveryRoute')) @if ($showRefund) @endif
@php /* /.qm-d2 */ @endphp @endsection