@php $enabled_sales_agents = App\Models\Tenant\Configuration::getRecordIndividualColumn('enabled_sales_agents'); @endphp Ventas resumidas
REPORTE DE VENTA RESUMIDA DE
{{ \Carbon\Carbon::parse($d_start)->format('d-m-Y') }} AL {{ \Carbon\Carbon::parse($d_end)->format('d-m-Y') }}
EMPRESA:

{{ $company->name }}

RUC: {{ $company->number }}

@if (!empty($records))
@php $total_general = 0; $pending_general = 0; @endphp @foreach ($records as $key => $value) @php $total_zone = 0; $pending_zone = 0; @endphp @if ($loop->iteration !== 1) @endif @foreach ($value as $customer => $sellers) @if ($loop->iteration !== 1) @endif @php $total_customer = 0; $pending_customer = 0; @endphp @php $explode_customer = explode('|', $customer); $name = $explode_customer[0]; $address = $explode_customer[1]; @endphp @foreach ($sellers as $seller => $documents) @if ($loop->iteration !== 1) @endif @php $total_seller = 0; $pending_seller = 0; @endphp @foreach ($documents as $document) @php $total_zone += $document->total; $total_customer += $document->total; $total_seller += $document->total; $pending_zone += $document->pending; $pending_customer += $document->pending; $pending_seller += $document->pending; @endphp {{-- total original --}} {{-- el total menos lo que pagó --}} {{-- lo que pagó --}} @endforeach @endforeach @endforeach @php $total_general += $total_zone; $pending_general += $pending_zone; @endphp @endforeach
# DOC FECHA EMISIÓN FECHA VENCIMIENTO IMPORTE DEBE ABONOS
ZONA: {{ $key }}

{{ $name }}
{{ $address }}

VENDEDOR: {{ $seller }}
{{ $loop->iteration }} {{ $document->document_number }} {{ \Carbon\Carbon::parse($document->date_of_issue)->format('d-m-Y') }} {{ \Carbon\Carbon::parse($document->date_of_due)->format('d-m-Y') }} {{ number_format($document->total, 2) }} {{ number_format($document->total - $document->pending, 2) }} {{ number_format($document->pending, 2) }}
TOTAL VENDEDOR {{ number_format($total_seller, 2) }} {{ number_format($total_seller - $pending_seller, 2) }} {{ number_format($pending_seller, 2) }}
TOTAL CLIENTE {{ number_format($total_customer, 2) }} {{ number_format($total_customer - $pending_customer, 2) }} {{ number_format($pending_customer, 2) }}
TOTAL ZONA {{ number_format($total_zone, 2) }} {{ number_format($total_zone - $pending_zone, 2) }} {{ number_format($pending_zone, 2) }}

TOTAL GENERAL {{ number_format($total_general, 2) }} {{ number_format($total_general - $pending_general, 2) }} {{ number_format($pending_general, 2) }}
@else

No se encontraron registros.

@endif