@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
{{--
{{ $company->name }}
Oficina Principal: {{ ($establishment->address !== '-')? $establishment->address.'' : '' }}
{{ ($establishment->district_id !== '-')? ' '.$establishment->district->description : '' }} {{ ($establishment->province_id !== '-')? ', '.$establishment->province->description : '' }} {{ ($establishment->department_id !== '-')? '- '.$establishment->department->description : '' }}
@isset($establishment->trade_address)
{{ $establishment->trade_address !== '-' ? 'Sucursal: ' . $establishment->trade_address : '' }}
@endisset
{{ ($establishment->telephone !== '-')? ''.$establishment->telephone : '' }} {{ $establishment->email !== '-' ? ' ' . $establishment->email : '' }}
{{ ($establishment->web_address !== '-')? ''.$establishment->web_address : '' }}
@isset($establishment->aditional_information)
{{ ($establishment->aditional_information !== '-')? $establishment->aditional_information : '' }}
@endisset --}}
RUC {{$company->number }}
{{ $document->document_type->description }}
Nro {{ $document_number }}
Fecha de Emision : {{ $document->date_of_issue->format('Y-m-d') }} Fecha de Traslado : {{ $document->date_of_shipping->format('Y-m-d') }} Factura Ref.: @if ($document->reference_document) @if ($document->reference_document) {{ $document->reference_document->document_type->description }} {{ $document->reference_document ? $document->reference_document->number_full : '' }} @endif @endif O/C. : {{$document->purchase_order}}
Direc. partida : {{ optional($document->origin)->location_id }} - {{ optional($document->origin)->address }}
Direc. llegada : {{ optional($document->delivery)->location_id }} - {{ optional($document->delivery)->address }}
REMITENTE
DESTINATARIO
{{ $company->name }}
{{ $company->identity_document_type->description }}: {{ $company->number }}
{{ $customer->name }}
{{ $customer->identity_document_type->description }}: {{ $customer->number }}
{{-- @if ($document->transfer_reason_type_id === '09') @else @endif @if ($customer->telephone) @endif
DESTINATARIO
Razón Social: {{ $customer->name }}
{{ $customer->identity_document_type->description }}: {{ $customer->number }}
Dirección: {{ $customer->address }} - {{ $customer->country->description }} Dirección: {{ $customer->address }} {{ $customer->district_id !== '-' ? ', ' . $customer->district->description : '' }} {{ $customer->province_id !== '-' ? ', ' . $customer->province->description : '' }} {{ $customer->department_id !== '-' ? '- ' . $customer->department->description : '' }}
Teléfono:{{ $customer->telephone }}
Vendedor: {{ $document->user->name }}
@if ($document->transfer_reason_description) @endif @if ($document->related) @endif @if ($document->packages_number) @endif @if ($document->order_form_external) @endif
ENVIO
Fecha Emisión: {{ $document->date_of_issue->format('Y-m-d') }} Fecha Inicio de Traslado: {{ $document->date_of_shipping->format('Y-m-d') }}
Motivo Traslado: {{ $document->transfer_reason_type->description }} Modalidad de Transporte: {{ $document->transport_mode_type->description }}
Descripción de motivo de traslado: {{ $document->transfer_reason_description }}
Número de documento (DAM): {{ $document->related->number }} Tipo documento relacionado: {{ $document->getRelatedDocumentTypeDescription() }}
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 }}
Orden de pedido: {{ $document->order_form_external }}
@if ($document->transport_mode_type_id === '01') @php $document_type_dispatcher = App\Models\Tenant\Catalogs\IdentityDocumentType::findOrFail($document->dispatcher->identity_document_type_id); @endphp @else @if ($document->transport_data) @endif @if ($document->driver->number) @endif @if ($document->secondary_license_plates) @if ($document->secondary_license_plates->semitrailer) @endif @endif @if ($document->driver->license) @endif @endif
TRANSPORTE
Nombre y/o razón social: {{ $document->dispatcher->name }} {{ $document_type_dispatcher->description }}: {{ $document->dispatcher->number }}
Número de placa del vehículo: {{ $document->transport_data['plate_number'] }}Conductor: {{ $document->driver->number }}
Número de placa semirremolque: {{ $document->secondary_license_plates->semitrailer }} Licencia del conductor: {{ $document->driver->license }}
--}} @foreach ($document->items as $row) @php $data_item = \App\Models\Tenant\Item::find($row->item_id); $digemid_codes = \App\Models\System\Digemid::select('cod_prod', 'num_regsan', 'nom_prod', 'nom_form_farm_simplif', 'concent', 'nom_titular', 'fracciones')->where('cod_prod',$data_item->cod_digemid)->first(); // dd($data_item->cod_digemid); @endphp @endforeach
CÓDIGO CANT. DESCRIPCIÓN UNIDADES
{{ $row->item->internal_id }} @if ((int) $row->quantity != $row->quantity) {{ $row->quantity }} @else {{ number_format($row->quantity, 0) }} @endif @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($digemid_codes) LAB: {{$digemid_codes->nom_titular}} @endisset @if ($row->item->IdLoteSelected ?? false) @foreach ($row->item->IdLoteSelected as $lot) LOTE: {{ $lot->code }} - FEC.VCTO.: {{ $lot->date_of_due }} @endforeach @endif @isset($data_item->sanitary) RS: {{$data_item->sanitary}} @endisset
{{ symbol_or_code($row->item->unit_type_id) }}
@if ($document->transport_mode_type_id === '01') TRANSPORTISTA @else CONDUCTOR @endif
DATOS DE LA UNIDAD DE TRANSPORTE
@if ($document->transport_mode_type_id === '01') @php $document_type_dispatcher = App\Models\Tenant\Catalogs\IdentityDocumentType::findOrFail($document->dispatcher->identity_document_type_id); @endphp @else @endif
Empresa : {{ $document->dispatcher->name }}
{{ $document_type_dispatcher->description }} : {{ $document->dispatcher->number }}
Nombres : {{ $document->driver->name }}
Licencia : {{ $document->driver->number }}
@if ($document->transport_mode_type_id === '01') @else @if ($document->secondary_license_plates) @if ($document->secondary_license_plates->semitrailer) @endif @endif @endif
Marca Vehiculo : @isset ( $document->transport_data['brand']) {{ $document->transport_data['brand'] }} @endif
Modelo : @isset ($document->transport_data['model'] ) {{ $document->transport_data['model'] }} @endif
No.de Placa : @isset ($document->transport_data['plate_number'] ) {{ $document->transport_data['plate_number'] }} @endif
Marca Vehiculo : @if ($document->transport_data) {{ $document->transport_data['brand'] }} @endif
No.de Placa : @if ($document->transport_data) {{ $document->transport_data['plate_number'] }} @endif
No.de Placa semirremolque : {{ $document->secondary_license_plates->semitrailer }}
MOTIVO DE TRANSPORTE DATOS DE ENVIO
1. Venta @if($document->transfer_reason_type_id == '01')      X @endif
2. Venta Sujeta a confirmacion @if($document->transfer_reason_type_id == '14')      X @endif
3. Consignacion @if($document->transfer_reason_type_id == '05')      X @endif
4. Devolucion @if($document->transfer_reason_type_id == '06')      X @endif
5. Traslado entre establecimientos de la misma empresa @if($document->transfer_reason_type_id == '04')   X @endif
Peso Bruto ({{ $document->unit_type_id }}) : {{ $document->total_weight }}
Numero de Bultos : {{ $document->packages_number }}




