@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(); $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; } $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(); $cont_ = 0; //calculate items $allowed_items = 45 - (\App\Models\Tenant\BankAccount::all()->count())*3; $quantity_items = $document->items()->count(); $cycle_items = $allowed_items - ($quantity_items * 3); $total_weight = 0; @endphp {{--{{ $document_number }}--}} {{----}} @if($document->state_type->id == '11' || $document->state_type->id == '09')
anulado
@endif
{{ $company_name }}
@if ($company_owner) De: {{ $company_owner }} @endif @isset($establishment->trade_address)
{{ ($establishment->trade_address !== '-')? 'D. Comercial: '.$establishment->trade_address : '' }}
@endisset
{{ ($establishment->address !== '-')? $establishment->address.',' : '' }} {{ ($establishment->district_id !== '-')? $establishment->district->description : '' }} {{ ($establishment->province_id !== '-')? ', '.$establishment->province->description : '' }} {{ ($establishment->department_id !== '-')? '- '.$establishment->department->description : '' }}
{{ ($establishment->telephone !== '-')? 'Telf. '.$establishment->telephone : '' }}
{{ ($establishment->email !== '-')? : '.$establishment->email : '' }}
{{ ($establishment->web_address !== '-')? ''.$establishment->web_address : '' }}
@isset($establishment->aditional_information)
E-mail: {{ ($establishment->aditional_information !== '-')? $establishment->aditional_information : '' }}
@endisset
RUC {{$company->number }}
{{ $document->document_type->description }}
Nº {{ $document_number }}
Fecha de emisión
: {{$document->date_of_issue->format('Y-m-d')}}
FECHA DE VCTO.
: @if($invoice) {{$invoice->date_of_due->format('Y-m-d')}} @endif
Cliente
: {{ $customer->name }}
GUÍA 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  
Dirección
: @if ($customer->address !== '') {{ $customer->address }} @endif
Orden de compra
: @if ($document->purchase_order) {{ $document->purchase_order }} @endif  
 
@if ($customer->address !== '') {{ ($customer->district_id !== '-')? ''.$customer->district->description : '' }} {{ ($customer->province_id !== '-')? ', '.$customer->province->description : '' }} {{ ($customer->department_id !== '-')? '- '.$customer->department->description : '' }} @endif
Moneda
: {{ $document->currency_type->description }}
{{ $customer->identity_document_type->description }}
: {{ $customer->number }}
Vendedor
: @if ($document->seller) {{ $document->seller->name }} @else {{ $document->user->name }} @endif
COND. PAGO
: @php if($document->payment_condition_id === '01') { $paymentCondition = \App\Models\Tenant\PaymentMethodType::where('id', '10')->first(); }else{ $paymentCondition = \App\Models\Tenant\PaymentMethodType::where('id', '09')->first(); } @endphp {{ $paymentCondition->description }}
@foreach($document->items as $row) @php $cont_++; // dd($row); @endphp @endforeach @for($i = 0; $i < $cycle_items; $i++) @endfor
Item Cant. U.M Descripción Precio
unitario
Valor
unitario
Dscto Valor
venta
{{$cont_}} @if(((int)$row->quantity != $row->quantity)) {{ $row->quantity }} @else {{ number_format($row->quantity, 0) }} @endif {{ symbol_or_code($row->item->unit_type_id) }} @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)
{{ $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
{{ number_format($row->unit_price, 2) }} {{ number_format($row->unit_value, 2) }} @if($row->discounts) @php $total_discount_line = 0; foreach ($row->discounts as $disto) { $total_discount_line = $total_discount_line + $disto->amount; } @endphp {{ number_format($total_discount_line, 2) }} @else 0 @endif {{ 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
{{ $document->hash }}
@if(in_array($document->document_type->id,['01','03']))
Cuentas Bancarias:
@foreach($accounts as $account)
{{$account->bank->description}} {{$account->currency_type->description}}
{{$account->number}} @if($account->cci)
CCI: {{$account->cci}} @endif
@endforeach @endif @php $paymentCondition = \App\CoreFacturalo\Helpers\Template\TemplateHelper::getDocumentPaymentCondition($document); @endphp {{-- Condicion de pago Crédito / Contado --}} @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() }} / {{ $quote->date->format('d-m-Y') }} / Monto: {{ $quote->currency_type->symbol }}{{ $quote->amount }}
@endif
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 }}
@if($document->total_discount > 0) {{ number_format($document->total_discount, 2) }} @else 0.00 @endif
Total Ope. Gratuitas
{{ $document->currency_type->symbol }}
{{ number_format($document->total_free, 2) }}
Total IGV 18%
{{ $document->currency_type->symbol }}
{{ number_format($document->total_igv, 2) }}
IMPORTE TOTAL
{{ $document->currency_type->symbol }}
@if ($document->retention) {{ number_format($document->total-$document->retention->amount, 2) }} @else {{ number_format($document->total, 2) }} @endif
Representación impresa del Comprobante de Pago Electrónico. Esta puede ser consultada en: {!! url('/buscar') !!}