@extends('layouts.app') @section('title','Pedido: '.$pedido->numero) @section('page-title','Detalle de Pedido') @section('content') @if(session('success'))
{{ session('success') }}
@endif

{{ $pedido->numero }}

{{ $pedido->cliente?->razon_social }} {{ \App\Models\PedidoComercial::$ESTADOS[$pedido->estado] }} {{ ucfirst($pedido->tipo) }}
@foreach(\App\Models\PedidoComercial::$ESTADOS as $k=>$v) @if($k !== $pedido->estado && $k !== 'cancelado')
@csrf
@endif @endforeach PDF @if($pedido->tipo==='exportacion' && !$pedido->exportacion) Crear Exportación @endif

Información

Cliente
{{ $pedido->cliente?->nombre_display }}
Cotización
@if($pedido->cotizacion){{ $pedido->cotizacion->numero }} @else —@endif
Moneda
{{ $pedido->moneda }}
T/C
S/ {{ $pedido->tipo_cambio_valor }}
@if($pedido->tipo==='exportacion')
Incoterm
{{ $pedido->incoterm ?? '—' }}
Puerto
{{ $pedido->puerto_destino ?? '—' }}
@endif
Entrega est.
{{ $pedido->fecha_entrega_estimada?->format('d/m/Y') ?? '—' }}
Condiciones
{{ $pedido->condiciones_pago ?? '—' }}
@if($pedido->exportacion)

Exportación vinculada

{{ $pedido->exportacion->numero }} {{ \App\Models\Exportacion::$ESTADOS[$pedido->exportacion->estado] }}
@endif

Ítems

@foreach($pedido->items as $i => $item) @endforeach @if($pedido->tipo==='nacional') @endif
#DescripciónTipo PulpaFrutaCantidadUnidadP. Unit.Subtotal
{{ $i+1 }} {{ $item->descripcion }} {{ $item->tipo_pulpa ? str_replace('_',' ',ucfirst($item->tipo_pulpa)) : '—' }} {{ $item->fruta ?? '—' }} {{ number_format($item->cantidad,3) }} {{ $item->unidad }} {{ $pedido->moneda }} {{ number_format($item->precio_unitario,4) }} {{ $pedido->moneda }} {{ number_format($item->subtotal,2) }}
Subtotal{{ $pedido->moneda }} {{ number_format($pedido->subtotal,2) }}
IGV (18%){{ $pedido->moneda }} {{ number_format($pedido->igv,2) }}
TOTAL{{ $pedido->moneda }} {{ number_format($pedido->total,2) }}
@if($pedido->notas)
Notas: {{ $pedido->notas }}
@endif
@endsection