@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; //$path_style = app_path('CoreFacturalo'.DIRECTORY_SEPARATOR.'Templates'.DIRECTORY_SEPARATOR.'pdf'.DIRECTORY_SEPARATOR.'style.css'); $accounts = \App\Models\Tenant\BankAccount::all(); $tittle = $document->prefix . '-' . str_pad($document->number ?? $document->id, 8, '0', STR_PAD_LEFT); $logo = "storage/uploads/logos/{$company->logo}"; if ($establishment->logo) { $logo = "{$establishment->logo}"; } $cont_ = 0; $rubrica = "storage/uploads/firms/{$company->img_firm}"; //calculate items $allowed_items = 35 - \App\Models\Tenant\BankAccount::all()->count() * 3; $quantity_items = $document->items()->count(); $cycle_items = $allowed_items - $quantity_items * 3; $total_weight = 0; $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; } @endphp {{-- {{ $tittle }} --}} {{-- --}}

{{ $company_name }}

@if ($company_owner) De: {{ $company_owner }}
@endif @isset($establishment->aditional_information)
{{ $establishment->aditional_information !== '-' ? $establishment->aditional_information : '' }}

@endisset @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 !== '-' ? 'Web: ' . $establishment->web_address : '' }}
RUC {{ $company->number }}
Cotización
Nº {{ $tittle }}
Cliente
: {{ $customer->name }}
Fecha de emisión
: {{ $document->date_of_issue->format('Y-m-d') }}
{{ $customer->identity_document_type->description }}
: {{ $customer->number }}
Tiempo de Validez
: @if ($document->date_of_due) {{ $document->date_of_due }} @endif  
Dirección
: @if ($customer->address !== '') {{ $customer->address }} @endif
Tiempo de Entrega
: @if ($document->delivery_date) {{ $document->delivery_date }} @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 }}
Dir. Envío
: @if ($document->shipping_address) {{ $document->shipping_address }} @endif  
COND. PAGO
: {{ $document->payment_method_type->description }}
Teléfono
: @if ($customer->telephone) {{ $customer->telephone }} @endif  
Contacto
: @if ($document->contact) {{ $document->contact }} @endif  
Vendedor
: @if ($document->seller) {{ $document->seller->name }} @else {{ $document->user->name }} @endif  
@if ($document->description) {{-- --}}
Observación: {!! str_replace("\n", '
', $document->description) !!}
{{ $document->description }}
@endif @foreach ($document->items as $row) @php $cont_++; @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->item->name_product_pdf ?? false) {!! $row->item->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 !== null && property_exists($row->item, 'extra_attr_value') && $row->item->extra_attr_value != '')
{{ $row->item->extra_attr_name }}: {{ $row->item->extra_attr_value }} @endif @if ($row->item->is_set == 1)
@inject('itemSet', 'App\Services\ItemSetService') @foreach ($itemSet->getItemsSet($row->item_id) as $item) {{ $item }}
@endforeach @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 }}
Cuentas Bancarias
@foreach ($accounts as $account)
{{ $account->bank->description }} {{ $account->currency_type->description }}
{{ $account->number }} @if ($account->cci)
CCI: {{ $account->cci }} @endif
@endforeach {{--@if (file_get_contents(public_path($rubrica)))
@endif--}} @if (isset($rubrica) && file_exists(public_path($rubrica)))
@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..
Consulte el documento en https://famavet.e.org.pe/buscar
POR FAVOR VERIFICAR LOS PRODUCTOS ENTREGADOS, LUEGO DE ESTO NO HABRA LUGAR A RECLAMOS NI DEVOLUCIONES.
--}}