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

{{$request->head_note}}

@endif
@if($customer->company->country->id == 46) @else @endif
ID or NIT: {{$customer->company->identification_number}}-{{$request->customer['dv'] ?? NULL}}
Customer: {{$customer->name}}
Regime: {{$customer->company->type_regime->name}}
Liability: {{$customer->company->type_liability->name}}
Address: {{$customer->company->address}}
City:{{$customer->company->municipality->name}} - {{$customer->company->country->name}} {{$customer->company->municipality_name}} - {{$customer->company->state_name}} - {{$customer->company->country->name}}
Phone: {{$customer->company->phone}}
Email: {{$customer->email}}
@if(!empty($paymentForm)&& $paymentForm->count() > 0) @endif @if(isset($request['seller']) && isset($request['seller']['name'])) @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
Payment Method: {{$paymentForm[0]->name}}
Means of Payment: @foreach ($paymentForm as $paymentF) {{$paymentF->nameMethod}}
@endforeach
Term to Pay: {{$paymentForm[0]->duration_measure}} Days
Due Date: {{$paymentForm[0]->payment_due_date}}
Seller: {{$request['seller']['name']}}
Order Number: {{$request['order_reference']['id_order']}}
Order Date: {{$request['order_reference']['issue_date_order']}}
Billing Period Start: {{$healthfields->invoice_period_start_date}}
Billing Period End: {{$healthfields->invoice_period_end_date}}
Account Number: {{$request['number_account'] }}
Delivery Terms: {{ isset($request['deliveryterms']['loss_risk_responsibility_code']) ? $request['deliveryterms']['loss_risk_responsibility_code'] : '' }} - {{ isset($request['deliveryterms']['loss_risk']) ? $request['deliveryterms']['loss_risk'] : '' }}
T.R.M: {{ isset($request['k_supplement']['FctConvCop']) ? number_format($request['k_supplement']['FctConvCop'], 2) : '0.00' }}
Destination {{ isset($request['k_supplement']['destination']) ? $request['k_supplement']['destination'] : '' }}
Currency Type: {{ isset($request['k_supplement']['MonedaCop']) ? ($currency->where('code', 'like', '%'.$request['k_supplement']['MonedaCop'].'%')->first()['name'] ?? '') : '' }}

@isset($healthfields) @if($healthfields->print_users_info_to_pdf)
HEALTH SECTOR REFERENCE INFORMATION
@foreach($healthfields->users_info as $item) @if($item->identification_number && $item->first_name && $item->surname && $item->health_type_document_identification_id) @else @endif @endforeach
Provider Code User Data Contract/Coverage Info Authorization/MIPRES Nos. Payment Info

{{$item->provider_code}}

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

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

Document Type: {{$item->health_type_document_identification()->name}}

User Type: {{$item->health_type_user()->name}}

ID No:

Name:

Document Type:

User Type:

Contracting Modality: {{$item->health_contracting_payment_method()->name}}

Contract No: {{$item->contract_number}}

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

Authorization Nos.: {{$item->autorization_numbers}}

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

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

Policy No: {{$item->policy_number}}

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

Moderating Fee: {{number_format($item->moderating_fee, 2)}}

Shared Payments: {{number_format($item->shared_payment, 2)}}

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

@endif
@endisset @if($showPurchaseOrderColumn) @endif @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($showPurchaseOrderColumn) @endif @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
# Code DescriptionPurchase OrderQuantity UM Unit ValueUnit Value USDVAT/ICVAT/IC USDDiscountDiscount USD% Item ValueItem Value 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 @if(isset($item['allowance_charges']) && floatval($item['allowance_charges'][0]['base_amount']) != 0) {{ number_format(($item['allowance_charges'][0]['amount'] * 100) / $item['allowance_charges'][0]['base_amount'], 2) }} @else 0.00 @endif {{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
@if(isset($item['purchase_order_number']) && $item['purchase_order_number']) {{$item['purchase_order_number']}} @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 @if(isset($item['allowance_charges']) && floatval($item['allowance_charges'][0]['base_amount']) != 0) {{ number_format(($item['allowance_charges'][0]['amount'] * 100) / $item['allowance_charges'][0]['base_amount'], 2) }} @else 0.00 @endif {{number_format($item['line_extension_amount'], 2)}}{{number_format($item['line_extension_amount'] / $trmValue, 2)}}

