@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; } $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'); $logo = "storage/uploads/logos/{$company->logo}"; if($establishment->logo) { $logo = "{$establishment->logo}"; } $configuration_decimal_quantity = App\CoreFacturalo\Helpers\Template\TemplateHelper::getConfigurationDecimalQuantity(); $paymentCondition = \App\CoreFacturalo\Helpers\Template\TemplateHelper::getDocumentPaymentCondition($document); //calculate items $allowed_items = 24; $quantity_items = $document->items()->count(); $cycle_items = $allowed_items - ($quantity_items); $total_weight = 0; @endphp @if($document->state_type->id == '11')
anulado
@endif
@if ($establishment->logo ?? false)
{{$company->name}}
@else @if($company->logo)
logo}") }}" alt="{{$company->name}}" class="" style="width:100%; max-height: 100px">
@else @endif @endif {{--
{{ $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->web_address !== '-')? ''.$establishment->web_address : '' }}
@isset($establishment->aditional_information)
{{ ($establishment->aditional_information !== '-')? $establishment->aditional_information : '' }}
@endisset
RUC {{$company->number }}
{{ $document->document_type->description }}
Nº {{ $document_number }}
SEÑOR(ES):
{{ $customer->name }}
{{ $customer->identity_document_type->description }}:
{{ $customer->number }}
DIRECCIÓN:
{{ $customer->address }}  
{{$document->quotations_optional}}
{{$document->quotations_optional_value}}
FECHA EMISIÓN
{{$document->date_of_issue->format('Y-m-d')}}
CONDICIÓN DE PAGO
{{ $paymentCondition }}  
FECHA VENCIMIENTO
@if($invoice) {{$invoice->date_of_due->format('Y-m-d')}} @endif
Nº DE ORDEN
@if ($document->purchase_order) {{ $document->purchase_order }} @endif  
Nº DE PEDIDO
  @if ($document->reference_order_form_id) @if($document->order_form) {{ ($document->order_form) ? $document->order_form->number_full : "" }} @endif @elseif ($document->order_form_external) {{ $document->order_form_external }} @endif
Nº GUIA DE REMISIÓN
@if ($document->guides) @foreach($document->guides as $guide) {{ $guide->number }} @endforeach @endif @if (sizeof($document->reference_guides)) @foreach($document->reference_guides as $guide) {{ $guide->series.'-'. $guide->number }} @endforeach @endif
CÓDIGO DE
ARTÍCULO
Cantidad
DESCRIPCIÓN
UNIDAD
DE VENTA
VALOR
UNITARIO
VALOR DE
VENTA
@foreach($document->items as $row)
{{ $row->item->internal_id }}  
@if(((int)$row->quantity != $row->quantity)) {{ $row->quantity }} @else {{ number_format($row->quantity, 0) }} @endif
@if($row->name_product_pdf) {!!strip_tags($row->name_product_pdf)!!} @else {!!strip_tags($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)
{{ $dtos->factor * 100 }}% {{$dtos->description }} @endforeach @endif @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
{{ symbol_or_code($row->item->unit_type_id) }}
{{ number_format($row->unit_price, 2) }}
{{ number_format($row->total, 2) }}
@endforeach @for($i = 0; $i < $cycle_items; $i++)
 
 
 
 
 
 
@endfor
@foreach(array_reverse( (array) $document->legends) as $row) @if ($row->code == "1000") SON: {{ $row->value }} {{ $document->currency_type->description }}
@endif @endforeach
@foreach($document->additional_information as $information) @if ($information) OBSERVACIONES: @if ($loop->first) @endif
@if(\App\CoreFacturalo\Helpers\Template\TemplateHelper::canShowNewLineOnObservation()) {!! \App\CoreFacturalo\Helpers\Template\TemplateHelper::SetHtmlTag($information) !!} @else {{$information}} @endif
@endif @endforeach @foreach(array_reverse( (array) $document->legends) as $row) @if ($row->code == "1000")
@if (count((array) $document->legends)>1) Leyenda @endif @else {{$row->code}}: {{ $row->value }} @inject('detractionType', 'App\Services\DetractionTypeService')
Bien o servicio: {{ $document->detraction->detraction_type_id }} - {{ $detractionType->getDetractionTypeDescription($document->detraction->detraction_type_id) }}
Medio de pago: {{ $detractionType->getPaymentMethodTypeDescription($document->detraction->payment_method_id) }}
Porcentaje de detracción: {{ $document->detraction->percentage }}%
Monto detracción: @php $amount_detraction = $document->detraction->amount; // if($document->currency_type_id != "PEN"){ // $exchange_rate_sale = $document->exchange_rate_sale; // $amount_detraction = $amount_detraction * $exchange_rate_sale; // $amount_detraction = number_format($amount_detraction, 2, ".", ""); // } @endphp S/ {{ $amount_detraction }}
Nro. Cta Banco de la Nación: {{ $document->detraction->bank_account }}
@endif @endforeach
Total Ope. Gravadas
{{ $document->currency_type->symbol }}
{{ number_format($document->total_taxed, 2) }}
Total Ope. Inafectas
{{ $document->currency_type->symbol }}
{{ number_format($document->total_unaffected, 2) }}
Total Ope. Exoneradas
{{ $document->currency_type->symbol }}
{{ number_format($document->total_exonerated, 2) }}
Total Descuentos
{{ $document->currency_type->symbol }}
{{ number_format($document->total_discount, 2) }}
Total IGV 18%
{{ $document->currency_type->symbol }}
{{ number_format($document->total_igv, 2) }}
Total ISC
{{ $document->currency_type->symbol }}
  @if($document->total_isc > 0) {{ number_format($document->total_isc, 2) }} @else 0.00 @endif
TOTAL A PAGAR
{{ $document->currency_type->symbol }}
@if ($document->retention) {{ number_format($document->total-$document->retention->amount, 2) }} @else {{ number_format($document->total, 2) }} @endif
@if(in_array($document->document_type->id,['01','03'])) @if(count($accounts)>0) @foreach($accounts as $account)
{{$account->bank->description}}
Cuenta: {{$account->currency_type->description}}
Cuenta Nº: {{$account->number}}
@if($account->cci)
CCI Nº: {{$account->cci}}
@endif @endforeach @endif @endif
 
{{ $document->hash }}
Representación impresa de la {{ $document->document_type->description }}. Esta puede ser consultada en: {!! url('/buscar') !!}

@if($document->payment_method_type_id)
MÉTODO DE PAGO: {{ $document->payment_method_type->description }}
@endif @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