@php /** @var \App\Models\Tenant\Document $document */ $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); } $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; } $customer = $document->customer; //$path_style = app_path('CoreFacturalo'.DIRECTORY_SEPARATOR.'Templates'.DIRECTORY_SEPARATOR.'pdf'.DIRECTORY_SEPARATOR.'style.css'); $accounts = \App\Models\Tenant\BankAccount::all(); $tittle = $document->prefix . '-' . str_pad($document->id, 8, '0', STR_PAD_LEFT); @endphp {{-- {{ $tittle }} --}} {{-- --}} @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: 150px;">
{{-- --}}

{{ $company_name }}

@if ($company_owner) De: {{ $company_owner }} @endif
{{ '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 : '' }}
@isset($establishment->trade_address)
{{ $establishment->trade_address !== '-' ? 'D. Comercial: ' . $establishment->trade_address : '' }}
@endisset
{{ $establishment->telephone !== '-' ? 'Central telefónica: ' . $establishment->telephone : '' }}
{{ $establishment->email !== '-' ? : ' . $establishment->email : '' }}
@isset($establishment->web_address)
{{ $establishment->web_address !== '-' ? 'Web: ' . $establishment->web_address : '' }}
@endisset @isset($establishment->aditional_information)
{{ $establishment->aditional_information !== '-' ? $establishment->aditional_information : '' }}
@endisset
{{ get_document_name('orden_note', 'PEDIDO') }}

{{ $tittle }}

@if ($document->date_of_due) @endif @if ($customer->address !== '') @if ($document->delivery_date) @endif @endif @if ($document->shipping_address) @endif @if ($customer->telephone) @endif @if ($document->payment_method_type) @endif
Cliente: {{ $customer->name }} Fecha de emisión: {{ $document->date_of_issue->format('Y-m-d') }}
{{ $customer->identity_document_type->description }}: {{ $customer->number }}Fecha de vencimiento: {{ $document->date_of_due->format('Y-m-d') }}
Dirección: {{ $customer->address }} {{ $customer->district_id !== '-' ? ', ' . $customer->district->description : '' }} {{ $customer->province_id !== '-' ? ', ' . $customer->province->description : '' }} {{ $customer->department_id !== '-' ? '- ' . $customer->department->description : '' }} Fecha de entrega: {{ $document->delivery_date->format('Y-m-d') }}
Dir. Envío: {{ $document->shipping_address }}
Teléfono: {{ $customer->telephone }}
T. Pago: {{ $document->payment_method_type->description }}
Vendedor: {{ $document->user->name }}
@if ($document->additional_data) @foreach ($document->additional_data as $row) @endforeach
{{ $row->title }}: {{ $row->description }}
@endif @if ($document->observation) @endif
Observación: {{ $document->observation }}
@if ($document->guides)
{{-- Guías: --}} @foreach ($document->guides as $guide) @if (isset($guide->document_type_description)) @else @endif @endforeach
{{ $guide->document_type_description }}{{ $guide->document_type_id }}: {{ $guide->number }}
@endif @foreach ($document->items as $row) @php /** @var \Modules\Order\Models\OrderNoteItem $row */ $row = $row; $item = $row->item; @endphp @endforeach @if ($document->total_exportation > 0) @endif @if ($document->total_free > 0) @endif @if ($document->total_unaffected > 0) @endif @if ($document->total_exonerated > 0) @endif @if ($document->total_taxed > 0) @endif @if ($document->total_discount > 0) @endif
Cant. Unidad Código Descripción P.Unit Dto. Total
{{ $row->getStringQty() }} {{ $item->unit_type_id }} {{ $row->relation_item->internal_id }} {!! $row->getTemplateDescription() !!} @if (!empty($item->presentation)) {!! $item->presentation->description !!} @endif @if ($row->attributes) @foreach ($row->attributes as $attr)
{!! $attr->description !!} : {{ $attr->value }} @endforeach @endif @if ($row->discounts && !$configurations->discounts_acc) @foreach ($row->discounts as $dtos)
{{ $dtos->factor * 100 }}% {{ $dtos->description }} @endforeach @endif {{ $row->getSaleLotGroupCodeDescription() }}
{{ $row->getStringUnitPrice() }} @if ($configurations->discounts_acc) @if ($row->discounts_acc) @php $discounts_acc = (array) $row->discounts_acc; @endphp @foreach ($discounts_acc as $key => $disto) {{ $disto->percentage }}% @if ($key + 1 != count($discounts_acc)) + @endif @endforeach @endif @else @if ($row->discounts) @php $total_discount_line = 0; foreach ($row->discounts as $disto) { $amount = $disto->amount; if (isset($disto->is_split)) { $amount = $amount * 1.18; } $total_discount_line = $total_discount_line + $amount; // $total_discount_items += $total_discount_line; } @endphp {{ number_format($total_discount_line, 2) }} @else 0 @endif @endif {{ $row->getStringTotal() }}
Op. Exportación: {{ $document->currency_type->symbol }} {{ number_format($document->total_exportation, 2) }}
Op. Gratuitas: {{ $document->currency_type->symbol }} {{ number_format($document->total_free, 2) }}
Op. Inafectas: {{ $document->currency_type->symbol }} {{ number_format($document->total_unaffected, 2) }}
Op. Exoneradas: {{ $document->currency_type->symbol }} {{ number_format($document->total_exonerated, 2) }}
Op. Gravadas: {{ $document->currency_type->symbol }} {{ number_format($document->total_taxed, 2) }}
Descuento TOTAL: {{ $document->currency_type->symbol }} {{ number_format($document->total_discount, 2) }}
IGV: {{ $document->currency_type->symbol }} {{ number_format($document->total_igv, 2) }}
Total a pagar: {{ $document->currency_type->symbol }} {{ number_format($document->total, 2) }}
{{-- --}}

@foreach ($accounts as $account)

{{ $account->bank->description }} {{ $account->currency_type->description }} N°: {{ $account->number }} @if ($account->cci) - CCI: {{ $account->cci }} @endif

@endforeach
@foreach ($document->legends as $row)

Son: {{ $row->value }} {{ $document->currency_type->description }}

@endforeach
Información adicional @foreach ($document->additional_information as $information)

@if (\App\CoreFacturalo\Helpers\Template\TemplateHelper::canShowNewLineOnObservation()) {!! \App\CoreFacturalo\Helpers\Template\TemplateHelper::SetHtmlTag($information) !!} @else {{$information}} @endif

@endforeach
@foreach ($document->fee as $key => $quote) @endforeach
• {{ 'Cuota #' . ($key + 1) }} / Fecha: {{ $quote->date }} / Monto: {{ $quote->currency_type->symbol }}{{ $quote->amount }}