@php $establishment = $document->establishment; $establishment__ = \App\Models\Tenant\Establishment::find($document->establishment_id); $logo = $establishment__->logo ?? $company->logo; if ($logo === null && !file_exists(public_path("$logo}"))) { $logo = "{$company->logo}"; } if ($logo) { $logo = "storage/uploads/logos/{$logo}"; $logo = str_replace("storage/uploads/logos/storage/uploads/logos/", "storage/uploads/logos/", $logo); } $customer = $document->customer; $invoice = $document->invoice; $document_base = ($document->note) ? $document->note : null; //$path_style = app_path('CoreFacturalo'.DIRECTORY_SEPARATOR.'Templates'.DIRECTORY_SEPARATOR.'pdf'.DIRECTORY_SEPARATOR.'style.css'); $document_number = $document->series.'-'.str_pad($document->number, 8, '0', STR_PAD_LEFT); $accounts = \App\Models\Tenant\BankAccount::where('show_in_documents', true)->get(); if($document_base) { $affected_document_number = ($document_base->affected_document) ? $document_base->affected_document->series.'-'.str_pad($document_base->affected_document->number, 8, '0', STR_PAD_LEFT) : $document_base->data_affected_document->series.'-'.str_pad($document_base->data_affected_document->number, 8, '0', STR_PAD_LEFT); } else { $affected_document_number = null; } $payments = $document->payments; $document->load('reference_guides'); $total_payment = $document->payments->sum('payment'); $balance = ($document->total - $total_payment) - $document->payments->sum('change'); //calculate items $allowed_items = 20; $quantity_items = $document->items()->count(); $cycle_items = $allowed_items - ($quantity_items * 3); $total_weight = 0; $item_=0; $paymentCondition = \App\CoreFacturalo\Helpers\Template\TemplateHelper::getDocumentPaymentCondition($document); $template_data = \App\Models\Tenant\Establishment::where('code', '=', $establishment->code)->first(); @endphp
{{--ITEM | Código | Cant. | U.M. | Descripción | P.U | Importe |
---|---|---|---|---|---|---|
{{ $item_ }} | {{ $row->item->internal_id }} | @if(((int)$row->quantity != $row->quantity)) {{ $row->quantity }} @else {{ number_format($row->quantity, 0) }} @endif | {{ $row->item->unit_type_id }} |
@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') {{join( "-", $itemSet->getItemsSet($row->item_id) )}} @endif |
{{ number_format($row->unit_price, 2) }} | {{ number_format($row->total, 2) }} |
{{$account->bank->description}} {{$account->currency_type->description}} N°: {{$account->number}} @if($account->cci) CCI: {{$account->cci}} @endif
@endforeach @endif --}}{{$account->bank->description}} {{$account->currency_type->description}} N°: {{$account->number}} @if($account->cci) CCI: {{$account->cci}} @endif
@endforeach @endif --}}Condición de Pago: {{ $paymentCondition }} | ||||||||||
@if ($document->payment_condition_id === '01')
@if($payments->count())
|
TOTAL OP. GRAVADA | {{ number_format($document->total_taxed, 2) }} | |||||||
{{(($document->total_prepayment > 0) ? 'Anticipo':'Descuento')}} | {{ number_format($document->total_discount, 2) }} | |||||||
I.G.V. (18%) | {{ number_format($document->total_igv, 2) }} | |||||||
IMPORTE TOTAL | {{ number_format($document->total, 2) }} |