@extends('layouts.admin') @section('title', 'Pedido '.$order->number) @section('content')

{{ $order->number }}

{{ $order->client?->business_name }} · {{ $order->statusLabel() }}

Volver @if($order->tracking_locked_at && $order->status->value !== 'DELIVERED')
@csrf
@endif @if(! in_array($order->status->value, ['DRAFT', 'CANCELLED', 'REJECTED'], true)) @endif @if($order->canEmitInvoice() && auth()->user()->hasPermission('billing.emit')) Facturar @elseif($order->activeElectronicInvoice()) Ver factura @endif
@if($order->tracking_locked_at && $order->status->value !== 'DELIVERED')
Portal bloqueado ({{ $order->statusLabel() }}) @if($order->tracking_outcome_notes) · Motivo: {{ $order->tracking_outcome_notes }} @endif
Use Reabrir portal para permitir que el despachador continúe.
@endif
Productos
@foreach($order->items as $item) @endforeach
ProductoCantidadPrecioIVATotal
{{ $item->product?->name }} {{ $item->quantityLabel() }} ${{ number_format((float) ($item->price_entered ?? $item->unit_sale_price), 4) }} ${{ number_format((float) $item->tax_total, 2) }} ${{ number_format((float) $item->total, 2) }}
Subtotal${{ number_format((float) $order->subtotal, 2) }}
IVA${{ number_format((float) $order->tax_total, 2) }}
Total${{ number_format((float) $order->total, 2) }}
Historial
    @forelse($order->histories->sortByDesc('created_at') as $h)
  • {{ $h->toStatusLabel() }} @if($h->from_status) desde {{ $h->fromStatusLabel() }}@endif · {{ $h->created_at?->format('d/m/Y H:i') }} @if($h->notes)
    {{ $h->notes }}
    @endif
  • @empty
  • Sin historial
  • @endforelse
Facturación electrónica
@include('partials.invoice-status', ['order' => $order])
Datos del comprador
{{ $order->buyer_legal_name }}
{{ $order->buyer_tax_id }}
{{ $order->buyer_email }}
{{ $order->buyer_phone }}
{{ $order->buyer_address }}
Pago
{{ $order->paymentMethodLabel() }}
{{ $order->financialStatusLabel() }}
@if($order->payment_reference)
Ref: {{ $order->payment_reference }}
@endif @if($order->payment_notes)
{{ $order->payment_notes }}
@endif @if($order->payments->isNotEmpty())
Pagos registrados
@foreach($order->payments as $pay)
{{ $pay->number }} ${{ number_format((float) $pay->amount, 2) }}
@endforeach @endif
@if($order->delivery)
Entrega
{{ $order->delivery->number }}
{{ $order->delivery->statusLabel() }}
{{ $order->delivery->driverLabel() }}
@endif @if($order->notes || $order->internal_notes)
@if($order->notes)
Cliente: {{ $order->notes }}
@endif @if($order->internal_notes)
Internas: {{ $order->internal_notes }}
@endif
@endif
@endsection @push('modals') @include('orders.partials.modal-pos-print') @endpush @push('scripts') @endpush