@php use App\Models\Tenant\Configuration; use App\Models\Tenant\Item; $establishment = $document->establishment; $customer = $document->customer; $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); $accounts = \App\Models\Tenant\BankAccount::where('show_in_documents', true)->get(); $template_data = \App\Models\Tenant\Establishment::where('code', '=', $establishment->code)->first(); //calculate items $allowed_items = 20; $quantity_items = $document->items()->count(); $cycle_items = $allowed_items - ($quantity_items * 3); $total_weight = 0; $count_=0; // dd($document->currency_type_id) $unitTypes = App\Models\Tenant\Catalogs\UnitType::all(); @endphp {{--{{ $document_number }}--}} {{----}} @if($document->state_type->id == '11')
anulado
@else @endif
@if($company->logo) logo}"))}};base64, {{base64_encode(file_get_contents(public_path("storage/uploads/logos/{$company->logo}")))}}" alt="{{$company->name}}" alt="{{ $company->name }}" class="" style="max-width: 300px; margin: 0px; padding: 0px;"> @endif {{--
@isset($establishment->aditional_information)
{{ ($establishment->aditional_information !== '-')? $establishment->aditional_information : '' }}
@endisset
--}}
{{ $company->name }}
{{ ($establishment->address !== '-')? $establishment->address : '' }} {{ ($establishment->district_id !== '-')? ', '.$establishment->district->description : '' }} {{ ($establishment->province_id !== '-')? ', '.$establishment->province->description : '' }} {{ ($establishment->department_id !== '-')? '- '.$establishment->department->description : '' }}
{{ ($establishment->telephone !== '-')? $establishment->telephone : '' }}
{{ ($establishment->email !== '-')? $establishment->email : '' }}
 DATOS DEL DESTINATARIO
 RAZÓN SOCIAL: {{ $customer->name }}
 Dirección: {{ $customer->address }} {{ ($customer->district_id !== '-')? ', '.$customer->district->description : '' }} {{ ($customer->province_id !== '-')? ', '.$customer->province->description : '' }} {{ ($customer->department_id !== '-')? '- '.$customer->department->description : '' }}
 R.U.C.: {{ $customer->number }}
