@php $establishment = $document->establishment; $customer = $document->customer; //$path_style = app_path('CoreFacturalo'.DIRECTORY_SEPARATOR.'Templates'.DIRECTORY_SEPARATOR.'pdf'.DIRECTORY_SEPARATOR.'style.css'); $document_number = $document->series.'-'.str_pad($document->number, 8, '0', STR_PAD_LEFT); $document_type_driver = App\Models\Tenant\Catalogs\IdentityDocumentType::findOrFail($document->driver->identity_document_type_id); $document_type_dispatcher = App\Models\Tenant\Catalogs\IdentityDocumentType::findOrFail($document->dispatcher->identity_document_type_id); $allowed_items = 90; $quantity_items = $document->items()->count(); $cycle_items = $allowed_items - ($quantity_items * 5); $total_weight = 0; @endphp {{--{{ $document_number }}--}} {{----}} @if($company->logo) @else @endif
logo}"))}};base64, {{base64_encode(file_get_contents(public_path("storage/uploads/logos/{$company->logo}")))}}" alt="{{$company->name}}" alt="{{ $company->name }}" class="company_logo" style="max-width: 300px"> {{----}}

{{ $company->name }}

{{ 'RUC '.$company->number }}

{{ ($establishment->address !== '-')? $establishment->address : '' }} {{ ($establishment->district_id !== '-')? ', '.$establishment->district->description : '' }} {{ ($establishment->province_id !== '-')? ', '.$establishment->province->description : '' }} {{ ($establishment->department_id !== '-')? '- '.$establishment->department->description : '' }}
{{ ($establishment->email !== '-')? $establishment->email : '' }}
{{ ($establishment->telephone !== '-')? $establishment->telephone : '' }}

{{ 'R.U.C. '.$company->number }}

{{ $document->document_type->description }}


{{ $document_number }}

@if ($document->reference_document) @else @endif @if ($document->reference_document) @if ($document->reference_document->purchase_order) @else @endif @else @endif
DESTINATARIO
Razón Social: {{ $customer->name }}COMPROBANTE: {{$document->reference_document->document_type->description}} {{$document->reference_document->number_full}}
RUC: {{ $customer->number }}O. COMPRA: {{$document->reference_document->purchase_order}}
Dirección: {{ $customer->address }} {{ ($customer->district_id !== '-')? ', '.$customer->district->description : '' }} {{ ($customer->province_id !== '-')? ', '.$customer->province->description : '' }} {{ ($customer->department_id !== '-')? '- '.$customer->department->description : '' }}
{{-- --}}
ENVIO
Fecha Emisión: {{ $document->date_of_issue->format('d/m/Y') }}

PUNTO DE PARTIDA

Fecha de Traslado: {{ $document->date_of_shipping->format('d/m/Y') }}
Motivo Traslado: {{ $document->transfer_reason_type->description }}

PUNTO DE LLEGADA

Modalidad de Transporte: {{ $document->transport_mode_type->description }}
Peso Bruto Total({{ $document->unit_type_id }}): {{ $document->total_weight }} Número de Bultos: {{ $document->packages_number }}
P.Partida: {{ $document->origin->location_id }} - {{ $document->origin->address }} P.Llegada: {{ $document->delivery->location_id }} - {{ $document->delivery->address }}
UNIDAD DE TRANSPORTE - CONDUCTOR
N° Doc: {{ $document->driver->identity_document_type_id }}: {{ $document->driver->number }}
Placa N°: {{ $document->license_plate }}
N° Licencia: {{ $document->driver->license }}
{{-- --}}
EMPRESA DE TRANSPORTE
Transportista: {{ $document->dispatcher->name }}
{{ $document_type_dispatcher->description }}: {{ $document->dispatcher->number }}
Dirección: {{ $document->driver->license }}
@foreach($document->items as $row) @php $total_weight_line = 0; @endphp @endforeach @for($i = 0; $i < $cycle_items; $i++) @endfor
ITEM CÓDIGO CANTIDAD U.M. DESCRIPCIÓN PESO
{{ $loop->iteration }} {{ $row->item->internal_id }} @if(((int)$row->quantity != $row->quantity)) {{ $row->quantity }} @else {{ number_format($row->quantity, 0) }} @endif {{ $row->item->unit_type_id }} {!!$row->item->description!!} @if($row->relation_item->attributes) @foreach($row->relation_item->attributes as $attr) @if($attr->attribute_type_id === '5032') @php $total_weight += $attr->value * $row->quantity; $total_weight_line += $attr->value * $row->quantity; @endphp @endif
{!! $attr->description !!} : {{ $attr->value }} @endforeach @endif
{{ $total_weight_line }}
@php $total_packages = $document->items()->sum('quantity'); @endphp
TOTAL NÚMERO DE BULTOS: @if(((int)$total_packages != $total_packages)) {{ $total_packages }} @else {{ number_format($total_packages, 0) }} @endif
PESO TOTAL: KGM: {{$total_weight}}
OBSERVACIONES:
{{ $document->observations }}
Representación impresa de la Guía de Remisión