@php $establishment = \App\Models\Tenant\Establishment::where('id', $document->establishment_id )->first(); $customer = $document->customer; //$path_style = app_path('CoreFacturalo'.DIRECTORY_SEPARATOR.'Templates'.DIRECTORY_SEPARATOR.'pdf'.DIRECTORY_SEPARATOR.'style.css'); $left = ($document->series) ? $document->series : $document->prefix; $tittle = $left.'-'.str_pad($document->number, 8, '0', STR_PAD_LEFT); $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; } $accounts = \App\Models\Tenant\BankAccount::all(); $logo = "storage/uploads/logos/{$company->logo}"; if($establishment->logo) { $logo = "{$establishment->logo}"; } //calculate items $allowed_items = 20; $quantity_items = $document->items()->count(); $cycle_items = $allowed_items - ($quantity_items * 3); $total_weight = 0; $count_=0; @endphp {{--{{ $tittle }}--}} {{----}}
{{--
NOTA DE VENTA
--}}
 
 

{{ $tittle }}

{{-- @if ($document->due_date) @endif --}} @if ($customer->address !== '') @endif {{-- @if ($document->plate_number !== null) @endif @if ($document->total_canceled) @else @endif @if ($document->hotelRent) @endif @if ($document->observation) @endif @if ($document->reference_data) @endif @if ($document->purchase_order) @endif --}}
  {{ $customer->name }}   {{ $document->date_of_issue->format('Y-m-d') }}
{{ $customer->identity_document_type->description }}: {{ $customer->number }}Fecha Vencimiento: {{ $document->getFormatDueDate() }}
  {{ strtoupper($customer->address) }} {{ ($customer->district_id !== '-')? ', '.strtoupper($customer->district->description) : '' }} {{ ($customer->province_id !== '-')? ', '.strtoupper($customer->province->description) : '' }} {{ ($customer->department_id !== '-')? '- '.strtoupper($customer->department->description) : '' }}   @if($document->payment_method_type_id && $payments->count() == 0) {{ $document->payment_method_type->description }} @endif
Teléfono: {{ $customer->telephone }} Vendedor: @if($document->seller_id != 0){{$document->seller->name }} @else {{ $document->user->name }} @endif
N° Placa: {{ $document->plate_number }}
Estado: CANCELADO
Estado: PENDIENTE DE PAGO
Destino: {{$document->hotelRent->destiny}}
Observación: {{ $document->observation }}
D. Referencia: {{ $document->reference_data }}
Orden de compra: {{ $document->purchase_order }}

@foreach($document->items as $row) @endforeach @for($i = 0; $i < $cycle_items; $i++) @endfor
@if(((int)$row->quantity != $row->quantity)) {{ $row->quantity }} @else {{ number_format($row->quantity, 0) }} @endif @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') @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
{{ number_format($row->unit_price, 2) }} {{ number_format($row->total, 2) }}
 
{{ number_format($document->total, 2) }}
{{--

@foreach($accounts as $account)

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

@endforeach

@if($document->payment_method_type_id && $payments->count() == 0)
Pago: {{ $document->payment_method_type->description }}
@endif --}} {{-- @if($payments->count()) @php $payment = 0; @endphp @foreach($payments as $row) @php $payment += (float) $row->payment; @endphp @endforeach
Pagos:
- {{ $row->date_of_payment->format('d/m/Y') }} - {{ $row->payment_method_type->description }} - {{ $row->reference ? $row->reference.' - ':'' }} {{ $document->currency_type->symbol }} {{ $row->payment + $row->change }}
Saldo: {{ $document->currency_type->symbol }} {{ number_format($document->total - $payment, 2) }}
@endif --}} {{-- @if ($document->terms_condition)
Términos y condiciones del servicio
{!! $document->terms_condition !!}
@endif --}}