@php $establishment = $document->establishment; $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'); $logo = "storage/uploads/logos/{$company->logo}"; if(property_exists($establishment, 'logo')) { if($establishment->logo) { $logo = "{$establishment->logo}"; } } $configuration_decimal_quantity = App\CoreFacturalo\Helpers\Template\TemplateHelper::getConfigurationDecimalQuantity(); @endphp {{--{{ $document_number }}--}} {{----}} @if($document->state_type->id == '11')
anulado
@endif @if($company->logo) @else @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 : '' }}
@isset($establishment->trade_address)
{{ ($establishment->trade_address !== '-')? 'D. Comercial: '.$establishment->trade_address : '' }}
@endisset
{{ ($establishment->telephone !== '-')? 'Central telefónica: '.$establishment->telephone : '' }}
{{ ($establishment->email && $establishment->email !== '-')? '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
{{ 'R.U.C. '.$company->number }}
{{ $document->document_type->description }}
Nro. {{ $document_number }}
{{--
{{ 'RUC '.$company->number }}
{{ $document->document_type->description }}

Nro. {{ $document_number }}

--}}
@if ($document->detraction) @endif @if($invoice) @endif @if ($document->detraction) @inject('detractionType', 'App\Services\DetractionTypeService') @endif @if ($document->detraction) @endif @if ($document->detraction) @endif @if ($customer->address !== '') @if ($document->detraction) @endif @endif @if ($document->reference_data) @endif @if ($document->detraction) @if($document->detraction->pay_constancy) @endif @endif @if($document->detraction && $invoice->operation_type_id == '1004') @endif
FECHA DE EMISIÓN : {{$document->date_of_issue->format('Y-m-d')}}N. CTA DETRACCIONES : {{ $document->detraction->bank_account}}
FECHA DE VENCIMIENTO : {{$invoice->date_of_due->format('Y-m-d')}}
B/S SUJETO A DETRACCIÓN :{{$document->detraction->detraction_type_id}} - {{ $detractionType->getDetractionTypeDescription($document->detraction->detraction_type_id ) }}
CLIENTE: : {{ $customer->name }} @if ($customer->internal_code ?? false)
{{ $customer->internal_code ?? '' }} @endif
MÉTODO DE PAGO : {{ $detractionType->getPaymentMethodTypeDescription($document->detraction->payment_method_id ) }}
{{ $customer->identity_document_type->description }} : {{$customer->number}}P. DETRACCIÓN : {{ $document->detraction->percentage}}%
DIRECCIÓN: : {{ $customer->address }} {{ ($customer->district_id !== '-')? ', '.$customer->district->description : '' }} {{ ($customer->province_id !== '-')? ', '.$customer->province->description : '' }} {{ ($customer->department_id !== '-')? '- '.$customer->department->description : '' }} MONTO DETRACCIÓN : S/ {{ property_exists($document->detraction, 'amount_pen')?$document->detraction->amount_pen:$document->detraction->amount}}
D. REFERENCIA : {{ $document->reference_data}}
CONSTANCIA DE PAGO : {{ $document->detraction->pay_constancy}}
DETALLE - SERVICIOS DE TRANSPORTE DE CARGA
Ubigeo origen : {{ $document->detraction->origin_location_id[2] }} Dirección origen : {{ $document->detraction->origin_address }}
Ubigeo destino : {{ $document->detraction->delivery_location_id[2] }} Dirección destino : {{ $document->detraction->delivery_address }}
Valor referencial servicio de transporte : {{ $document->detraction->reference_value_service }} Valor referencia carga efectiva : {{ $document->detraction->reference_value_effective_load }}
Valor referencial carga útil : {{ $document->detraction->reference_value_payload }} Detalle del viaje : {{ $document->detraction->trip_detail }}
{{--@if ($document->retention)--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{--
--}} {{-- Información de la retención--}} {{--
Base imponible:{{ $document->currency_type->symbol}} {{ $document->retention->base }}Porcentaje:{{ $document->retention->percentage * 100 }}%
Monto:{{ $document->currency_type->symbol}} {{ $document->retention->amount }}
--}} {{--@endif--}} @if ($document->isPointSystem())
P. ACUMULADOS : {{ $document->person->accumulated_points }} PUNTOS POR LA COMPRA : {{ $document->getPointsBySale() }}
@endif @if ($document->guides)
@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 @if ($document->prepayments) @foreach($document->prepayments as $p) @endforeach @endif @if ($document->purchase_order) @endif @if ($document->quotation_id) @isset($document->quotation->delivery_date) @endisset @endif @isset($document->quotation->sale_opportunity) @endisset @if(!is_null($document_base)) @endif @if($document->folio) @endif
ANTICIPO : {{$p->number}}
ORDEN DE COMPRA : {{ $document->purchase_order }}
COTIZACIÓN : {{ $document->quotation->identifier }}F. ENTREGA : {{ $document->date_of_issue->addDays($document->quotation->delivery_date)->format('d-m-Y') }}
O. VENTA : {{ $document->quotation->sale_opportunity->number_full}}
DOC. AFECTADO : {{ $affected_document_number }}
TIPO DE NOTA : {{ ($document_base->note_type === 'credit')?$document_base->note_credit_type->description:$document_base->note_debit_type->description}}
DESCRIPCIÓN : {{ $document_base->note_description }}
FOLIO : {{ $document->folio }}
@foreach($document->items as $row) @if ($configuration_decimal_quantity->change_decimal_quantity_unit_price_pdf) @else @endif {{-- --}} @endforeach
CÓDIGO DESCRIPCIÓN MODELO MARCA VIN/CHASIS MOTOR COLOR COMB. CLASE G / R FEC.DUA DUA ITEM AÑO MOD. CANT. UND V. UNIT. DSCTO V.VENTA P.UNIT
{{ $loop->iteration }} {{ $row->item->internal_id }} {!! func_get_item_name_pdf($row) !!} @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->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->is_prepayment)
*** Pago Anticipado *** @endif {{-- @if($row->attributes) @foreach($row->attributes as $attr) @if($attr == '5019') {!! $attr->description !!} : {{ $attr->value }} @endif @endforeach @endif --}}
{{ $row->item->model ?? '' }} {{ $row->m_item->brand != null ? $row->m_item->brand->name : '' }} @if($row->attributes) @foreach($row->attributes as $attr) @if($attr->attribute_type_id == '5019') {{ $attr->value }} @endif @endforeach @endif @if($row->attributes) @foreach($row->attributes as $attr) @if($attr->attribute_type_id == '5015') {{ $attr->value }} @endif @endforeach @endif @if($row->attributes) @foreach($row->attributes as $attr) @if($attr->attribute_type_id == '5014') {{ $attr->value }} @endif @endforeach @endif @if($row->attributes) @foreach($row->attributes as $attr) @if($attr->attribute_type_id == '5016') {{ $attr->value }} @endif @endforeach @endif @if($row->attributes) @foreach($row->attributes as $attr) @if($attr->attribute_type_id == '9094') {{ $attr->value }} @endif @endforeach @endif @if($row->attributes) @foreach($row->attributes as $attr) @if($attr->attribute_type_id == '9090') {{ $attr->value }} @endif @endforeach @endif @if($row->attributes) @foreach($row->attributes as $attr) @if($attr->attribute_type_id == '9091') {{ $attr->value }} @endif @endforeach @endif @if($row->attributes) @foreach($row->attributes as $attr) @if($attr->attribute_type_id == '9092') {{ $attr->value }} @endif @endforeach @endif @if($row->attributes) @foreach($row->attributes as $attr) @if($attr->attribute_type_id == '9093') {{ $attr->value }} @endif @endforeach @endif @if($row->attributes) @foreach($row->attributes as $attr) @if($attr->attribute_type_id == '5021') {{ $attr->value }} @endif @endforeach @endif @if(((int)$row->quantity != $row->quantity)) {{ $row->quantity }} @else {{ number_format($row->quantity, 0) }} @endif {{ $row->item->unit_type_id }}{{ $row->generalApplyNumberFormat($row->unit_value, $configuration_decimal_quantity->decimal_quantity_unit_price_pdf) }}{{ 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->unit_price, 2) }} {{ number_format($row->total, 2) }}
Observación: @foreach($document->additional_information as $information) @if ($information) @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")
Son: {{ $row->value }} {{ $document->currency_type->description }}
@if (count((array) $document->legends)>1)
Leyendas
@endif @else
{{$row->code}}: {{ $row->value }}
@endif @endforeach

USUARIO: @if ($document->seller) {{ $document->seller->name }} @else {{ $document->user->name }} @endif
{{--
Representación impresa de la {{ $document->document_type->description }}, en
{{url('/buscar')}}
--}}

Código Hash: {{ $document->hash }}

SUB TOTAL: {{ $document->currency_type->symbol }} {{ number_format($document->subtotal, 2) }}
ANTICIPO {{ $document->currency_type->symbol }} {{(($document->total_prepayment > 0) ? number_format($document->total_discount, 2) : '0.00')}}
OP. GRAVADAS: {{ $document->currency_type->symbol }} {{ number_format($document->total_taxed, 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. GRATUITAS {{ $document->currency_type->symbol }} {{ number_format($document->total_free, 2) }}
VALOR DESCUENTOS {{ $document->currency_type->symbol }} {{number_format($document->total_discount, 2)}}
I.G.V. % {{ $document->currency_type->symbol }} {{ number_format($document->total_igv, 2) }}
PRECIO DE VENTA {{ $document->currency_type->symbol }} {{ number_format($document->total, 2) }}