@php $currency = $brandCurrency; @endphp
@if ($sales) @foreach ($sales as $sale)
@if ($sale->status != 'Anulada')
  1. @if ( $sale->status == 'En Producción' || $sale->status == 'En Despacho' || $sale->status == 'Listo Retiro' || $sale->status == 'Pagada' || $sale->status == 'Entregado') Confirmada @else Esperando @endif

  2. En Producción

  3. @if ($sale->type_sale == 'Despacho') En Despacho @else Listo Para Retiro @endif

  4. @if ($sale->status == 'Anulada') Anulada @else Entregado @endif

@endif
{{ $sale->type_sale }}
ORDEN: #{{ strtoupper(substr($sale->uuid, -10)) }}
@if ($sale->type_sale == 'Despacho') @if ($sale->address)

{{ $sale->address->address }} - {{ $sale->address->state }}

@endif @endif @if ($sale->type_sale == 'Retiro')

{{ $sale->company->name }}

{{ $sale->company->address }} - {{ $sale->company->commune }}

@endif

{{ $sale->status == 'Pagada' ? 'Entregado' : ($sale->status == 'Listo Retiro' ? 'Listo Para Retiro' : ($sale->status == 'Sin Confirmar' ? 'Esperando Confirmación' : $sale->status)) }}

{{ \Carbon\Carbon::create($sale->created_at)->format('d/m/y H:i') }}


@foreach ($sale->saleDetails as $detail)

{{ $detail->quantity }} X {{ $detail->name }}
@foreach ($detail->optionsDetails as $option)   * {{ $option->name }}
@endforeach

@endforeach

SubTotal: {{ $currency['symbol'] }} {{ number_format($sale->subtotal, $currency['decimals'], $currency['decimal_separator'], $currency['thousands_separator']) }}

Propina: {{ $currency['symbol'] }} {{ number_format($sale->tip, $currency['decimals'], $currency['decimal_separator'], $currency['thousands_separator']) }}

Despacho: {{ $currency['symbol'] }} {{ number_format($sale->price_delivery, $currency['decimals'], $currency['decimal_separator'], $currency['thousands_separator']) }}

Descuento: {{ $currency['symbol'] }} {{ number_format($sale->discount, $currency['decimals'], $currency['decimal_separator'], $currency['thousands_separator']) }}

Total: {{ $currency['symbol'] }} {{ number_format($sale->total, $currency['decimals'], $currency['decimal_separator'], $currency['thousands_separator']) }}

@endforeach
{{ $sales->links() }}
@endif