Representacion impresa de la {{ $document->document_type->description }}, esta puede ser consultada en
{!! url('/buscar') !!}
@if ($document->qr) @endif
{{-- @if ($document->observations)
OBSERVACIONES
{{ $document->observations }}
@endif @if ($document->reference_document) @if ($document->reference_document) @endif
{{ $document->reference_document->document_type->description }}
{{ $document->reference_document ? $document->reference_document->number_full : '' }}
@endif @if ($document->data_affected_document) @php $document_data_affected_document = $document->data_affected_document; $number = property_exists($document_data_affected_document, 'number') ? $document_data_affected_document->number : null; $Series = property_exists($document_data_affected_document, 'Series') ? $document_data_affected_document->series : null; $document_type_id = property_exists($document_data_affected_document, 'document_type_id') ? $document_data_affected_document->document_type_id : null; @endphp @if ($number !== null && $Series !== null && $document_type_id !== null) @php $documentType = App\Models\Tenant\Catalogs\DocumentType::find($document_type_id); $textDocumentType = $documentType->getDescription(); @endphp
{{ $textDocumentType }}
{{ $Series }}-{{ $number }}
@endif @endif @if ($document->reference_order_form_id) @if ($document->order_form) @endif
ORDEN DE PEDIDO
{{ $document->order_form ? $document->order_form->number_full : '' }}
@elseif ($document->order_form_external)
ORDEN DE PEDIDO
{{ $document->order_form_external }}
@endif @if ($document->reference_sale_note_id) @if ($document->sale_note) @endif
NOTA DE VENTA
{{ $document->sale_note ? $document->sale_note->number_full : '' }}
@endif @if ($document->qr)
@endif @if ($document->terms_condition)
Términos y condiciones del servicio
{!! $document->terms_condition !!}
@endif --}}