@if(isset($request->head_note))

{{$request->head_note}}

@endif
@if($customer->company->country->id == 46) @else @endif
CC o NIT: {{$customer->company->identification_number}}-{{$request->customer['dv'] ?? NULL}}
Cliente: {{$customer->name}}
Régimen: {{$customer->company->type_regime->name}}
Obligación: {{$customer->company->type_liability->name}}
Dirección: {{$customer->company->address}}
Ciudad:{{$customer->company->municipality->name}} - {{$customer->company->country->name}} {{$customer->company->municipality_name}} - {{$customer->company->state_name}} - {{$customer->company->country->name}}
Teléfono: {{$customer->company->phone}}
Email: {{$customer->email}}
@if(!empty($paymentForm)&& $paymentForm->count() > 0) @endif @if(isset($request['order_reference']['id_order'])) @endif @if(isset($request['order_reference']['issue_date_order'])) @endif @if(isset($healthfields)) @endif @if(isset($request['number_account'])) @endif @if(isset($request['deliveryterms'])) @inject('currency', 'App\TypeCurrency') @endif
Forma de Pago: {{$paymentForm[0]->name}}
Medios de Pago: @foreach ($paymentForm as $paymentF) {{$paymentF->nameMethod}}
@endforeach
Plazo Para Pagar: {{$paymentForm[0]->duration_measure}} Dias
Fecha Vencimiento: {{$paymentForm[0]->payment_due_date}}
Número Pedido: {{$request['order_reference']['id_order']}}
Fecha Pedido: {{$request['order_reference']['issue_date_order']}}
Inicio Periodo Facturación: {{$healthfields->invoice_period_start_date}}
Fin Periodo Facturación: {{$healthfields->invoice_period_end_date}}
Número de cuenta: {{$request['number_account'] }}
Terminos de Entrega: {{$request['deliveryterms']['loss_risk_responsibility_code']}} - {{ $request['deliveryterms']['loss_risk'] }}
T.R.M: {{number_format($request['k_supplement']['FctConvCop'], 2)}}
Destino {{$request['k_supplement']['destination']}}
Tipo Moneda: {{$currency->where('code', 'like', '%'.$request['k_supplement']['MonedaCop'].'%')->firstOrFail()['name']}}
Modo de transporte: {{ $request['transportation_information']['transport_mode'] }}
Placa: {{ $request['transportation_information']['plate_number'] }}
Transporte: {{ $request['transportation_information']['transport_mean'] }}
Origen: {{ $request['transportation_information']['origin_place'] }}
Destino: {{ $request['transportation_information']['destination_place'] }}

@isset($healthfields) @if($healthfields->print_users_info_to_pdf)
INFORMACION REFERENCIAL SECTOR SALUD
@foreach($healthfields->users_info as $item) @if($item->identification_number && $item->first_name && $item->surname && $item->health_type_document_identification_id) @else @endif @endforeach
Cod Prestador Datos Usuario Info. Contrat./Cobertura Nros. Autoriz./MIPRES Info. de Pagos

{{$item->provider_code}}

Nro ID: {{$item->identification_number}}

Nombre: {{$item->first_name}} {{$item->middle_name}} {{$item->surname}} {{$item->second_surname}}

Tipo Documento: {{$item->health_type_document_identification()->name}}

Tipo Usuario: {{$item->health_type_user()->name}}

Nro ID:

Nombre:

Tipo Documento:

Tipo Usuario:

Modalidad Contratación: {{$item->health_contracting_payment_method()->name}}

Nro. Contrato: {{$item->contract_number}}

Cobertura: {{$item->health_coverage()->name}}

Nros Autorización: {{$item->autorization_numbers}}

Nro MIPRES: {{$item->mipres}}

Entrega MIPRES: {{$item->mipres_delivery}}

Nro Poliza: {{$item->policy_number}}

Copago: {{number_format($item->co_payment, 2)}}

Cuota Moderardora: {{number_format($item->moderating_fee, 2)}}

Pagos Compartidos: {{number_format($item->shared_payment, 2)}}

Anticipos: {{number_format($item->advance_payment, 2)}}

