@if(!empty($logo=\App\Models\Setting::where('setting_key','company_logo')->first()->setting_value)) logo @else @endif
Reference: {{$invoice->reference}}
Bill Date: {{$invoice->date}}
Due Date: {{$invoice->due_date}}
@if($invoice->status==='paid') Status:Paid @endif @if($invoice->status==='partially_paid') Status:Partially Paid -Pay @endif @if($invoice->status==='unpaid') Status: Unpaid -Pay @endif
{{\App\Models\Setting::where('setting_key','company_name')->first()->setting_value}}
{{\App\Models\Setting::where('setting_key','company_address')->first()->setting_value}}
Phone: {{\App\Models\Setting::where('setting_key','company_tel')->first()->setting_value}}
Website: {{\App\Models\Setting::where('setting_key','company_website')->first()->setting_value}}
Bill To
@if(!empty($invoice->patient)) {{$invoice->patient->name}} @endif
{{$invoice->patient->address}}
@if(!empty($invoice->patient->country)) {{$invoice->patient->country->name}} @endif

@foreach($invoice->invoiceItems as $key) @endforeach @if($invoice->discount_amount>0) @endif @if(!empty($invoice->taxRate)) @endif
Item Quantity Unit Cost Tax Total
{{$key->name}}
{{$key->description}}
{{number_format($key->qty)}} {{number_format($key->unit_cost,2)}} {{number_format($key->tax_total,2)}} @if(!empty($key->taxRate)) ({{$key->taxRate->name}}) @endif {{number_format($key->total,2)}}
Sub Total {{number_format($invoice->invoiceItems->sum('total'),2)}}
Discount {{number_format($invoice->discount_amount,2)}} @if($invoice->discount_type=='percentage') ({{$invoice->discount}}%) @endif
Tax {{number_format($invoice->tax_total,2)}} ({{$invoice->taxRate->name}})
Total {{number_format($invoice->amount,2)}}
Paid {{number_format($invoice->invoicePayments->sum('amount'),2)}}
Balance {{number_format($invoice->balance,2)}}

Payments

@if(count($invoice->invoicePayments)==0) @endif @foreach($invoice->invoicePayments as $key) @endforeach
# Payment Mode Date Amount
No Records
{{$key->id}} @if(!empty($key->paymentType)) {{$key->paymentType->name}} @endif {{$key->date}} {{number_format($key->amount)}}

@if(!empty($invoice->terms))

Terms & Conditions

{!! $invoice->terms !!}
@endif