@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 ($document->state_type->id == '11' || $document->state_type->id == '09' || $document->state_type->id == '55' || $document->state_type->id == '01' || $document->state_type->id == '03')
anulado
@endif @if ($document->soap_type_id == '01')
anulado
@endif @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. N° {{ $company->number }}
{{ $document->document_type->description }}
{{ $document_number }}
DATOS DEL DESTINATARIO DATOS DEL PUNTO PARTIDA Y LLEGADA
Nombre: {{$customer->name}} Dirección de partida: {{$document->origin->address}} @isset($document->origin->location_id) - {{ func_get_location($document->origin->location_id) }} @endisset
RUC: {{$customer->number}} Dirección de llegada: {{$document->delivery->address}} @isset($document->delivery->location_id) - {{ func_get_location($document->delivery->location_id) }} @endisset
DATOS DEL TRASLADO
Fecha y hora Emisión: {{$document->date_of_issue->format('d/m/Y h:i:s')}} Documento relacionado: {{ $document->reference_check() }}
Fecha de entrega de bienes al trasnportista: {{$document->date_of_shipping->format('d/m/y')}} Modalidad de traslado: {{optional($document->transport_mode_type)->description }}
Nro. Bultos: {{$document->packages_number}} Peso bruto: {{$document->total_weight}} {{$document->unit_type_id}}
Nro Precinto: Nro Contenedor:
Motivo traslado: {{ optional($document->transfer_reason_type)->description }}
DATOS DEL TRANSPORTE
Razon social transportista: {{optional($document->dispatcher)->name}} Placa Vehiculo Principal: {{ $document->transport_data ? $document->transport_data['plate_number']:'' }}
RUC Transportista: {{optional($document->dispatcher)->number}} Placa Vehiculo Secundario: @php $second_plate = ""; if(isset($document->transport_data['secondary_plate_number'])) { $second_plate = $document->transport_data['secondary_plate_number']; } @endphp {{ $second_plate }}
Registro MTC: {{optional($document->dispatcher)->number_mtc}} Nro de Licencia: {{ optional($document->driver)->license }}
Conductor: {{ optional($document->driver)->name }}
@foreach ($document->items as $idx => $row) @endforeach
DATOS DEL BIEN TRANSPORTADO
Item Código Descripción Und Cantidad
{{ $idx + 1 }} {{ $row->item->internal_id }} {{ $row->item->description }} {{ symbol_or_code($row->item->unit_type_id) }} {{ $row->quantity }}
OBSERVACIONES: {{$document->observations}}