@extends('../padre.padre') @section('styles') @endsection @section('contenido') @php $esPaginado = is_object($productoCom) && method_exists($productoCom, 'total'); $totalRegistros = $esPaginado ? $productoCom->total() : (is_countable($productoCom) ? count($productoCom) : 0); @endphp
@include('../menu.bodegas')
@if(isset($productoCom) && count($productoCom) > 0)
馃挵 Inversi贸n Total Compras
$ {{ number_format((float)($totalGeneral ?? 0), 0, ',', '.') }}
Suma de productos comprados
馃摝 Total Cajas
{{ number_format((float)($totalCajasGeneral ?? 0), 0, ',', '.') }}
Unidades en caja ingresadas
馃拪 Fracciones / Unid
{{ number_format((float)($totalFraccGeneral ?? 0), 0, ',', '.') }}
Unidades sueltas
馃Ь Renglones Comprados
{{ number_format((float)$totalRegistros, 0, ',', '.') }}
Registros en el periodo
馃彚 Proveedores 脷nicos
{{ number_format((float)count($resumenProv), 0, ',', '.') }}
Proveedores con compras activas
@endif
Detalle de Art铆culos Comprados @if($totalRegistros > 0) @if($esPaginado) {{ number_format((float)$totalRegistros) }} compras facturadas (P谩g. {{ $productoCom->currentPage() }} de {{ $productoCom->lastPage() }}) @else {{ $totalRegistros }} registros @endif @endif
@if(isset($productoCom) && count($productoCom) > 0) @php $sumTotal = 0; $sumCajas = 0; $sumFracc = 0; $hoy = date('Y-m-d'); $en90Dias = date('Y-m-d', strtotime('+90 days')); @endphp @foreach ($productoCom as $idx => $item) @php $sumTotal += (float)($item->total ?? 0); $sumCajas += (float)($item->cantcaja ?? 0); $sumFracc += (float)($item->cantfrcc ?? 0); // Estado de vencimiento $fv = !empty($item->fvencimi) ? substr($item->fvencimi, 0, 10) : ''; $badgeVencClass = 'badge-venc-ok'; if (!empty($fv) && $fv != '0000-00-00') { if ($fv < $hoy) { $badgeVencClass = 'badge-venc-danger'; } elseif ($fv <= $en90Dias) { $badgeVencClass = 'badge-venc-warn'; } } @endphp @endforeach @else @endif @if(isset($productoCom) && count($productoCom) > 0) @endif
# C贸digo Nombre Producto Cajas Costo Caja Fracc Costo Fracc Base IVA Tipo Total Compra Fecha Compra N掳 Factura Proveedor Marca Categor铆a Lote Vencimiento Bodega
{{ $esPaginado && $productoCom->firstItem() ? ($productoCom->firstItem() + $idx) : ($idx + 1) }} {{ $item->cproducto }} {{ $item->nombre }} {{ number_format((float)($item->cantcaja ?? 0)) }} $ {{ number_format((float)($item->costcaja ?? 0), 0, ',', '.') }} {{ number_format((float)($item->cantfrcc ?? 0)) }} $ {{ number_format((float)($item->costofrcc ?? 0), 0, ',', '.') }} $ {{ number_format((float)($item->base ?? 0), 0, ',', '.') }} $ {{ number_format((float)($item->iva ?? 0), 0, ',', '.') }} {{ $item->tipo }} $ {{ number_format((float)($item->total ?? 0), 0, ',', '.') }} {{ substr($item->fechacomp, 0, 10) }} {{ $item->numfactur }}
{{ $item->nombre_proveedor ?? $item->provedor }}
{{ $item->provedor }}
{{ $item->nommarca }} {{ $item->nomcategoria }} {{ $item->lote }} @if(!empty($fv) && $fv != '0000-00-00') {{ $fv }} @else N/A @endif {{ $item->idbodegaCo }}

@if(empty($fi)) Selecciona el rango de fechas y presiona Consultar para ver el detalle de compras. @else No se encontraron productos comprados para los filtros seleccionados. @endif
SUBTOTAL P脕GINA: {{ number_format((float)($sumCajas ?? 0)) }} {{ number_format((float)($sumFracc ?? 0)) }} TOTAL P脕GINA: $ {{ number_format((float)($sumTotal ?? 0), 0, ',', '.') }}
@if($totalRegistros > 0) @endif
@endsection @section('pie') @endsection