@php $establishment = $document->establishment; $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); } $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; } $payments = $document->payments; $document->load('reference_guides'); $total_payment = $document->payments->sum('payment'); $balance = ($document->total - $total_payment) - $document->payments->sum('change'); //calculate items $allowed_items = 20; $quantity_items = $document->items()->count(); $cycle_items = $allowed_items - ($quantity_items * 3); $total_weight = 0; $item_=0; $paymentCondition = \App\CoreFacturalo\Helpers\Template\TemplateHelper::getDocumentPaymentCondition($document); $template_data = \App\Models\Tenant\Establishment::where('code', '=', $establishment->code)->first(); @endphp {{--{{ $document_number }}--}} {{----}} @if($document->state_type->id == '11')
anulado
@endif
{{$company->name}}
R.U.C. {{$company->number }} {{--
--}}
{{ $document->document_type->description }}
{{--
--}} Nº {{ $document_number }}
Cliente
: {{ $customer->name }}
Dirección
: {{ strtoupper($customer->address) }} {{ ($customer->district_id !== '-')? '- '.strtoupper($customer->district->description) : '' }} {{ ($customer->province_id !== '-')? '- '.strtoupper($customer->province->description) : '' }} {{ ($customer->department_id !== '-')? '- '.strtoupper($customer->department->description) : '' }}
{{ $customer->identity_document_type->description }}
: {{$customer->number}}
FORMA DE PAGO
: @foreach($payments as $row) {{ $row->payment_method_type->description }} @endforeach
Fecha de emisión
: {{$document->date_of_issue->format('Y-m-d')}}
FECHA DE VENC.
: @if($invoice) {{$invoice->date_of_due->format('Y-m-d')}} @endif
G. R. R.
: @if ($document->guides) @foreach($document->guides as $guide) {{ $guide->number }} @endforeach @endif @if ($document->reference_guides) @foreach($document->reference_guides as $guide) {{ $guide->number }} @endforeach @endif
G. R. T.
:
MONEDA
: {{ $document->currency_type->description }}
Vendedor
: @if ($document->seller) {{ $document->seller->name }} @else {{ $document->user->name }} @endif
Orden de compra
: @if ($document->purchase_order) {{ $document->purchase_order }} @endif
OTROS
: @if($document->additional_information) @foreach($document->additional_information as $information) @if ($information) {{ $information }} @endif @endforeach @endif
OBSERVACIÓN: @if ($document->detraction) Operación Sujeta a Detracción @inject('detractionType', 'App\Services\DetractionTypeService') {{$document->detraction->detraction_type_id}} - {{ $detractionType->getDetractionTypeDescription($document->detraction->detraction_type_id ) }} {{ $document->detraction->percentage}}% - - BANCO DE LA NACIÓN CTA. DETRACCIÓN N° {{ $document->detraction->bank_account}} - Importe S/ {{ $document->detraction->amount}} @endif
{{--
--}} @foreach($document->items as $row) @php $item_++; @endphp @endforeach @for($i = 0; $i < $cycle_items; $i++) @endfor
ITEM Código Cant. U.M. Descripción P.U Importe
{{ $item_ }} {{ $row->item->internal_id }} @if(((int)$row->quantity != $row->quantity)) {{ $row->quantity }} @else {{ number_format($row->quantity, 0) }} @endif {{ $row->item->unit_type_id }} @if($row->name_product_pdf) {!!$row->name_product_pdf!!} @else {!!$row->item->description!!} @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->item->is_set == 1)
@inject('itemSet', 'App\Services\ItemSetService') {{join( "-", $itemSet->getItemsSet($row->item_id) )}} @endif
{{ number_format($row->unit_price, 2) }} {{ number_format($row->total, 2) }}
 
{{--
--}} @foreach(array_reverse( (array) $document->legends) as $row) @if ($row->code == "1000") SÓN: {{ strtoupper($row->value) }} {{ strtoupper($document->currency_type->description) }} @endif @endforeach {{-- Código Hash: {{ $document->hash }} --}} {{--
@if(in_array($document->document_type->id,['01','03'])) @foreach($accounts as $account)

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

@endforeach @endif --}}
{{--
--}}

Código Hash:
{{ $document->hash }}
{{--
@if(in_array($document->document_type->id,['01','03'])) @foreach($accounts as $account)

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

@endforeach @endif --}}
Condición de Pago: {{ $paymentCondition }}
@if ($document->payment_condition_id === '01') @if($payments->count()) @php $payment = 0; @endphp @foreach($payments as $row) @endforeach
PAGOS EFECTUADOS:
• {{ $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 Vcto: {{ $quote->date->format('d-m-Y') }} / Importe Cuota: {{ $quote->currency_type->symbol }}{{ $quote->amount }}
@endif
TOTAL OP. GRAVADA {{ number_format($document->total_taxed, 2) }}
{{(($document->total_prepayment > 0) ? 'Anticipo':'Descuento')}} {{ number_format($document->total_discount, 2) }}
I.G.V. (18%) {{ number_format($document->total_igv, 2) }}
IMPORTE TOTAL {{ number_format($document->total, 2) }}
"SIRVASE DEPOSITAR A NUESTRAS CUENTAS" - CUENTA: @if(in_array($document->document_type->id,['01','03'])) @foreach($accounts as $account) {{$account->bank->description}} {{$account->currency_type->description}} N°: {{$account->number}} @if($account->cci) CCI: {{$account->cci}} @endif @endforeach @endif

Representación Impresa del COMPROBANTE ELECTRONICO, Generado desde el Sistema del Contribuyente, para visualizar el documento visita: {!! url('/buscar') !!} , comprobante emitido desde www.econtfact.com