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

Compra #{{ $order->id }}

@csrf
@if($order->status_id !== \App\Models\Order::STATUS_PROCESSED)
@csrf
@endif
@csrf
@csrf
@if(request()->filled('code')) @svg('heroicon-o-x-circle', 'w-6 h-6 text-blue-500') @else @svg('heroicon-o-code-bracket', 'w-6 h-6 text-blue-500') @endif

Vendedor

@if($order->seller)

{{ $order->seller->name }}

@if($order->seller->email)

Email: {{ $order->seller->email }}

@endif @else

@endif

Cliente

@if($order->user)

Nombre: {{ $order->user->name }}

Documento: {{ $order->user->document ?? '—' }}

Estado cliente: @if($order->user->isProspectClient()) Prospecto (requiere pasar a Pendiente) @elseif($order->user->isPendingClient()) Pendiente (sin rutero válido) @else Cliente @endif

@else

@endif @if($order->status_id === \App\Models\Order::STATUS_DRAFT)

Pedido en borrador interno (no transmitido a Dynamics).

@if($order->draft_reconciliation_note)

Reconciliación: {{ $order->draft_reconciliation_note }}

@endif @if($order->draft_reconciliation_at)

Último intento: {{ $order->draft_reconciliation_at->format('d/m/Y H:i') }}

@endif @endif

Envío / Proveedor

Proveedor: {{ $order->shipping_provider ?? 'tronex' }}

Costo cotizado: ${{ number_format((float)($order->shipping_quote_amount ?? 0), 2) }}

Método: {{ $order->delivery_method }}

Integración Coordinadora / FV

FV: {{ $order->fv_number ?? '-' }}

Guía: {{ $order->coordinadora_guide_number ?? '-' }}

Estado: {{ $order->coordinadora_status_text ?? '-' }}

Actualizado: {{ optional($order->coordinadora_status_at)->format('d/m/Y H:i') ?? '-' }}

@if($order->fv_request_payload || $order->fv_response_payload || $order->coordinadora_request_payload || $order->coordinadora_response_payload)
@if($order->fv_request_payload)
FV Request
{{ $order->fv_request_payload }}
@endif @if($order->fv_response_payload)
FV Response
{{ $order->fv_response_payload }}
@endif @if($order->coordinadora_request_payload)
Coordinadora Request
{{ $order->coordinadora_request_payload }}
@endif @if($order->coordinadora_response_payload)
Coordinadora Response
{{ $order->coordinadora_response_payload }}
@endif
@endif
@if(!request()->filled('code'))
@foreach ($order->products as $product) @endforeach
Producto Combinaciones Precio Cantidad Descuento Total
{{ $product->product->name }} {{-- @if ( $product->product->variation) {{ $product->product->variation->name }}: {{ App\Models\VariationItem::find($product->pivot->variation_id)->name }} @endif --}}
{{-- @if ($product->combinations->count())
    @foreach ($product->combinations as $p)
  • {{ $p->name }}
  • @endforeach
@endif --}}
${{ number_format($product->price+$product->discount, 2) }} {{$product->quantity}} ${{ number_format($product->discount, 2) }} ${{ number_format($product->price * $product->quantity, 2) }}
Descuento ${{ number_format($order->discount, 2) }}
Total ${{ number_format($order->totalWithTax(), 2) }}
@if($order->bonifications->count())

Bonificaciones

@foreach ($order->bonifications as $bonification) @endforeach
Producto Bonificación Cantidad
{{ $bonification->product->name }} {{ $bonification->bonification->name }} {{ $bonification->quantity }}
@endif @else
            
                {{$order->request}}
            
        
Response
            
                {{$order->response}}
            
        
@endif @endsection