Taxes Withholdings Totals
@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
Type BaseBase USDPercent AmountAmount USD
{{$tax->findOrFail($item['tax_id'])['name']}} {{number_format($item['taxable_amount'], 2)}}{{number_format($item['taxable_amount'] / $trmValue, 2)}} @if(isset($item['percent'])) {{ number_format($item['percent'], 2) }}% @elseif(isset($item['per_unit_amount']) && isset($item['base_unit_measure'])) {{ number_format($item['per_unit_amount'], 2) }} x {{ number_format($item['base_unit_measure'], 2) }} @else - @endif {{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
Type BaseBase USDPercent AmountAmount USD
{{$tax->findOrFail($item['tax_id'])['name']}} {{number_format($item['taxable_amount'], 2)}}{{number_format($item['taxable_amount'] / $trmValue, 2)}} @if(isset($item['percent'])) {{ number_format($item['percent'], 2) }}% @elseif(isset($item['per_unit_amount']) && isset($item['base_unit_measure'])) {{ number_format($item['per_unit_amount'], 2) }} x {{ number_format($item['base_unit_measure'], 2) }} @else - @endif {{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
Concept AmountAmount USD
Line Count: {{$ItemNro}}{{$ItemNro}}
Base: {{number_format($request->legal_monetary_totals['line_extension_amount'], 2)}}{{number_format($request->legal_monetary_totals['line_extension_amount'] / $trmValue, 2)}}
Taxes: {{number_format($TotalImpuestos, 2)}}{{number_format($TotalImpuestos / $trmValue, 2)}}
Withholdings: {{number_format($TotalRetenciones, 2)}}{{number_format($TotalRetenciones / $trmValue, 2)}}
Line Discounts: {{number_format($TotalDescuentosEnLineas, 2)}}{{number_format($TotalDescuentosEnLineas / $trmValue, 2)}}
Global Discounts:{{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'] ?? "Global Charge No: ".$charge_number}} {{number_format($allowance_charge['amount'], 2)}}{{number_format($allowance_charge['amount'] / $trmValue, 2)}}
Previous Balance: {{number_format($request->previous_balance, 2)}}{{number_format($request->previous_balance / $trmValue, 2)}}
Invoice Total - Discounts: {{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 to Pay {{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 // Start with payable_amount $totalAmount = $request->legal_monetary_totals['payable_amount']; // Check for previous_balance if (isset($request->previous_balance)) { $totalAmount += $request->previous_balance; } // Check for withholdings and subtract if (isset($TotalRetenciones)) { $totalAmount -= $TotalRetenciones; } // Round total to two decimals $totalAmount = round($totalAmount, 2); $totalAmountUSD = isset($request['deliveryterms']) ? round($totalAmount / $trmValue, 2) : 0; // Define currency $idcurrency = $request->idcurrency ?? null; @endphp @if(isset($request['deliveryterms']))

AMOUNT IN WORDS: {{$Varios->convertir($totalAmountUSD, $idcurrency, 'en')}} *********.

@else

AMOUNT IN WORDS: {{$Varios->convertir($totalAmount, $idcurrency, 'en')}} *********.

@endif

@if(isset($request['bank_accounts']) && count($request['bank_accounts']) > 0)
@foreach($request['bank_accounts'] as $cuenta) @endforeach
Bank accounts for payment
Bank Account Number
{{$cuenta['bank_description']}} {{$cuenta['number']}}
Payment must be made only to the indicated bank account. We are not responsible for deposits to other accounts.
@endif @if(isset($notes))

NOTES:

{{$notes}}

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

PLEASE REPORT PAYMENT TO PHONE {{$company->phone}} or email {{$user->email}}

ACCEPTANCE SIGNATURE:


ID:


DATE:


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