@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(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}}
Payment Means: @foreach ($paymentForm as $paymentF) {{$paymentF->nameMethod}}
@endforeach
Payment Term: {{$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']}}
Invoice Period Start: {{$healthfields->invoice_period_start_date}}
Invoice Period End: {{$healthfields->invoice_period_end_date}}
Account Number: {{$request['number_account'] }}
Delivery Terms: {{$request['deliveryterms']['loss_risk_responsibility_code']}} - {{ $request['deliveryterms']['loss_risk'] }}
T.R.M: {{number_format($request['calculationrate'], 2)}}
T.R.M Date: {{$request['calculationratedate']}}
Currency: {{$currency->findOrFail($request['idcurrency'])['name']}}
@isset($healthfields)
REFERENTIAL HEALTH SECTOR INFORMATION
@foreach($healthfields->users_info as $item) @endforeach
Provider Code User Data Contract/Coverage Info Auth. Nos./MIPRES Payment Info

{{$item->provider_code}}

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

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

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

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)}}

@endisset @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($item['allowance_charges'])) @else @endif @else @if(isset($item['tax_totals'])) @if(isset($item['allowance_charges'])) @else @endif @else @if(isset($item['allowance_charges'])) @else @endif @endif @if(isset($item['tax_totals'])) @if(isset($item['tax_totals'][0]['tax_amount'])) @else @endif @else @endif @if(isset($item['allowance_charges']))
# Code Description Qty Unit Value VAT/IC Discount Item Value
{{$ItemNro}} {{$item['code']}} {{$item['description']}} {{number_format($item['price_amount'], 2)}} {{number_format($item['tax_totals'][0]['tax_amount'], 2)}}{{number_format($item['allowance_charges'][0]['amount'], 2)}}{{number_format("0", 2)}}{{number_format($item['invoiced_quantity'] * $item['price_amount'], 2)}}

{{$ItemNro}}

{{$item['code']}}

@if(isset($item['notes']))

{{$item['description']}}

Note: {{$item['notes']}}

@else

{{$item['description']}}

@endif

{{number_format($item['invoiced_quantity'], 2)}}

{{number_format(($item['line_extension_amount'] + $item['allowance_charges'][0]['amount']) / $item['invoiced_quantity'], 2)}}

{{number_format($item['line_extension_amount'] / $item['invoiced_quantity'], 2)}}

{{number_format(($item['line_extension_amount'] + $item['allowance_charges'][0]['amount']) / $item['invoiced_quantity'], 2)}}

{{number_format($item['line_extension_amount'] / $item['invoiced_quantity'], 2)}}

{{number_format($item['tax_totals'][0]['tax_amount'] / $item['invoiced_quantity'], 2)}}

{{number_format(0, 2)}}

E