@if ($document->reference_document)  N° {{$document->reference_document->document_type->description}}: @if($document->reference_document) {{ ($document->reference_document) ? $document->reference_document->number_full : "" }} @endif @endif
{{ 'R.U.C. '.$company->number }}
{{ $document->document_type->description }}
{{ $document_number }}
PUNTO DE PARTIDA PUNTO DE LLEGADA Fecha de Emisión: Fecha inicio del traslado
{{ $document->origin->address }} - {{ $document->origin->location_id }} {{ $document->delivery->address }} - {{ $document->delivery->location_id }} {{ $document->date_of_issue->format('Y-m-d') }} {{ $document->date_of_shipping->format('d/m/Y') }}
{{-- @if ($document->reference_document) @else @endif @if ($document->reference_document) @if ($document->reference_document->purchase_order) @else @endif @else @endif
DESTINATARIO
Razón Social: {{ $customer->name }}COMPROBANTE: {{$document->reference_document->document_type->description}} {{$document->reference_document->number_full}}
RUC: {{ $customer->number }}O. COMPRA: {{$document->reference_document->purchase_order}}
Dirección: {{ $customer->address }} {{ ($customer->district_id !== '-')? ', '.$customer->district->description : '' }} {{ ($customer->province_id !== '-')? ', '.$customer->province->description : '' }} {{ ($customer->department_id !== '-')? '- '.$customer->department->description : '' }}
--}} {{--
ENVIO
Fecha Emisión: {{ $document->date_of_issue->format('d/m/Y') }}

PUNTO DE PARTIDA

Fecha de Traslado: {{ $document->date_of_shipping->format('d/m/Y') }}
Motivo Traslado: {{ $document->transfer_reason_type->description }}

PUNTO DE LLEGADA

Modalidad de Transporte: {{ $document->transport_mode_type->description }}
--}} {{--
@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 === '02') @if($document->license_plate) @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° placa: {{ $document->license_plate }}DNI de conductor: {{ $document->driver->number }}
Número de placa semirremolque: {{ $document->secondary_license_plates->semitrailer }}Licencia del conductor: {{ $document->driver->license }}
@if($document->transport_mode_type_id === '01') @php $document_type_dispatcher = App\Models\Tenant\Catalogs\IdentityDocumentType::findOrFail($document->dispatcher->identity_document_type_id); @endphp
EMPRESA DE TRANSPORTE
Transportista: {{ $document->dispatcher->name }}
{{ $document_type_dispatcher->description }}: {{ $document->dispatcher->number }}
Dirección: {{ $document->driver->license }}
--}} @if ($document->reference_document) @php $items_data = $document->reference_document->items; @endphp @else @php $items_data = $document->items; @endphp @endif @foreach($items_data as $row) @php $total_weight_line = 0; // $doc_item = App\Models\Tenant\Item::findOrFail($row->item_id); // dd($document_type_dispatcher); // dd($row->relation_item->brand->name); $unitType = $unitTypes->where('id', $row->item->unit_type_id)->first(); $itemModel = Item::with('brand')->find($row->item_id); @endphp @endforeach @for($i = 0; $i < $cycle_items; $i++) @endfor
CANT. UND. DESCRIPCIÓN LABORATORIO LOTE F.VTO PESO
@if(((int)$row->quantity != $row->quantity)) {{ $row->quantity }} @else {{ number_format($row->quantity, 0) }} @endif @if($unitType) {{ $unitType->description }} @else {{ $row->item->unit_type_id }} @endif {!!$row->item->description!!} @if($row->relation_item->attributes) @foreach($row->relation_item->attributes as $attr) @if($attr->attribute_type_id === '5032') @php $total_weight += $attr->value * $row->quantity; $total_weight_line += $attr->value * $row->quantity; @endphp @endif
{!! $attr->description !!} : {{ $attr->value }} @endforeach @endif
@if($itemModel && $itemModel->brand) {{ $itemModel->brand->name }} @endif @inject('itemLotGroup', 'App\Services\ItemLotsGroupService') {{ $itemLotGroup->getItemLotGroupLineBreak($row->item->IdLoteSelected) }} @if($row->relation_item->date_of_due){{ $row->relation_item->date_of_due->format('Y-m-d') }} @endif {{ $total_weight_line }}
 
@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 === '02') @php // dd($document); @endphp @if($document->license_plate) @endif @if($document->driver->name) @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 @if($document->observations) @endif
UNIDAD DE TRANSPORTE Y CONDUCTOR
Razón social: {{ $document->dispatcher->name }}
{{ $document_type_dispatcher->description }}: {{ $document->dispatcher->number }}
N° placa: {{ $document->license_plate }}
Conductor: {{ $document->driver->name }}
DNI de conductor: {{ $document->driver->number }}
Número de placa semirremolque: {{ $document->secondary_license_plates->semitrailer }}Licencia conducir: {{ $document->driver->license }}
 
 
OBSERVACIONES:
{{ $document->observations }}
 
 
MOTIVO DEL TRASLADO
@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 @else   @endif
1. Venta 8. Recojo de bienes transformados
2. Venta Sujera a Confirmación del comprador 9. Traslado por emisor itinerante de CP
3. Compra 10. Traslado zona primaria
4. Consignación 11. Importación
5. Devolución 12. Exportación
6. Traslado entre establecimientos Otros
7. Traslado de bienes para transformación 13. Otros___________________

_____________________________
RECIBÍ CONFORME
_____________________________
Vº Bº
{{--
OBSERVACIONES:
{{ $document->observations }}
Representación impresa de la Guía de Remisión
--}} @if($document->qr)
@endif @if($document != null) @foreach($accounts as $account) @endforeach
Banco Moneda Código de Cuenta Interbancaria Código de Cuenta
{{$account->bank->description}} {{$account->currency_type->description}} @if($account->cci) {{$account->cci}} @endif {{$account->number}}
@endif