@php use Mpdf\QrCode\QrCode; use Mpdf\QrCode\Output; use Carbon\Carbon; $establishment = $document->establishment; $customer = $document->customer; $invoice = $document->invoice; //$path_style = app_path('CoreFacturalo'.DIRECTORY_SEPARATOR.'Templates'.DIRECTORY_SEPARATOR.'pdf'.DIRECTORY_SEPARATOR.'style.css'); $tittle = $document->series.'-'.str_pad($document->number, 8, '0', STR_PAD_LEFT); $payments = $document->payments; $is_epos = $document->electronic === 1 ? true : false; // $config_pos = \App\Models\Tenant\ConfigurationPos::first(); // $user = auth()->user(); // $cash = \App\Models\Tenant\Cash::where('state', 1) // ->where('user_id', $user->id) // ->first(); // $resolution = $cash->resolution; $resolution = $document->getCashResolution(); $payment = 0; $sucursal = \App\Models\Tenant\Establishment::where('id', $document->establishment_id)->first(); if(!is_null($sucursal->establishment_logo)){ if(file_exists(public_path('storage/uploads/logos/'.$sucursal->id."_".$sucursal->establishment_logo))) $filename_logo = public_path('storage/uploads/logos/'.$sucursal->id."_".$sucursal->establishment_logo); else $filename_logo = public_path("storage/uploads/logos/{$company->logo}"); } else $filename_logo = public_path("storage/uploads/logos/{$company->logo}"); if($is_epos && $document->qr) { $data_qr = $document->qr; $codigoQR = new QrCode($data_qr); $output = new Output\Png(); $imagenCodigoQR = $output->output($codigoQR, 140); } @endphp @if($filename_logo != "")
@endif
@if($is_epos) @else @endif
@if($is_epos) @endif

{{ $company->name }}

Nit: {{ $company->identification_number }} - {{ $company->type_regime->name}}
{{ ($establishment->email !== '-') ? $establishment->email : '' }}
{{ $sucursal->description }}. {{ $establishment->address }}
DOCUMENTO EQUIVALENTE ELECTRONICO DEL TIQUETE DE MAQUINA REGISTRADORA CON SISTEMA P.O.S. No: {{ $tittle }}
Documento Equivalente POS #: {{ $tittle }}
Serial de caja: {{ $request_api['cash_information']['plate_number'] }}
Tipo de caja: {{ $request_api['cash_information']['cash_type'] }}
Cajero: {{ $request_api['cash_information']['cashier'] }}
Fecha: {{ $document->date_of_issue->format('d-m-Y')}}
Vence: {{$document->date_of_issue->format('d-m-Y') }}
Cliente:{{ $customer->name }}
Ciudad: {{ ($customer->city_id)? ''.$customer->city->name : '' }}
{{$customer->identity_document_type->name}}: {{ $customer->identity_document_type->id == 3 ? $customer->number : $customer->code }}
Direccion: {{ $customer->address }}
Hora: {{ $document->created_at->format('H:i:s')}}
{{--
Tipo Venta: CONTADO 0 días
--}}
@foreach($document->items as $row)
CANT. CODIGO DESCRIPCIÓN
@if(((int)$row->quantity != $row->quantity)) {{ $row->quantity }} @else {{ number_format($row->quantity, 0) }} @endif {{ $row->item->internal_id }} {!!$row->item->name!!} @if (!empty($row->item->presentation)) {!!$row->item->presentation->description!!} @endif @if($row->attributes) @foreach($row->attributes as $attr)
{!! $attr->description !!} : {{ $attr->value }} @endforeach @endif @if($row->discount > 0)
{{ $row->discount }} @endif
{{ number_format($row->unit_price, 2)}} {{ number_format($row->total_tax, 2)}} {{ number_format($row->subtotal, 2)}}
@endforeach @foreach ($document->taxes as $tax) @if ((($tax->total > 0) && (!$tax->is_retention))) @endif @endforeach
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_type->symbol }} {{ number_format($document->total, 2) }}
@if($is_epos && $document->qr) @endif
PAGOS:
    @foreach($payments as $row)
  • {{ $row->payment_method_type->number_days ? $row->date_of_payment->addDays($row->payment_method_type->number_days)->format('d/m/Y') : $row->date_of_payment->format('d/m/Y') }} {{ $row->payment_method_type->description }} {{ $row->reference ? $row->reference.' - ':'' }} {{ $document->currency_type->symbol }}{{ $row->payment }}
  • @php $payment += (float) $row->payment; @endphp @endforeach
SALDO: {{ $document->currency_type->symbol }} {{ number_format($document->total - $payment, 2) }} @if($resolution)
Resol. DIAN #:{{ $resolution->resolution_number }}
Fecha resol.: {{ $resolution->resolution_date->format('d-m-Y') }}
Desde la Factura {{ $resolution->from }} a la {{ $resolution->to }}
@php $firstDate = new \DateTime($resolution->date_from); $secondDate = new \DateTime($resolution->date_end); $intvl = $firstDate->diff($secondDate); @endphp Vigencia: {{($intvl->y * 12) + $intvl->m}} Meses @endif
QR
@if($document->state_type_id == '11') @else @endif @endif
ANULADO
GRACIAS POR SU COMPRA
@if($is_epos)
Software: {{ $request_api['software_manufacturer']['software_name'] }}
Fabricante: {{ $request_api['software_manufacturer']['name'] }}
Compañia: {{ $request_api['software_manufacturer']['business_name'] }}
@if($is_epos)

cude: {{ $document->cude }}

@endif