Reporte Compras

@inject('reportService', 'Modules\Report\Services\ReportService') @if($filters['seller_id']) @endif @if($filters['person_id']) @endif

Empresa: {{$company->name}}

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

Ruc: {{$company->number}}

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

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

Proveedor: {{$reportService->getPersonName($filters['person_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; $apply_conversion_to_pen = $filters['apply_conversion_to_pen'] == 'true'; @endphp @foreach($records as $key => $value) @if ($apply_conversion_to_pen && $value->isCurrencyTypeUsd()) @else @endif @php $value->total_taxed = (in_array($value->document_type_id,['01','03']) && in_array($value->state_type_id,['09','11'])) ? 0 : $value->total_taxed; $value->total_igv = (in_array($value->document_type_id,['01','03']) && in_array($value->state_type_id,['09','11'])) ? 0 : $value->total_igv; $value->total = (in_array($value->document_type_id,['01','03']) && in_array($value->state_type_id,['09','11'])) ? 0 : $value->total; $state = $value->state_type_id; @endphp @php if($value->currency_type_id == 'PEN'){ if($state == '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; } }else if($value->currency_type_id == 'USD'){ if($state == '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 @if (!$apply_conversion_to_pen) @endif
# Tipo Doc Número F. Emisión F. Vencimiento Proveedor RUC Cliente F. Pago Moneda Total ISC Total Gravado Total IGV Total
{{$loop->iteration}} {{$value->document_type->id}} {{$value->series}}-{{$value->number}} {{$value->date_of_issue->format('Y-m-d')}} {{$value->date_of_due->format('Y-m-d')}} {{$value->supplier->name}} {{$value->supplier->number}} {{$value->customer ? $value->customer->name : ''}}
{{$value->customer ? $value->customer->identity_document_type->description : ''}} {{$value->customer ? $value->customer->number : ''}}
{{-- {{isset($value->purchase_payments['payment_method_type']['description'])?$value->purchase_payments['payment_method_type']['description']:'-'}} --}} @foreach($value->payments as $pay) {{$pay->payment_method_type->description}} @endforeach {{$value->currency_type_id}} (Conv.) {{ $value->state_type_id == '11' ? 0 : $value->getConvertTotalIscToPen() }} {{ $value->state_type_id == '11' ? 0 : $value->getConvertTotalTaxedToPen() }} {{ $value->state_type_id == '11' ? 0 : $value->getConvertTotalIgvToPen() }} {{ $value->state_type_id == '11' ? 0 : $value->getConvertTotalToPen() }}{{$value->currency_type_id}} {{ $value->state_type_id == '11' ? 0 : $value->total_isc}} {{ $value->state_type_id == '11' ? 0 : $value->total_taxed}} {{ $value->state_type_id == '11' ? 0 : $value->total_igv}} {{ $value->state_type_id == '11' ? 0 : $value->total}}
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