@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); } $document_number = $document->series . '-' . str_pad($document->number, 8, '0', STR_PAD_LEFT); @endphp @if ($company->logo) @else @endif
logo}")) }};base64, {{ base64_encode(file_get_contents(public_path("storage/uploads/logos/{$company->logo}"))) }}" 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 : '' }}

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

{{ $document_number }}

@foreach ($document->dispatches_related as $related) @endforeach
Fecha Emisión: {{ $document->date_of_issue->format('Y-m-d') }}
Fecha Inicio de Traslado: {{ $document->date_of_shipping->format('Y-m-d') }}
Peso Bruto Total({{ $document->unit_type_id }}): {{ $document->total_weight }}
Punto de Partida: {{ $document->sender_address_data['location_id'] }} - {{ $document->sender_address_data['address'] }}
Punto de Llegada: {{ $document->receiver_address_data['location_id'] }} - {{ $document->receiver_address_data['address'] }}
Datos del Remitente: {{ $document->sender_data['name'] }} - {{ $document->sender_data['identity_document_type_description'] }} {{ $document->sender_data['number'] }}
Datos del Destinatario: {{ $document->receiver_data['name'] }} - {{ $document->receiver_data['identity_document_type_description'] }} {{ $document->receiver_data['number'] }}
Guias de remisión: {{ $related->serie_number }} RUC: {{ $related->company_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
TRANSPORTE
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 }}
@if ($document->flete_payment_name && $document->flete_payment_number) DATOS DEL PAGADOR DEL FLETE Razón Social/ Nombres {{ $document->flete_payment_name ?? '' }} RUC/Doc. Identidad: {{ $document->flete_payment_number ?? '' }} @endif @foreach ($document->items as $row) @endforeach
Item Código Descripción Modelo Unidad Cantidad
{{ $loop->iteration }} {{ $row->item->internal_id }} @if ($row->name_product_pdf) {!! $row->name_product_pdf !!} @else {!! $row->item->description !!} @endif @if ($row->attributes) @foreach ($row->attributes as $attr)
{!! $attr->description !!} : {{ $attr->value }} @endforeach @endif @if ($row->discounts) @foreach ($row->discounts as $dtos)
{{ $dtos->factor * 100 }}% {{ $dtos->description }} @endforeach @endif @if ($row->relation_item->is_set == 1)
@inject('itemSet', 'App\Services\ItemSetService') @foreach ($itemSet->getItemsSet($row->item_id) as $item) {{ $item }}
@endforeach @endif @if ($document->has_prepayment)
*** Pago Anticipado *** @endif
{{ $row->item->model ?? '' }} {{ symbol_or_code($row->item->unit_type_id) }} @if ((int) $row->quantity != $row->quantity) {{ $row->quantity }} @else {{ number_format($row->quantity, 0) }} @endif
@if ($document->observations)
OBSERVACIONES
{{ $document->observations }}
@endif @if ($document->qr)
@endif