@php
$establishment = \App\Models\Tenant\Establishment::where('id', $document->establishment_id)->first();
$supplier = $document->supplier;
//$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;
// $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 POR PAGAR
{{ $tittle }}
|
Cliente: |
{{ $supplier->name }} |
Fecha de vencimiento: |
{{ $document->date_of_due->format('Y-m-d') }} |
{{ $supplier->identity_document_type->description }}: |
{{ $supplier->number }} |
@if ($supplier->address !== '')
Dirección: |
{{ strtoupper($supplier->address) }}
{{ $supplier->district_id !== '-' && $supplier->district_id != null? ', ' . strtoupper($supplier->district->description) : '' }}
{{ $supplier->province_id !== '-' && $supplier->province_id != null? ', ' . strtoupper($supplier->province->description) : '' }}
{{ $supplier->department_id !== '-' && $supplier->department_id != null ? '- ' . strtoupper($supplier->department->description) : '' }}
|
@endif
Teléfono: |
{{ $supplier->telephone }} |
Estado: |
PENDIENTE DE PAGO |
DOCUMENTO |
TOTAL |
@foreach ($document->items as $row)
{{ $row->document->number_full }}
|
{{ $row->total }} |
|
@endforeach
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())
PAGOS:
|
@php
$payment = 0;
@endphp
@foreach ($payments as $row)
- {{ $row->date_of_payment->format('d/m/Y') }} - {{ $row->payment_method_type->description }}
- {{ $row->reference ? $row->reference . ' - ' : '' }} S/
{{ $row->payment + $row->change }} |
@php
$payment += (float) $row->payment;
@endphp
@endforeach
SALDO: S/
{{ number_format($document->total - $payment, 2) }} |
@endif
@if ($document->terms_condition)
Términos y condiciones del servicio
{!! $document->terms_condition !!}
|
@endif