@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); } $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; $invoice = $document->invoice; $document_base = $document->note ? $document->note : null; //$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); $accounts = \App\Models\Tenant\BankAccount::where('show_in_documents', true)->get(); if ($document_base) { $affected_document_number = $document_base->affected_document ? $document_base->affected_document->series. '-' . str_pad($document_base->affected_document->number, 8, '0', STR_PAD_LEFT) : $document_base->data_affected_document->series. '-' . str_pad($document_base->data_affected_document->number, 8, '0', STR_PAD_LEFT); } else { $affected_document_number = null; } $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; } $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; } $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; } $payments = $document->payments; $company_name = $company->name; $company_owner = null; if ($configurations->trade_name_pdf) { $company_name = $company->trade_name; $company_owner = $company->name; } $company_name = $company->name; $company_owner = null; if ($configurations->trade_name_pdf) { $company_name = $company->trade_name; $company_owner = $company->name; } $document->load('reference_guides'); $total_payment = $document->payments->sum('payment'); $balance = $document->total - $total_payment - $document->payments->sum('change'); $bg = "storage/uploads/header_images/{$configurations->background_image}"; $total_discount_items = 0; $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_decimal_quantity = App\CoreFacturalo\Helpers\Template\TemplateHelper::getConfigurationDecimalQuantity(); $paymentCondition = \App\CoreFacturalo\Helpers\Template\TemplateHelper::getDocumentPaymentCondition($document); @endphp {{-- {{ $document_number }} --}} {{-- --}} @if($document->state_type->id == '11' || $document->state_type->id == '09')
anulado
@endif @if ($document->soap_type_id == '01')
anulado
@endif @if ($configurations->background_image)
anulado
@endif
@php $header_img = $configurations->header_image; @endphp @if($header_img) {{-- --}} {{$company->name}} @else
.
@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 }}
SEÑORES : {{ $customer->name }}
N.COMERCIAL : {{ $customer->trade_name }} TIPO PAGO : {{ $paymentCondition }}
DIRECCION : {{ $customer->address }} {{ $customer->district_id !== '-' ? ', ' . $customer->district->description : '' }} {{ $customer->province_id !== '-' ? ', ' . $customer->province->description : '' }} {{ $customer->department_id !== '-' ? '- ' . $customer->department->description : '' }}
{{ $customer->identity_document_type->description }} : {{ $customer->number }} VENDEDOR : @if ($document->seller) {{ $document->seller->name }} @else {{ $document->user->name }} @endif
FEC.EMISION : {{ $document->date_of_issue->format('d/m/Y') }} Moneda : {{ $document->currency_type->description }}
GUIA REMISION: @if ($document->guides) @foreach ($document->guides as $guide) {{ $guide->number }} @endforeach @endif @if ($document->dispatch) {{ $document->dispatch->number_full }} @elseif ($document->reference_guides) @if (count($document->reference_guides) > 0) @foreach ($document->reference_guides as $guide) {{ $guide->series }}-{{ $guide->number }} @endforeach @endif @endif NRO.ORDEN DE COMPRA: @if ($document->purchase_order) {{ $document->purchase_order }} @endif
@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 @if ($configuration_decimal_quantity->change_decimal_quantity_unit_price_pdf) @else @endif @endforeach
CÓDIGO CANT. DESCRIPCION U.M. P.UNIT. IMPORTE
{{ $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->total_isc > 0)
ISC : {{ $row->total_isc }} ({{ $row->percentage_isc }}%) @endif @if (!empty($row->item->presentation)) {!! $row->item->presentation->description !!} @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
@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) }} {{ $row->generalApplyNumberFormat($row->unit_price, $configuration_decimal_quantity->decimal_quantity_unit_price_pdf) }} {{ number_format($row->unit_price, 2) }}{{ number_format($row->total, 2) }}
@foreach (array_reverse((array) $document->legends) as $row) @if ($row->code == '1000')

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

@if (count((array) $document->legends) > 1)

Leyendas

@endif @else

{{ $row->code }}: {{ $row->value }}

@endif @endforeach
@if ($document->payment_condition_id === '01') @if($payments->count()) @php $payment = 0; @endphp @foreach($payments as $row) @endforeach
Pagos:
• {{ $row->payment_method_type->description }} - {{ $row->reference ? $row->reference.' - ':'' }} {{ $document->currency_type->symbol }} {{ $row->payment + $row->change }}
@endif @else @foreach($document->fee as $key => $quote) @endforeach
• {{ (empty($quote->getStringPaymentMethodType()) ? 'Cuota #'.( $key + 1) : $quote->getStringPaymentMethodType()) }} / Fecha: {{ $quote->date->format('d-m-Y') }} / Monto: {{ $quote->currency_type->symbol }}{{ $quote->amount }}
@endif
@if($document->retention) @endif
Sub total {{ $document->currency_type->symbol }} {{ number_format($document->subtotal, 2) }}
Otros Cargos {{ $document->currency_type->symbol }} {{ number_format($document->total_charge, 2) }}
Descuento Total {{ $document->currency_type->symbol }} @php $total_discount = $document->total_discount; $discounts = $document->discounts; if($discounts){ $discounts = get_object_vars($document->discounts); isset($discounts[0]) ? $discounts[0] : null; $is_split = $discount->is_split; if($is_split){ $total_discount = $total_discount * 1.18; } }else{ $total_discount = $total_discount_items; } @endphp {{ number_format($total_discount, 2) }}
Operaciones Gravada {{ $document->currency_type->symbol }} {{ number_format($document->total_taxed, 2) }}
Operaciones Exonerada {{ $document->currency_type->symbol }} {{ number_format($document->total_exonerated, 2) }}
I.G.V. 18.00% {{ $document->currency_type->symbol }} {{ number_format($document->total_igv, 2) }}
IMPORTE TOTAL {{ $document->currency_type->symbol }} {{ number_format($document->total, 2) }}
TOTAL RETENCIÓN ({{ $document->retention->percentage * 100 }} %) {{ $document->currency_type->symbol }} {{ number_format($document->retention->amount, 2) }}
IMPORTE NETO: {{ $document->currency_type->symbol }} {{ number_format($document->total - $document->retention->amount, 2) }}
@if ($document->retention)
Información de la retención:
Base imponible de la retención: S/ {{ round($document->retention->amount_pen / $document->retention->percentage, 2) }}
Porcentaje de la retención {{ $document->retention->percentage * 100 }}%
Monto de la retención S/ {{ $document->retention->amount_pen }}
@endif @php $path_style = app_path('CoreFacturalo' . DIRECTORY_SEPARATOR . 'Templates' . DIRECTORY_SEPARATOR . 'pdf' . DIRECTORY_SEPARATOR . 'style.css'); $accounts = \App\Models\Tenant\BankAccount::where('show_in_documents', true)->get(); @endphp @if($document) @if (in_array($document->document_type->id, ['01', '03'])) @foreach ($accounts as $account) @endforeach @endif
CUENTAS:
{{ $account->bank->description }}:{{ $account->number }} @if ($account->cci) CCI: {{ $account->cci }} @endif - {{ $account->currency_type->description }}
Representacion impresa de la {{ $document->document_type->description }}, esta puede ser consultada en {!! url('/buscar') !!}
@endif