@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); $configuration_decimal_quantity = App\CoreFacturalo\Helpers\Template\TemplateHelper::getConfigurationDecimalQuantity(); $total_discount_items = 0; @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) @else @endif @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
Descripción Cant. Unidad P.Unit Dscto P.Neto P.Venta
@if ($row->name_product_pdf) {!! $row->name_product_pdf !!} @else {!! $row->item->description !!} @endif @if ($row->total_isc > 0)
ISC : {{ $row->total_isc }} ({{ $row->percentage_isc }}%) @endif @if ($row->total_plastic_bag_taxes > 0)
ICBPER : {{ $row->total_plastic_bag_taxes }} @endif @if ($row->attributes) @foreach ($row->attributes as $attr)
{!! $attr->description !!} : {{ $attr->value }} @endforeach @endif @if ($row->discounts) @foreach ($row->discounts as $dtos) @if ($dtos->is_amount == false)
{{ $dtos->factor * 100 }} {{ $dtos->description }} @endif @endforeach @endif @isset($row->item->sizes_selected) @if (count($row->item->sizes_selected) > 0) @foreach ($row->item->sizes_selected as $size) Característica {{ $size->size }} | {{ $size->qty }} und.
@endforeach @endif @endisset @if ($row->charges) @foreach ($row->charges as $charge)
{{ $document->currency_type->symbol }} {{ $charge->amount }} ({{ $charge->factor * 100 }}%) {{ $charge->description }} @endforeach @endif @if ($row->item->is_set == 1)
@inject('itemSet', 'App\Services\ItemSetService') @foreach ($itemSet->getItemsSet($row->item_id) as $item) {{ $item }}
@endforeach @endif @if ($row->item->used_points_for_exchange ?? false)
*** Canjeado por {{ $row->item->used_points_for_exchange }} puntos *** @endif @if ($document->has_prepayment)
*** Pago Anticipado *** @endif
@if ((int) $row->quantity != $row->quantity) {{ $row->quantity }} @else {{ number_format($row->quantity, 0) }} @endif {{ symbol_or_code($row->item->unit_type_id) }} @if ($configurations->discounts_acc && $row->discounts_acc) @php $original_price = 0; // $base = $row->discounts_acc; foreach ($row->discounts_acc as $key => $disto) { $original_price = $disto->original_price ?? 0; } @endphp {{ number_format($original_price, 2) }} @else @php $discounts = $row->discounts; $total = 0; foreach ($discounts as $disto) { if($disto->discount_type_id == "00"){ $total += $disto->base * 1.18; }else{ $total += $disto->base; } } @endphp {{ number_format($total, 2) }} @endif
@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 @else @if ($row->discounts) @foreach ($row->discounts as $key=>$disto) {{ round($disto->factor * 100) }} @endforeach @else 0 @endif @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 @if ($configuration_decimal_quantity->change_decimal_quantity_unit_price_pdf) {{ $row->generalApplyNumberFormat($row->unit_price, $configuration_decimal_quantity->decimal_quantity_unit_price_pdf) }} {{ number_format($row->unit_price, 2) }} {{ number_format($row->unit_price * $row->quantity, 2) }}
@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
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) }}
IGV: {{ $document->currency_type->symbol }} {{ number_format($document->total_igv, 2) }}
Total a pagar: {{ $document->currency_type->symbol }} {{ number_format($document->total, 2) }}
@foreach ($document->fee as $key => $quote) @endforeach
• {{ 'Cuota #' . ($key + 1) }} / Fecha: {{ $quote->date }} / Monto: {{ $quote->currency_type->symbol }}{{ $quote->amount }}