Reporte de comisión de vendedores - utilidades detallado


Empresa:

{{$company->name}}

Fecha:

{{date('Y-m-d')}}

Ruc:

{{$company->number}}

@if(!empty($records)) @php $acum_unit_gain = 0; $acum_overall_profit = 0; @endphp
@foreach($records as $row) @php $type_document = ''; $relation = $row->document_id ? $row->document : $row->sale_note; if($row->document_id) { $type_document = $row->document->document_type_id == '01' ? 'FACTURA' : 'BOLETA'; } else if ($row->sale_note_id) { $type_document = 'NOTA DE VENTA'; } $purchase_unit_price = 0; if(isset($row->item->purchase_unit_price)){ $purchase_unit_price = $row->item->purchase_unit_price; } $unit_gain = ((float)$row->unit_price - (float)$purchase_unit_price); $overall_profit = (((float)$row->unit_price * $row->quantity ) - ((float)$purchase_unit_price * $row->quantity)); $acum_unit_gain += (float) $unit_gain; $acum_overall_profit += (float) $overall_profit; @endphp @endforeach {{-- --}}
# Fecha Comprobante Serie Ruc/Dni Comercial Detalle Cantidad Precio compra Precio venta Ganancia unidad Ganancia total
{{$loop->iteration}} {{$relation->date_of_issue->format('Y-m-d')}} {{$type_document}} {{$relation->number_full}} {{ $relation->customer->number}} {{$relation->customer->name}} {{$row->relation_item->description}} {{$row->quantity}} {{$purchase_unit_price}} {{$row->unit_price}} {{ $unit_gain }} {{ $overall_profit }}
TOTAL: {{ number_format($acum_unit_gain, 2, ".", "") }} {{ number_format($acum_overall_profit, 2, ".", "") }}
TOTAL: {{ $acum_unit_gain }} {{ $acum_overall_profit }}
@else

No se encontraron registros.

@endif