@extends('adminlte::page') @section('title', 'Lista de Ventas') @section('content_header') @if(auth()->user()->hasRole('Cliente'))

Lista de Compras

@else

Lista de Ventas

@endif @stop @section('content') @if (session('success')) @endif @if (session('error')) @endif
@if(!auth()->user()->hasRole('Cliente')) @can('admin.ventas.create') Nueva Venta @endcan @endif
@forelse ($ventas as $venta) @empty @endforelse
# Cotización Cliente Fecha Venta Monto Vendido Total Pagado Saldo Pendiente Estado de Pago Estado Pedido Estado Entrega Código Seguimiento Estado Cotización Margen Bruto Acciones
{{ $venta->id }} {{ $venta->cotizacion->numero_cotizacion }} {{ $venta->cotizacion->cliente->user->name ?? 'N/A' }} {{ $venta->created_at->format('d/m/Y') }} S/ {{ number_format($venta->monto_vendido, 2) }} S/ {{ number_format($venta->total_pagado, 2) }}
{{ number_format($venta->porcentaje_pagado, 1) }}%
S/ {{ number_format($venta->restante, 2) }} {{ $venta->estado_pago_texto }} @if(auth()->user()->hasRole('Cliente')) {{ ucfirst(str_replace('_', ' ', $venta->estado_pedido)) }} @else @endif @if(auth()->user()->hasRole('Cliente')) {{ $venta->estado_entrega_texto ?? 'Registro Creado' }} @else @endif @if($venta->codigo_seguimiento) {{ $venta->codigo_seguimiento }} @else - @endif {{ ucfirst($venta->cotizacion->estado) }} @if(!auth()->user()->hasRole('Cliente')) S/ {{ number_format($venta->margen_bruto_con_transporte, 2) }} @else - @endif @if(auth()->user()->hasRole('Cliente')) Ver @else
@endif
No hay ventas registradas
@stop @section('css') @stop @section('js') @can('admin.ventas.pagos.create') @endcan @stop