@php $enabled_sales_agents = App\Models\Tenant\Configuration::getRecordIndividualColumn('enabled_sales_agents'); @endphp Compras

Reporte Nota de Venta


@inject('reportService', 'Modules\Report\Services\ReportService') @if (isset($filters['seller_id']) && !empty($filters['seller_id'])) @endif

Empresa:

{{ $company->name }}

Fecha:

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

Ruc:

{{ $company->number }}

Usuario:

{{ $reportService->getUserName($filters['seller_id']) }}

@if (!empty($records))
@php $acum_total_taxed = 0; $acum_total_igv = 0; $acum_total = 0; $acum_total_taxed_usd = 0; $acum_total_igv_usd = 0; $acum_total_usd = 0; @endphp @if ($enabled_sales_agents) @endif @foreach ($records as $key => $value) @php $date_of_payment = $value->date_of_issue->format('Y-m-d'); $payments = $value->payments; if (count($payments) > 0) { $date_of_payment = $payments[0]->date_of_payment->format('Y-m-d'); } @endphp @php $count_register = numberDocumentByClient($value->customer_id,\App\Models\Tenant\SaleNote::class); @endphp @php $identity_document_type_description = ''; $identity_document_type_id = $value->customer->identity_document_type_id; $db_identity_document_type = \App\Models\Tenant\Catalogs\IdentityDocumentType::where( 'id', $identity_document_type_id, )->first(); if ($db_identity_document_type) { $identity_document_type_description = $db_identity_document_type->description; } @endphp @php $documents = $value->documents; @endphp @php $dispatches_order = []; $dispatch_order = $value->dispatch_order; if ($dispatch_order) { $dispatches = $dispatch_order->dispatches; foreach ($dispatches as $dispatch) { $dispatches_order[] = $dispatch->series.'-'.$dispatch->number_full; } } @endphp {{ implode(', ', $dispatches_order) }} @if ($value->state_type_id == '11') @else @endif @if ($enabled_sales_agents) @endif @php if ($value->currency_type_id == 'PEN') { if ($value->state_type_id == '11') { $acum_total += 0; $acum_total_taxed += 0; $acum_total_igv += 0; } else { $acum_total += $value->total; $acum_total_taxed += $value->total_taxed; $acum_total_igv += $value->total_igv; } } elseif ($value->currency_type_id == 'USD') { if ($value->state_type_id == '11') { $acum_total_usd += 0; $acum_total_taxed_usd += 0; $acum_total_igv_usd += 0; } else { $acum_total_usd += $value->total; $acum_total_taxed_usd += $value->total_taxed; $acum_total_igv_usd += $value->total_igv; } } @endphp @endforeach
# Fecha Emisión Hora Emisión Fecha de pago Usuario/Vendedor Primera compra Cliente Tipo de documento N° documento Nota de Venta Estado pago Condición pago Método pago Destino Referencia/N° Operación Confirmación de pago Monto Estado Moneda Plataforma Orden de compra Region Departamento Provincia Distrito Comprobantes Fecha comprobante Guias Cotización Caso Productos Descuento T.Exportación T.Inafecta T.Exonerado T.Gravado T.Igv TotalAgente Datos de referencia
{{ $loop->iteration }} {{ $value->date_of_issue->format('Y-m-d') }} {{ $value->time_of_issue }}{{ $date_of_payment }} {{ $value->user->name }}{{ $count_register > 1 ? 'No' : 'Si' }} {{ $value->customer->name }}{{ $identity_document_type_description }} {{ $value->customer->number }} {{ $value->number_full }} {{ $value->total_canceled ? 'Pagado' : 'Pendiente' }} {{ $value->payment_condition_id == '01' ? 'Contado' : 'Crédito' }} @php $payments_methods = []; if ($value->payment_condition_id == '01') { $payments_methods = $value->payments->map(function ($row) { return $row['payment_method_type']['description']; }); } else { $payments_methods = $value->fee->map(function ($row) { if ($row->payment_method_type) { return $row->payment_method_type->description; } else { return 'Credito'; } }); } @endphp {{ implode(', ', $payments_methods->toArray()) }} @php $payment_destinations = []; foreach ($value->payments as $payment) { $destination = getPaymentDestination( $payment->id, \App\Models\Tenant\SaleNotePayment::class, ); if (strlen($destination) > 0) { $payment_destinations[] = $destination; } } @endphp {{ implode(', ', $payment_destinations) }} @php $reference_payment = ''; foreach ($value->payments as $payment) { $reference_payment .= $payment->reference . ' '; } @endphp {{ $reference_payment }} @if ($value->state_payment_id == '01') En espera @elseif ($value->state_payment_id == '02') Aprobado @else Rechazado @endif {{$value->total}} {{ $value->state_type->description }} {{ $value->currency_type_id }} @foreach ($value->getPlatformThroughItems() as $platform) @endforeach {{ $value->purchase_order }} {{ $value->customer->department->description }} {{ $value->customer->department->description }} {{ $value->customer->province->description }} {{ $value->customer->district->description }} @foreach ($documents as $doc)

{{ $doc->number_full }}

@endforeach
@foreach ($documents as $doc)

{{ $doc->date_of_issue->format('Y-m-d') }}

@endforeach
{{ $value->quotation ? $value->quotation->number_full : '' }} {{ isset($value->quotation->sale_opportunity) ? $value->quotation->sale_opportunity->number_full : '' }} @foreach ($value->getItemsforReport() as $key => $item) - {{ $item['description'] }} / Cantidad: {{ $item['quantity'] }} @if ($key < count($value->getItemsforReport()) - 1)
@endif @endforeach
0 0 0 0 0 0 0{{ $value->total_discount }} {{ $value->total_exportation }} {{ $value->total_unaffected }} {{ $value->total_exonerated }} {{ $value->total_taxed }} {{ $value->total_igv }} {{ $value->total }}{{ optional($value->agent)->search_description }} {{ $value->reference_data }}
Totales PEN {{ $acum_total_taxed }} {{ $acum_total_igv }} {{ $acum_total }}
Totales USD {{ $acum_total_taxed_usd }} {{ $acum_total_igv_usd }} {{ $acum_total_usd }}
@else

No se encontraron registros.

@endif