@endif
@endisset @if(isset($request['deliveryterms'])) @endif @if(isset($request['deliveryterms'])) @endif @if(isset($request['deliveryterms'])) @endif @if(isset($request['deliveryterms'])) @endif @foreach($request['invoice_lines'] as $item) @inject('um', 'App\UnitMeasure') @if($item['description'] == 'Administración' or $item['description'] == 'Imprevisto' or $item['description'] == 'Utilidad') @if(isset($request['deliveryterms'])) @endif @if(isset($request['deliveryterms'])) @endif @if(isset($item['allowance_charges'])) @if(isset($request['deliveryterms'])) @endif @else @if(isset($request['deliveryterms'])) @endif @endif @if(isset($request['deliveryterms'])) @endif @else @if(isset($request['deliveryterms'])) @endif @if(isset($item['tax_totals'])) @if(isset($request['deliveryterms'])) @endif @else @if(isset($request['deliveryterms'])) @endif @endif @if(isset($item['allowance_charges'])) @if(isset($request['deliveryterms'])) @endif @else @if(isset($request['deliveryterms'])) @endif @endif @if(isset($request['deliveryterms'])) @endif @endif @endforeach
# Código Descripción Cantidad UM Val. UnitVal. Unit USDIVA/ICIVA/IC USDDctoDcto USD% Val. ItemVal. Item USD
{{$ItemNro}} {{$item['code']}} {{$item['description']}} {{number_format($item['price_amount'], 2)}}{{number_format($item['price_amount'] / $trmValue, 2)}}{{isset($item['tax_totals'][0]['tax_amount']) ? number_format($item['tax_totals'][0]['tax_amount'], 2) : '0.00'}}{{isset($item['tax_totals'][0]['tax_amount']) ? number_format($item['tax_totals'][0]['tax_amount'] / $trmValue, 2) : '0.00'}}{{number_format($item['allowance_charges'][0]['amount'], 2)}}{{number_format($item['allowance_charges'][0]['amount'] / $trmValue, 2)}}0.000.00{{isset($item['allowance_charges']) ? number_format(($item['allowance_charges'][0]['amount'] * 100) / $item['allowance_charges'][0]['base_amount'], 2) : '0.00'}} {{number_format($item['invoiced_quantity'] * $item['price_amount'], 2)}}{{number_format(($item['invoiced_quantity'] * $item['price_amount']) / $trmValue, 2)}}{{$ItemNro}} {{$item['code']}} @if(isset($item['notes'])) {{$item['description']}}

{{$item['notes']}}

@else {{$item['description']}} @endif
{{number_format($item['invoiced_quantity'], 2)}} {{$um->findOrFail($item['unit_measure_id'])['name']}} {{number_format(($item['line_extension_amount'] / $item['invoiced_quantity']), 2)}}{{number_format(($item['line_extension_amount'] / $item['invoiced_quantity']) / $trmValue, 2)}}{{number_format($item['tax_totals'][0]['tax_amount'] / $item['invoiced_quantity'], 2)}}{{number_format(($item['tax_totals'][0]['tax_amount'] / $item['invoiced_quantity']) / $trmValue, 2)}}EE{{number_format($item['allowance_charges'][0]['amount'], 2)}}{{number_format($item['allowance_charges'][0]['amount'] / $trmValue, 2)}}0.000.00{{isset($item['allowance_charges']) ? number_format(($item['allowance_charges'][0]['amount'] * 100) / $item['allowance_charges'][0]['base_amount'], 2) : '0.00'}} {{number_format($item['line_extension_amount'], 2)}}{{number_format($item['line_extension_amount'] / $trmValue, 2)}}

