@php $establishment = $document->establishment; $supplier = $document->supplier; $tittle = $document->series.'-'.str_pad($document->number, 8, '0', STR_PAD_LEFT); $path_style = app_path('CoreFacturalo'.DIRECTORY_SEPARATOR.'Templates'.DIRECTORY_SEPARATOR.'pdf'.DIRECTORY_SEPARATOR.'style.css'); if(!is_null($establishment->establishment_logo)){ if(file_exists(public_path('storage/uploads/logos/'.$establishment->id."_".$establishment->establishment_logo))) $filename_logo = public_path('storage/uploads/logos/'.$establishment->id."_".$establishment->establishment_logo); else $filename_logo = public_path("storage/uploads/logos/{$company->logo}"); } else $filename_logo = public_path("storage/uploads/logos/{$company->logo}"); @endphp {{ $document->series.$document->number }} @if($filename_logo != "") @else @endif

{{ $company->name }}

{{ $company->number }}

{{ ($establishment->address !== '-')? $establishment->address : '' }} {{ ($establishment->city_id !== '-')? ', '.$establishment->city->name : '' }} {{ ($establishment->department_id !== '-')? '- '.$establishment->department->name : '' }} {{ ($establishment->country_id !== '-')? ', '.$establishment->country->name : '' }}

@isset($establishment->trade_address)

{{ ($establishment->trade_address !== '-')? 'D. Comercial: '.$establishment->trade_address : '' }}

@endisset

{{ ($establishment->telephone !== '-')? 'Central telefónica: '.$establishment->telephone : '' }}

{{ ($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
COMPRA

{{ $tittle }}

@if($document->date_of_due) @endif @if ($supplier->address !== '') @if($document->delivery_date) @endif @endif @if ($document->payment_method_type) @if($document->sale_opportunity) @endif @endif @if ($supplier->telephone) @endif
Proveedor: {{ $supplier->name }} Fecha de emisión: {{ $document->date_of_issue->format('Y-m-d') }}
{{ $supplier->identity_document_type->name }}: {{ $supplier->number }}Fecha de vencimiento: {{ $document->date_of_due->format('Y-m-d') }}
Dirección: {{ $supplier->address }} {{ ($supplier->country_id)? ', '.$supplier->country->name : '' }} {{ ($supplier->department_id)? ', '.$supplier->department->name : '' }} {{ ($supplier->city_id)? '- '.$supplier->city->name : '' }} Fecha de entrega: {{ $document->delivery_date->format('Y-m-d') }}
T. Pago: {{ $document->payment_method_type->description }} O. Venta: {{ $document->sale_opportunity->number_full }}
Teléfono: {{ $supplier->telephone }}
@foreach($document->items as $row) @endforeach @foreach ($document->taxes as $tax) @if ((($tax->total > 0) && (!$tax->is_retention))) @endif @endforeach
CANT. UNIDAD DESCRIPCIÓN P.UNIT DTO. TOTAL
@if(((int)$row->quantity != $row->quantity)) {{ $row->quantity }} @else {{ number_format($row->quantity, 0) }} @endif {{ $row->item->unit_type->name }} {!!$row->item->name!!} {{ number_format($row->unit_price, 2) }} {{ number_format($row->discount, 2) }} {{ number_format($row->total, 2) }}
TOTAL VENTA: {{ $document->currency->symbol }} {{ $document->sale }}
TOTAL DESCUENTO (-): {{ $document->currency->symbol }} {{ $document->total_discount }}
SUBTOTAL: {{ $document->currency->symbol }} {{ number_format($document->subtotal - $document->total_tax, 2) }}
{{$tax->name}}(+): {{ $document->currency->symbol }} {{number_format($tax->total, 2)}}
TOTAL A PAGAR: {{ $document->currency->symbol }} {{ number_format($document->total, 2) }}

@php $payment = 0; @endphp @foreach($document->purchase_payments as $row) @php $payment += (float) $row->payment; @endphp @endforeach
PAGOS:
- {{ $row->payment_method_type->description }} - {{ $row->reference ? $row->reference.' - ':'' }} {{ $document->currency->symbol }} {{ $row->payment }}
SALDO: {{ $document->currency->symbol }} {{ number_format($document->total - $payment, 2) }}