@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); // $document_type_dispatcher = App\Models\Tenant\Catalogs\IdentityDocumentType::findOrFail($document->dispatcher->identity_document_type_id); //calculate items $allowed_items = 20; $quantity_items = $document->items()->count(); $cycle_items = $allowed_items - ($quantity_items * 3); $total_weight = 0; $item_=0; $template_data = \App\Models\Tenant\Establishment::where('code', '=', $establishment->code)->first(); @endphp {{--DE: {{ $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
R.U.C. {{$company->number }} {{--
--}}
{{ $document->document_type->description }}
{{--
--}} {{ $document_number }}
INFORMACIÓN DEL DESTINATARIO:
Cliente:
: {{ $customer->name }}
Dirección
: {{ $customer->address }} {{ ($customer->district_id !== '-')? '- '.strtoupper($customer->district->description) : '' }} {{ ($customer->province_id !== '-')? '- '.strtoupper($customer->province->description) : '' }} {{ ($customer->department_id !== '-')? '- '.strtoupper($customer->department->description) : '' }}
R.U.C.
: {{ $customer->number }}
DATOS DEL TRASLADO:
Fecha de emisión
: {{ $document->date_of_issue->format('Y-m-d') }}
FECHA INICIO TRASLADO:
: {{ $document->date_of_shipping->format('Y-m-d') }}
MOT. TRASLADO:
: {{ $document->transfer_reason_type->description }}
MOD. DE TRANSPORTE:
: {{ $document->transport_mode_type->description }}
PESO BRUTO TOTAL:({{ $document->unit_type_id }})
: {{ $document->total_weight }}
# DE BULTOS
: @if($document->packages_number) {{ $document->packages_number }} @endif
@php $district = \App\Models\Tenant\Catalogs\District::find($document->origin->location_id); $district_llegada = \App\Models\Tenant\Catalogs\District::find($document->delivery->location_id); @endphp
PUNTO DE PARTIDA
: {{ $document->origin->location_id }} - {{ $document->origin->address }} - {{ strtoupper($district->description) }} - {{ strtoupper($district->province->description) }} - {{ strtoupper($district->province->department->description) }}
PUNTO DE LLEGADA
: {{ $document->delivery->location_id }} - {{ $document->delivery->address }} - {{ strtoupper($district_llegada->description) }} - {{ strtoupper($district_llegada->province->description) }} - {{ strtoupper($district_llegada->province->department->description) }}
DATOS DEL TRANSPORTISTA:
@if($document->transport_mode_type_id === '01') @php $document_type_dispatcher = App\Models\Tenant\Catalogs\IdentityDocumentType::findOrFail($document->dispatcher->identity_document_type_id); @endphp
RAZÓN SOCIAL:
: {{ $document_type_dispatcher->description }}
RUC
: {{ $document->dispatcher->number }}
{{-- Nombre y/o razón social: {{ $document->dispatcher->name }} {{ $document_type_dispatcher->description }}: {{ $document->dispatcher->number }} --}} @else
PLACA DEL VEHICULO:
: @if($document->transport_data) {{ $document->transport_data['plate_number'] }} @endif
CONDUCTOR
: @if($document->driver->number) {{ $document->driver->number }} @endif
LICENCIA DEL CONDUCTOR
: @if($document->driver->license) {{ $document->driver->license }} @endif
@if($document->secondary_license_plates) @if($document->secondary_license_plates->semitrailer)
PLACA SEMIREMOLQUE
: {{ $document->secondary_license_plates->semitrailer }}
@endif @endif @endif
@foreach($document->items as $row) @php $item_++; @endphp @endforeach @for($i = 0; $i < $cycle_items; $i++) @endfor
I T E M C Ó D I G O D E S C R I P C I Ó N U. M. C A N T.
{{ $item_ }} {{ $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 --}}
{{ symbol_or_code($row->item->unit_type_id) }} @if(((int)$row->quantity != $row->quantity)) {{ $row->quantity }} @else {{ number_format($row->quantity, 0) }} @endif
 
 
TOTAL {{ number_format($document->total, 2) }}
@if($document->observations)
OBSERVACIONES
{{ $document->observations }}
@endif @if ($document->reference_document) @if($document->reference_document) @endif
COMPROBANTE DE PAGO RELACIONADO A LA GUIA DE REMISIÓN REMItemTE:
{{ ($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 : "" }}
@endif @if ($document->reference_sale_note_id) @if($document->sale_note) @endif
NOTA DE VENTA
{{ ($document->sale_note) ? $document->sale_note->number_full : "" }}
@endif

Representación Impresa del COMPROBANTE ELECTRONICO, generado desde el Sistema del Contribuyente.