Impuestos Retenciones Totales
@if(isset($request['deliveryterms'])) @endif @if(isset($request['deliveryterms'])) @endif @if(isset($request->tax_totals)) @foreach($request->tax_totals as $item) @inject('tax', 'App\Tax') @if(isset($request['deliveryterms'])) @endif @if(isset($request['deliveryterms'])) @endif @endforeach @else @endif
Tipo BaseBase USDPorcentaje ValorValor USD
{{$tax->findOrFail($item['tax_id'])['name']}} {{number_format($item['taxable_amount'], 2)}}{{number_format($item['taxable_amount'] / $trmValue, 2)}}{{number_format($item['percent'], 2)}}% {{number_format($item['tax_amount'], 2)}}{{number_format($item['tax_amount'] / $trmValue, 2)}}
@if(isset($request['deliveryterms'])) @endif @if(isset($request['deliveryterms'])) @endif @if(isset($withHoldingTaxTotal)) @foreach($withHoldingTaxTotal as $item) @inject('tax', 'App\Tax') @if(isset($request['deliveryterms'])) @endif @if(isset($request['deliveryterms'])) @endif @endforeach @endif
Tipo BaseBase USDPorcentaje ValorValor USD
{{$tax->findOrFail($item['tax_id'])['name']}} {{number_format($item['taxable_amount'], 2)}}{{number_format($item['taxable_amount'] / $trmValue, 2)}}{{number_format($item['percent'], 2)}}% {{number_format($item['tax_amount'], 2)}}{{number_format($item['tax_amount'] / $trmValue, 2)}}
@if(isset($request['deliveryterms'])) @endif @if(isset($request['deliveryterms'])) @endif @if(isset($request['deliveryterms'])) @endif @if(isset($request['deliveryterms'])) @endif @if(isset($request['deliveryterms'])) @endif @if(isset($request['deliveryterms'])) @endif @if(isset($request->legal_monetary_totals['allowance_total_amount'])) @if(isset($request['deliveryterms'])) @endif @else @if(isset($request['deliveryterms'])) @endif @endif @if(isset($request->legal_monetary_totals['charge_total_amount'])) @if($request->legal_monetary_totals['charge_total_amount'] > 0) @foreach($request['allowance_charges'] as $allowance_charge) @if(isset($allowance_charge)) @if($allowance_charge['charge_indicator'] == true) @if(isset($request['deliveryterms'])) @endif @endif @endif @endforeach @endif @endif @if(isset($request->previous_balance)) @if($request->previous_balance > 0) @if(isset($request['deliveryterms'])) @endif @endif @endif @if(isset($request['deliveryterms'])) @endif @if(isset($request['deliveryterms'])) @endif
Concepto ValorValor USD
Nro Lineas: {{$ItemNro}}{{$ItemNro}}
Base: {{number_format($request->legal_monetary_totals['line_extension_amount'], 2)}}{{number_format($request->legal_monetary_totals['line_extension_amount'] / $trmValue, 2)}}
Impuestos: {{number_format($TotalImpuestos, 2)}}{{number_format($TotalImpuestos / $trmValue, 2)}}
Retenciones: {{number_format($TotalRetenciones, 2)}}{{number_format($TotalRetenciones / $trmValue, 2)}}
Descuentos En Lineas: {{number_format($TotalDescuentosEnLineas, 2)}}{{number_format($TotalDescuentosEnLineas / $trmValue, 2)}}
Descuentos Globales:{{number_format($request->legal_monetary_totals['allowance_total_amount'], 2)}}{{number_format($request->legal_monetary_totals['allowance_total_amount'] / $trmValue, 2)}}{{number_format(0, 2)}}{{number_format(0, 2)}}
{{$allowance_charge['allowance_charge_reason'] ?? "Cargo Global Nro: ".$charge_number}} {{number_format($allowance_charge['amount'], 2)}}{{number_format($allowance_charge['amount'] / $trmValue, 2)}}
Saldo Anterior: {{number_format($request->previous_balance, 2)}}{{number_format($request->previous_balance / $trmValue, 2)}}
Total Factura - Descuentos: {{number_format($request->legal_monetary_totals['payable_amount'] + ($request->previous_balance ?? 0) - $TotalRetenciones, 2)}}{{number_format(($request->legal_monetary_totals['payable_amount'] + ($request->previous_balance ?? 0) - $TotalRetenciones) / $trmValue, 2)}}
Total a Pagar {{number_format($request->legal_monetary_totals['payable_amount'] + ($request->previous_balance ?? 0) - $TotalRetenciones, 2)}}{{number_format(($request->legal_monetary_totals['payable_amount'] + ($request->previous_balance ?? 0) - $TotalRetenciones) / $trmValue, 2)}}

@inject('Varios', 'App\Custom\NumberSpellOut')

@php // Inicializamos con payable_amount $totalAmount = $request->legal_monetary_totals['payable_amount']; // Verificamos si existe previous_balance if (isset($request->previous_balance)) { $totalAmount += $request->previous_balance; } // Verificamos si existen retenciones y las restamos if (isset($TotalRetenciones)) { $totalAmount -= $TotalRetenciones; } // Finalmente, redondeamos el total a dos decimales $totalAmount = round($totalAmount, 2); $totalAmountUSD = isset($request['deliveryterms']) ? round($totalAmount / $trmValue, 2) : 0; // Definimos la moneda $idcurrency = $request->idcurrency ?? null; @endphp @if(isset($request['deliveryterms']))

SON: {{$Varios->convertir($totalAmountUSD, $idcurrency)}} M/CTE*********.

@else

SON: {{$Varios->convertir($totalAmount, $idcurrency)}} M/CTE*********.

@endif

@if(isset($notes))

NOTAS:

{{$notes}}

@endif
@if(isset($request->disable_confirmation_text)) @if(!$request->disable_confirmation_text)

INFORME EL PAGO AL TELEFONO {{$company->phone}} o al e-mail {{$user->email}}

FIRMA ACEPTACIÓN:


CC:


FECHA:


@endif @endif
@if(isset($firma_facturacion) and !is_null($firma_facturacion))
@endif