{{ ucfirst(__('laravel-crm::lang.invoice')) }}

@if($logo) @endif

{{ ucfirst(__('laravel-crm::lang.to')) }}
@if($invoice->organisation) {{ $invoice->organisation->name }}
{{ $invoice->person->name ?? null }}
@else {{ $invoice->person->name ?? null }}
@endif @if(isset($organisation_address)) @if($organisation_address->line2) {{ $organisation_address->line1 }}
@endif @if($organisation_address->line2) {{ $organisation_address->line2 }}
@endif @if($organisation_address->line3) {{ $organisation_address->line3 }}
@endif @if($organisation_address->city || $organisation_address->state || $organisation_address->postcode) {{ $organisation_address->city }} {{ $organisation_address->state }} {{ $organisation_address->postcode }}
@endif {{ $organisation_address->country }} @elseif($address) {{ $address->line1 }}
@if($address->line2) {{ $address->line2 }}
@endif @if($address->line3) {{ $address->line3 }}
@endif {{ $address->city }}
{{ $address->country }} @endif
@if($invoice->reference)
{{ ucfirst(__('laravel-crm::lang.invoice_number')) }}
{{ $invoice->invoice_id }}
@endif @if($invoice->issue_date)
{{ ucfirst(__('laravel-crm::lang.issued')) }}
{{ $invoice->issue_date->format($dateFormat) }}
@endif @if($invoice->due_date)
{{ ucfirst(__('laravel-crm::lang.due')) }}
{{ $invoice->due_date->format($dateFormat) }} @if(! $invoice->fully_paid_at && $invoice->due_date->diffinDays() > 0 && $invoice->due_date >= \Carbon\Carbon::now()->timezone($timezone)) ({{ ucfirst(__('laravel-crm::lang.due_in')) }} {{ $invoice->due_date->diffForHumans(false, true) }}) @elseif(! $invoice->fully_paid_at && $invoice->due_date->diffinDays() <= 0 && $invoice->due_date >= \Carbon\Carbon::now()->timezone($timezone)) ({{ ucfirst(__('laravel-crm::lang.due_tomorrow')) }} @elseif(! $invoice->fully_paid_at && $invoice->due_date < \Carbon\Carbon::now()->timezone($timezone)) ({{ $invoice->due_date->diffForHumans(false, true) }} {{ __('laravel-crm::lang.overdue') }}) @endif
@endif
{{ ucfirst(__('laravel-crm::lang.from')) }}
@if($contactDetails) {!! nl2br($contactDetails) !!} @else {{ $fromName }} @endif

@foreach($invoice->invoiceLines()->whereNotNull('product_id')->get() as $invoiceLine) @endforeach @if($invoice->discount > 0) @endif {{----}}
{{ ucfirst(__('laravel-crm::lang.item')) }} {{ ucfirst(__('laravel-crm::lang.price')) }} {{ ucfirst(__('laravel-crm::lang.quantity')) }} {{ $taxName }} {{ ucfirst(__('laravel-crm::lang.amount')) }} {{ ucfirst(__('laravel-crm::lang.comments')) }}
{{ $invoiceLine->product->name ?? null }} {{ money($invoiceLine->price ?? null, $invoiceLine->currency) }} {{ $invoiceLine->quantity }} {{ money($invoiceLine->tax_amount ?? null, $invoiceLine->currency) }} {{ money($invoiceLine->amount ?? null, $invoiceLine->currency) }} {{ $invoiceLine->comments }}
{{ ucfirst(__('laravel-crm::lang.sub_total')) }} {{ money($invoice->subtotal, $invoice->currency) }}
{{ ucfirst(__('laravel-crm::lang.discount')) }} {{ money($invoice->discount, $invoice->currency) }}
{{ $taxName }} {{ money($invoice->tax, $invoice->currency) }}
{{ ucfirst(__('laravel-crm::lang.adjustment')) }} {{ money($invoice->adjustments, $invoice->currency) }}
{{ ucfirst(__('laravel-crm::lang.total')) }} {{ money($invoice->total, $invoice->currency) }}

{{ ucfirst(__('laravel-crm::lang.terms')) }}
{!! nl2br($invoice->terms) !!}