@php $establishment = $document->establishment; $configuration = \App\Models\Tenant\Configuration::first(); $configurations = \App\Models\Tenant\Configuration::first(); $company_name = $company->name; $company_owner = null; if ($configurations->trade_name_pdf) { $company_name = $company->trade_name; $company_owner = $company->name; } $establishment__ = \App\Models\Tenant\Establishment::find($document->establishment_id); $logo = $establishment__->logo ?? $company->logo; if ($logo === null && !file_exists(public_path("$logo}"))) { $logo = "{$company->logo}"; } if ($logo) { $logo = "storage/uploads/logos/{$logo}"; $logo = str_replace('storage/uploads/logos/storage/uploads/logos/', 'storage/uploads/logos/', $logo); } $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); // dd($document->items); @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 }}

@if ($company_owner) De: {{ $company_owner }} @endif
{{ $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. N° {{ $company->number }}
GUÍA DE REMISIÓN TRANSPORTISTA
{{ $document_number }}
@if ($document->flete_payer) @endif
DATOS GENERALES
Punto de partida:
{{ optional($document->sender_address_data)['address'] }} @if(isset($document->sender_address_data)&&isset($document->sender_address_data['location_id']))
{{ func_get_location($document->sender_address_data['location_id'] ) }} @endif
Punto de llegada:
{{ optional($document->receiver_address_data)['address'] }} @if(isset($document->receiver_address_data)&&isset($document->receiver_address_data['location_id']))
{{ func_get_location($document->receiver_address_data['location_id'] ) }} @endif
Fecha de emisión: {{ $document->date_of_issue->format('d/m/Y') }} Fecha de traslado: {{ $document->date_of_shipping->format('d/m/Y') }}
Pagador del flete: {{ $document->flete_payer->name ?? '' }} RUC/Doc. del pagador: {{ $document->flete_payer->number ?? '' }}
Documentos relacionados:
@foreach ($document->dispatches_related as $related) Guía remitente {{ $related->serie_number }} RUC: {{ $related->company_number }}
@endforeach
DATOS DEL REMITENTE
Nombre o razón social:
{{ $document->sender_data ? $document->sender_data['name'] : '' }}
Tipo y número de identificación:
{{ $document->sender_data ? $document->sender_data['identity_document_type_description'] : '' }}- {{ $document->sender_data ? $document->sender_data['number'] : '' }}
DATOS DEL DESTINATARIO
Nombre o razón social:
{{ $document->receiver_data ? $document->receiver_data['name'] : '' }}
Tipo y número de identificación:
{{ $document->receiver_data ? $document->receiver_data['identity_document_type_description'] : '' }}- {{ $document->receiver_data ? $document->receiver_data['number'] : '' }}
@if ($company->mtc_auth) @endif @if ($document->transport_data) @if (isset($document->transport_data['auth_plate_primary'])) @endif @if (isset($document->secondary_transport_data['secondary_plate_number'])) @else @if (isset($document->transport_data['secondary_plate_number'])) @endif @endif @if (isset($document->secondary_transport_data['auth_plate_secondary'])) @else @if (isset($document->transport_data['auth_plate_secondary'])) @endif @endif @if ($document->driver->name) @endif @isset ($document->secondary_driver->name) @endisset @endif @if ($document->tracto_carreta) @endif @if ($document->driver->license) @endif @if ($document->observations) @endif
DATOS DEL TRANSPORTE Y TRASLADO
Número de bultos: {{ $document->packages_number }} bultos Peso bruto total: {{ $document->total_weight }} {{ $document->unit_type_id }}
Número de autorización MTC: {{ $company->mtc_auth }}
Número de placa del vehículo: {{ $document->transport_data['plate_number'] }}Autorización de placa principal: {{ $document->transport_data['auth_plate_primary'] }}
Número de placa secundaria del vehículo: {{ $document->secondary_transport_data['secondary_plate_number'] }}Número de placa secundaria del vehículo: {{ $document->transport_data['secondary_plate_number'] }}Autorización de placa secundaria: {{ $document->secondary_transport_data['auth_plate_secondary'] }}Autorización de placa secundaria: {{ $document->transport_data['auth_plate_secondary'] }}
Nombre Conductor: {{ $document->driver->name }} Documento Conductor: {{ $document->driver->number }}
Nombre Conductor Secundario: {{ $document->secondary_driver->name }} Documento Conductor Secundario: {{ $document->secondary_driver->number }}
Modelo del vehículo: {{ $document->transport_data['model'] }}
Marca de tracto carreta: {{ $document->tracto_carreta }}
Licencia del conductor: {{ $document->driver->license }}
Observaciones: {{ $document->observations }}
@foreach ($document->items as $idx => $row) @endforeach
Código Descripción Unidad Cantidad Peso
{{ $idx + 1 }} {{ $row->item->internal_id }} {{ $row->item->description }} {{ symbol_or_code($row->item->unit_type_id) }} {{ $row->quantity }} {{ $row->item->weight }} {{ $document->unit_type_id }}
@if($document['qr'])
@endif