REPORTE POR CLIENTE


@if (!empty($records)) @endif

Cliente:

{{ $records[0]->customer->number }} - {{ $records[0]->customer->name }}

Empresa:

{{ $company->name }}

Fecha:

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

Ruc:

{{ $company->number }}

Establecimiento:

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

@if (!empty($records))
@php $acum_total_taxed = 0; $acum_total_igv = 0; $acum_total = 0; $serie_affec = ''; $acum_total_exonerado = 0; $acum_total_inafecto = 0; $acum_total_free = 0; $acum_total_taxed_usd = 0; $acum_total_igv_usd = 0; $acum_total_usd = 0; @endphp @if ($type != 'sale_note' && $type == 'quotation') @endif @foreach ($records as $key => $value) @if ($type != 'sale_note' && $type == 'quotation') @endif @php $signal = $value->document_type_id; $state = $value->state_type_id; @endphp @php $value->total_exonerated = in_array($value->document_type_id, ['01', '03']) && in_array($value->state_type_id, ['09', '11']) ? 0 : $value->total_exonerated; $value->total_unaffected = in_array($value->document_type_id, ['01', '03']) && in_array($value->state_type_id, ['09', '11']) ? 0 : $value->total_unaffected; $value->total_free = in_array($value->document_type_id, ['01', '03']) && in_array($value->state_type_id, ['09', '11']) ? 0 : $value->total_free; $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; @endphp @php $serie_affec = ''; @endphp @php if ($value->currency_type_id == 'PEN') { if ($signal == '07' && $state !== '11') { $acum_total += -$value->total; $acum_total_taxed += -$value->total_taxed; $acum_total_igv += -$value->total_igv; $acum_total_exonerado += -$value->total_exonerated; $acum_total_inafecto += -$value->total_unaffected; $acum_total_free += -$value->total_free; } elseif ($signal != '07' && $state == '11') { $acum_total += 0; $acum_total_taxed += 0; $acum_total_igv += 0; $acum_total_exonerado += 0; $acum_total_inafecto += 0; $acum_total_free += 0; } else { $acum_total += $value->total; $acum_total_taxed += $value->total_taxed; $acum_total_igv += $value->total_igv; $acum_total_exonerado += $value->total_exonerated; $acum_total_inafecto += $value->total_unaffected; $acum_total_free += $value->total_free; } } elseif ($value->currency_type_id == 'USD') { if ($signal == '07' && $state !== '11') { $acum_total_usd += -$value->total; $acum_total_taxed_usd += -$value->total_taxed; $acum_total_igv_usd += -$value->total_igv; } elseif ($signal != '07' && $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
# Fecha Tipo Documento EstadoNota C/DMoneda Serie Número Monto
{{ $loop->iteration }} {{ $value->date_of_issue->format('Y-m-d') }} @if ($type == 'sale_note') NOTA DE VENTA @elseif ($type == 'quotation') COTIZACIÓN @else {{ $value->document_type->description }} @endif {{ $value->state_type->description }} @php $notes = App\Models\Tenant\Note::where( 'affected_document_id', $value->id, )->get(); @endphp @if (!isset($notes)) - @else @php $noted = ''; foreach ($notes as $note) { $doc = $note->document; $noted .= $doc->series . '-' . $doc->number . ' '; } @endphp {{ $noted }} @endif {{ $value->currency_type_id }} {{ $value->series }} {{ $value->number }} {{ $value->total }}
TOTAL PEN {{ $acum_total }}
TOTAL USD {{ $acum_total_usd }}
@else

No se encontraron registros.

@endif