@extends('layouts.enterprise') @section('title', 'Dashboard') @section('content')
Rango: {{ $start->toDateString() }} a {{ $end->toDateString() }} (solo facturas aprobadas/programadas)
@php $defaultPayStart = \Illuminate\Support\Carbon::now()->startOfWeek(\Illuminate\Support\Carbon::MONDAY)->toDateString(); $defaultPayEnd = \Illuminate\Support\Carbon::now()->startOfWeek(\Illuminate\Support\Carbon::MONDAY)->addDays(6)->toDateString(); $payHasActiveFilters = (($payFilters['q'] ?? '') !== '') || (($payFilters['status'] ?? 'approved_scheduled') !== 'approved_scheduled') || (($payFilters['date_from'] ?? $defaultPayStart) !== $defaultPayStart) || (($payFilters['date_to'] ?? $defaultPayEnd) !== $defaultPayEnd); @endphp
Filtros
@if($payHasActiveFilters)
Activos
@endif
| ID | Proveedor | PROJECT NAME | Estatus | Fecha pago | Factura | Total | Monto facturado | Monto pendiente | Pagado | Saldo pago | Acciones |
|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $inv->id }} | {{ $inv->company?->legal_name }} |
{{ $inv->pipefyRequest?->project_name ?: '-' }}
{{ $inv->pipefyRequest?->title ?: '-' }}
|
{{ $inv->status }} | {{ optional($inv->payment_date)->format('Y-m-d') }} | @if($invoicePdf) Ver factura @else Sin factura @endif | {{ number_format((float) $inv->total, 2) }} | @if($payProviderAmounts) ${{ number_format($payCoveredAmount, 2) }} @else - @endif | @if($payProviderAmounts) ${{ number_format($payPendingAmount, 2) }} @else - @endif | ${{ number_format($paidAmount, 2) }} | ${{ number_format($pendingPayment, 2) }} | @if(!$hasInvoicePayments) Ejecuta migraciones @elseif($canRegisterPayment) @else @if($proof) Ver comprobante @else Liquidada @endif @endif |
Rango: {{ \Illuminate\Support\Carbon::parse($collectFilters['date_from'] ?? $start->toDateString())->toDateString() }} a {{ \Illuminate\Support\Carbon::parse($collectFilters['date_to'] ?? $end->toDateString())->toDateString() }} (fecha estimada de cobro por cliente)
@php $defaultCollectStart = \Illuminate\Support\Carbon::now()->startOfWeek(\Illuminate\Support\Carbon::MONDAY)->toDateString(); $defaultCollectEnd = \Illuminate\Support\Carbon::now()->startOfWeek(\Illuminate\Support\Carbon::MONDAY)->addDays(6)->toDateString(); $collectHasActiveFilters = (($collectFilters['q'] ?? '') !== '') || (($collectFilters['status'] ?? 'all') !== 'all') || (($collectFilters['date_from'] ?? $defaultCollectStart) !== $defaultCollectStart) || (($collectFilters['date_to'] ?? $defaultCollectEnd) !== $defaultCollectEnd); @endphp
Filtros
@if($collectHasActiveFilters)
Activos
@endif
| ID | Folio | Cliente | Días pago | Emisión | Cobro estimado | Proyecto | Subtotal | IVA | Total | Cobrado | Saldo | Estatus |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $collect['id'] }} | {{ $collect['folio'] }} | {{ $collect['client_name'] }} | {{ $collect['payment_days'] }} | {{ $collect['issue_date']->format('Y-m-d') }} | {{ $collect['estimated_collection_date']->format('Y-m-d') }} |
{{ $collect['project_name'] }}
{{ $collect['title'] }}
|
${{ number_format((float) $collect['subtotal'], 2) }} | ${{ number_format((float) $collect['tax'], 2) }} | ${{ number_format((float) $collect['total'], 2) }} | ${{ number_format((float) $collect['collected_total'], 2) }} | ${{ number_format((float) $collect['pending_total'], 2) }} | {{ $collect['status_label'] }} |
| No hay cobros estimados para el rango seleccionado. | ||||||||||||
Control de proveedores por Proyecto, montos facturados y pendientes (solo facturas aprobadas).
@if($errors->any())| Proveedor | Facturas | Monto esperado | Monto sin IVA | Monto facturado | Saldo pendiente | Productos | Estatus | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $provider->provider_name }} | {{ $invoicesCount }} | {{ $expected !== null ? number_format($expected, 2) : '-' }} | {{ $expectedBase !== null ? number_format((float) $expectedBase, 2) : '-' }} | {{ number_format($invoiced, 2) }} | {{ $pending !== null ? number_format($pending, 2) : '-' }} |
@if($providerItems->isEmpty())
Sin productos
@else
Ver productos ({{ $providerItems->count() }})
|
@if($providerStatus === 'none') @if($pendingApprovalCount > 0) {{ $pendingApprovalCount === 1 ? 'Factura pendiente por aprobar' : 'Facturas pendientes por aprobar' }} ({{ $pendingApprovalCount }}) @else Sin factura @endif @elseif($providerStatus === 'partial') Parcial ({{ $providerMatchedCount }}/{{ max(1, $providerItemsTotal) }}) @if($invoicePdf) Ver factura @endif @elseif($invoicePdf) Con factura @else Con factura @endif | ||||||||
| Sin proveedores asociados. | |||||||||||||||