@extends('layouts.app') @section('style') @endsection @section('content')
Lista de ventas @if(isset($control_view)) @if($control_view == "NotPrinted") que no se han impreso @endif @endif
{{--Aqui valido si el controlador envia la variable $control_view, ya que tengo dos o mas controladores llamando este view--}} @if(!isset($control_view))
@elseif(isset($control_view) && $control_view == "NotPrinted")
@endif
{{-- --}} {{-- --}} {{-- --}} {{-- --}} @forelse($sales as $sale) {{-- --}} {{-- --}} {{-- --}} {{-- --}} @empty

There is no Sale

@endforelse
# Nombre Ordenes OrigenTelefonoCorreoEstado Fecha de compraUsuariosDireccionImprimir
{{ $sale['sales_id'] }} {{ $sale['sales_name'] }} {{ $sale['origin'] }}--}} {{-- {{ preg_replace('~.*(\d{3})[^\d]{0,7}(\d{3})[^\d]{0,7}(\d{4}).*~', '($1) $2-$3',$sale['phone']) }} {{ $sale['ext'] }}
--}} {{-- {{ preg_replace('~.*(\d{3})[^\d]{0,7}(\d{3})[^\d]{0,7}(\d{4}).*~', '($1) $2-$3',$sale['cellphone']) }}--}} {{--
{{ $sale['sales_email'] }} @if($sale['sale_status'] == 'open') {{ ucfirst($sale['sale_status']) }} @elseif($sale['sale_status'] == 'cancel') {{ ucfirst($sale['sale_status']) }} @elseif($sale['sale_status'] == 'close') {{ ucfirst($sale['sale_status']) }} @else {{ ucfirst($sale['sale_status']) }} @endif @php $d = explode(' ', $sale['purchase_date']); $date = explode('-', $d[0]); $hours = explode(":", $d[1]); $ampm = $hours[0] >= 12 ? "PM" : "AM"; $hour = $hours[0] % 12; $hour = $hour ? $hour : 12; echo "$date[2]/$date[1]/$date[0] $hour:00 $ampm"; @endphp {{ $sale['name'] }}{{ $sale['address'] }}
@endsection @push('scripts') @endpush