@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); $payments = $document->payments; $accounts = \App\Models\Tenant\BankAccount::where('show_in_documents', true)->get(); $logo = "storage/uploads/logos/{$company->logo}"; if ($establishment->logo) { $logo = "{$establishment->logo}"; } @endphp {{-- {{ $tittle }} --}} {{-- --}} @if ($company->logo) @else @endif

{{ $company->name }}

{{ 'RUC ' . $company->number }}
{{ $establishment->address !== '-' ? $establishment->address : '' }} {{ $establishment->district_id !== '-' ? ', ' . $establishment->district->description : '' }} {{ $establishment->province_id !== '-' ? ', ' . $establishment->province->description : '' }} {{ $establishment->department_id !== '-' ? '- ' . $establishment->department->description : '' }}
{{ $establishment->email !== '-' ? $establishment->email : '' }}
{{ $establishment->telephone !== '-' ? $establishment->telephone : '' }}
{{--
{{ get_document_name('sale_note', 'NOTA DE VENTA') }}
--}}
LETRA DE CAMBIO

{{ $tittle }}

@if ($customer->address !== '') @endif
Cliente: {{ $customer->name }} Fecha de vencimiento: {{ $document->date_of_due->format('Y-m-d') }}
{{ $customer->identity_document_type->description }}: {{ $customer->number }}
Dirección: {{ strtoupper($customer->address) }} {{ $customer->district_id !== '-' && $customer->district_id != null? ', ' . strtoupper($customer->district->description) : '' }} {{ $customer->province_id !== '-' && $customer->province_id != null? ', ' . strtoupper($customer->province->description) : '' }} {{ $customer->department_id !== '-' && $customer->department_id != null ? '- ' . strtoupper($customer->department->description) : '' }}
Teléfono: {{ $customer->telephone }}
Estado: PENDIENTE DE PAGO
@foreach ($document->items as $row) @endforeach
DOCUMENTO TOTAL
{{ $row->document->number_full }} {{ $row->total }}
TOTAL: S/ {{ 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 . ' - ' : '' }} S/ {{ $row->payment + $row->change }}
SALDO: S/ {{ number_format($document->total - $payment, 2) }}
@endif @if ($document->terms_condition)
Términos y condiciones del servicio
{!! $document->terms_condition !!}
@endif