@extends('layouts.app') @section('content')
@if(Auth::user()->is_admin == 'Si')

Total venta

$ {{Number_format($venta->total)}}

Costo de producción

$ {{Number_format($venta->costo())}}

Ganancias aproximadas

$ {{Number_format($venta->ganancia())}}
@endif

Detalles de venta

ID: #{{$venta->id}}
@if($venta->id_cierre != null) @endif @if($venta->id_mesa != null)
@endif
@if($venta->id_cupon != null)
@if($venta->tipo_descuento == '2') @php $porcentaje = $venta->descuento * 100 / $venta->total_real; @endphp
@endif
@endif
@foreach($venta->movimientos as $movimiento)
@endforeach
{{$venta->user->name}}

Productos vendidos

@if(Auth::user()->is_admin == 'Si') @endif @foreach($venta->detalles as $detalle) @if(Auth::user()->is_admin == 'Si') @endif @endforeach
ID Producto Precio Cantidad Descuento TotalCosto producción Ganancia AproxAcciones
#{{$detalle->id_producto != 0 ? $detalle->producto->id : 'CUSTOM'}}
@if($detalle->id_producto != 0) @else @endif
@if($detalle->id_producto != 0)
{{$detalle->producto->nombre}}
@else
{{$detalle->concepto}}
@endif
@if($detalle->id_producto != 0) $ {{number_format($detalle->producto->precio_final)}} @else $ {{number_format($detalle->total)}} @endif {{$detalle->cantidad}} @if($detalle->descuento > 0 && $detalle->descuento != null && $detalle->descuento != 'null') - {{$detalle->getDescuento()}} @else N/A @endif $ {{number_format($detalle->total)}} $ {{number_format($detalle->costo)}} $ {{number_format($detalle->total - $detalle->costo)}} @if($detalle->id_producto != 0) @else N/A @endif

@endsection @section('scripts') @if(Auth::user()->is_admin == 'Si') @endif @endsection