@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; } $logo = null; if (!$document->alter_company) { $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); $is_itinerant = $document->transfer_reason_type_id === '18' ? true : false; // $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 }}

@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 REMITENTE
{{ $document_number }}
@if ($document->is_transport_category_m1l) @endif @if ($document->related_document) @endif @if ($document->purchase_order) @endif @if ($document->transfer_reason_description) @endif @if ($document->order_form_external) @endif @if ($document->observations) @endif @if ($document->reference_document) @endif @if ($is_itinerant) @endif
DATOS GENERALES
Indicador traslado en vehículos de categoría M1 o L: Si
Punto de partida:
@if (is_integrate_system()) {{ $document->origin ? func_get_location($document->origin->location_id) : null }}
{{ $document->origin ? $document->origin->address : null }} @else {{ $document->origin ? $document->origin->address : null }}
{{ $document->origin ? func_get_location($document->origin->location_id) : null }} @endif
@if (!$is_itinerant) Punto de llegada:
@if (is_integrate_system()) {{ $document->delivery ? func_get_location($document->delivery->location_id) : null }}
{{ $document->delivery ? $document->delivery->address : null }} @else {{ $document->delivery ? $document->delivery->address : null }}
{{ $document->delivery ? func_get_location($document->delivery->location_id) : null }} @endif @endif
Motivo Traslado:
{{ $document->transfer_reason_type->description }}
Modalidad de Transporte:
{{ $document->transport_mode_type->description }}
Fecha de emisión:
{{ $document->date_of_issue->format('d/m/Y') }}
Fecha de traslado:
{{ $document->date_of_shipping->format('d/m/Y') }}
Documento relacionado:
{{ $document->related_document }}
Orden de compra:
{{ $document->purchase_order }}
Descripción de motivo de traslado:
{{ $document->transfer_reason_description }}
Orden de pedido:
{{ $document->order_form_external }}
Observaciones:
{{ $document->observations }}
{{ $document->reference_document->document_type->description }}
{{ $document->reference_document ? $document->reference_document->number_full : '' }}
Número de bultos:
{{ $document->packages_number }} bultos
Peso bruto total:
{{ $document->total_weight }} {{ $document->unit_type_id }}
@if (!$is_itinerant) @if(is_integrate_system()) @else @endif @if(is_integrate_system() && $document->dispatch_orden) @endif
DATOS DEL DESTINATARIO
Nombre o razón social:
{{ $customer->name }}
Tipo y número de identificación:
{{ $customer->identity_document_type->description }}: {{ $customer->number }}
Dirección:
@if ($document->transfer_reason_type_id === '09') {{ $customer->address }} - {{ $customer->country->description }} @else {{ $customer->address }} {{ $customer->district_id !== '-' ? ', ' . $customer->district->description : '' }} {{ $customer->province_id !== '-' ? ', ' . $customer->province->description : '' }} {{ $customer->department_id !== '-' ? '- ' . $customer->department->description : '' }} @endif
Teléfono:
{{ $customer->telephone }}
Dirección:
@if ($document->transfer_reason_type_id === '09') {{ $customer->address }} - {{ $customer->country->description }} @else {{ $customer->address }} {{ $customer->district_id !== '-' ? ', ' . $customer->district->description : '' }} {{ $customer->province_id !== '-' ? ', ' . $customer->province->description : '' }} {{ $customer->department_id !== '-' ? '- ' . $customer->department->description : '' }} @endif
Número de bultos:
{{ $document->packages_number }} bultos
Peso bruto total:
{{ $document->total_weight }} {{ $document->unit_type_id }}
Nota de venta:
{{$document->dispatch_orden->sale_note->identifier}}
@endif @if ($document->supplier_id)
DATOS DEL PROVEEDOR
Razón social:
{{ $document->supplier->name }}
Tipo y número de identificación:
{{ $document->supplier->identity_document_type->description }}: {{ $document->supplier->number }}
Dirección:
{{ $document->supplier->address }} {{ $document->supplier->district_id !== '-' ? ', ' . $document->supplier->district->description : '' }} {{ $document->supplier->province_id !== '-' ? ', ' . $document->supplier->province->description : '' }} {{ $document->supplier->department_id !== '-' ? '- ' . $document->supplier->department->description : '' }}
@endif @if ($document->is_transport_category_m1l) @if ($document->plate_number) @endif @else @if ($document->transport_mode_type_id === '01') @php $document_type_dispatcher = App\Models\Tenant\Catalogs\IdentityDocumentType::findOrFail( $document->dispatcher->identity_document_type_id, ); @endphp @endif @if ($document->transport_mode_type_id === '01') @isset($document->dispatcher->number_mtc) @endisset @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 @endif @if ($document->tracto_carreta) @endif @isset($document->driver->name) @endisset @isset($document->secondary_driver->name) @endisset @isset($document->driver->license) @endisset @endif
DATOS DEL TRANSPORTE Y TRASLADO
Placa de vehículo: {{ $document->plate_number }}
Nombre y/o razón social: {{ $document->dispatcher->name }} {{ $document_type_dispatcher->description }}: {{ $document->dispatcher->number }}
Autorización MTC: {{ $document->dispatcher->number_mtc }}
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'] }}
Modelo del vehículo: {{ $document->transport_data['model'] }}
Marca de tracto carreta: {{ $document->tracto_carreta }}
Nombre Conductor: {{ $document->driver->name }} Documento Conductor: {{ $document->driver->number }}
Nombre Conductor Secundario: {{ $document->secondary_driver->name }} Documento Conductor Secundario: {{ $document->secondary_driver->number }}
Licencia del conductor: {{ $document->driver->license }}
@foreach ($document->items as $idx => $row) @endforeach
Código Descripción Unidad Cantidad Peso
{{ $idx + 1 }} {{ $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 @isset($row->item->attributes) @foreach ($row->item->attributes as $attr)
{!! $attr->description !!} : {{ $attr->value }} @endforeach @endisset @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 @isset($row->item->lots) @if(count($row->item->lots) > 0)
Serie: @foreach ($row->item->lots as $key => $lot) @if (isset($lot->has_sale) && $lot->has_sale) {{ $lot->series }} @if ($key != count($row->item->lots) - 1) / @endif @endif @endforeach @endif @endisset @if($row->item->IdLoteSelected) @inject('itemLotGroup', 'App\Services\ItemLotsGroupService') @php $lote = $itemLotGroup->getLote($row->item->IdLoteSelected); $loteParts = explode('/', $lote); @endphp @foreach ($loteParts as $part)
Lote: {{ $part }} @endforeach @endif @if($row->item->IdLoteSelected) @inject('itemLotGroup', 'App\Services\ItemLotsGroupService') @php $fechaVencimiento = $itemLotGroup->getLotDateOfDue($row->item->IdLoteSelected); $fechaParts = explode('/', $fechaVencimiento); @endphp @foreach ($fechaParts as $part) Fecha: {{ $part }}
@endforeach @endif
{{ symbol_or_code($row->item->unit_type_id) }} @if ((int) $row->quantity != $row->quantity) {{ $row->quantity }} @else {{ number_format($row->quantity, 2) }} @endif {{ number_format($row->item->weight, 2) }} {{ $document->unit_type_id }}
@if ($document['qr'])
@endif @if ($configurations->terms_condition_dispatches)
Términos y condiciones del servicio
{!! $configurations->terms_condition_dispatches !!}
@endif