Consolidado de items por cliente/vendedor - Totales

@inject('reportService', 'Modules\Report\Services\ReportService') @if(isset($params['sellers'])) @php $sellers = json_decode($params['sellers']); @endphp @if(count($sellers) > 0) @endif @endif @if(isset($params['person_id'])) @endif

Empresa: {{$company->name}}

Ruc: {{$company->number}}

Establecimiento: {{$establishment->address}} - {{$establishment->department->description}} - {{$establishment->district->description}}

Usuario(s): @foreach ($sellers as $seller_id) - {{$reportService->getUserName($seller_id)}} @endforeach

Cliente: {{$reportService->getPersonName($params['person_id'])}}

@if(!empty($records))
@php @endphp @php $showCosts = (bool) ($params['show_costs'] ?? false); @endphp @if($showCosts) @endif {{-- Fila por producto (totales) y debajo, con sangria, cada presentacion vendida. --}} @foreach($records as $key => $value) @php $single = ($value['presentations_count'] ?? 1) === 1; @endphp @if($showCosts) @endif @if(!$single) @foreach($value['presentations'] as $p) @if($showCosts) @endif @endforeach @endif @endforeach
# Cod. Interno Producto Presentación Laboratorio Cantidad Unidades Precio prom. x und. Total de ventaCosto Utilidad Margen %
{{ $loop->iteration }} {{$value['item_internal_id']}} {{$value['item_description']}} {{$value['presentation']}} {{$value['brand']}} {{ $single ? ($value['presentations'][0]['quantity'] ?? '') : '' }} {{$value['base_units']}} {{ $value['avg_unit_price'] !== null ? number_format($value['avg_unit_price'], 2) : '' }} {{ number_format($value['total_sale'], 2) }}{{ number_format($value['cost'] ?? 0, 2) }} {{ number_format($value['utility'] ?? 0, 2) }} {{ number_format($value['margin_percent'] ?? 0, 2) }}
   â†³ {{$p['presentation']}} {{$p['quantity']}} {{$p['base_units']}} {{ $p['avg_unit_price'] !== null ? number_format($p['avg_unit_price'], 2) : '' }} {{ number_format($p['total_sale'], 2) }}{{ number_format($p['cost'] ?? 0, 2) }} {{ number_format($p['utility'] ?? 0, 2) }} {{ number_format($p['margin_percent'] ?? 0, 2) }}
@else

No se encontraron registros.

@endif