@component('laravel-crm::components.card') @component('laravel-crm::components.card-header') @slot('title') {{ $invoice->title }} @if($invoice->sent == 1) {{ ucfirst(__('laravel-crm::lang.sent')) }} @endif @if($invoice->fully_paid_at) {{ ucfirst(__('laravel-crm::lang.paid')) }} @elseif(! $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->diffinDays() > 0 && $invoice->due_date < \Carbon\Carbon::now()->timezone($timezone)) {{ $invoice->due_date->diffForHumans(false, true) }} {{ ucfirst(__('laravel-crm::lang.overdue')) }} @endif @endslot @slot('actions') @include('laravel-crm::partials.return-button',[ 'model' => $invoice, 'route' => 'invoices' ]) | @livewire('send-invoice',[ 'invoice' => $invoice ]) {{ ucfirst(__('laravel-crm::lang.download')) }} @if(! $invoice->xeroInvoice) @if(! $invoice->fully_paid_at) @livewire('pay-invoice',[ 'invoice' => $invoice ]) @endif @endif @include('laravel-crm::partials.navs.activities') @if($invoice->amount_paid <= 0) | @if(! $invoice->xeroInvoice) @can('edit crm invoices') @endcan @can('delete crm invoices')
{{ method_field('DELETE') }} {{ csrf_field() }}
@endcan @endif @endif @if($invoice->xeroInvoice) @endif
@endslot @endcomponent @component('laravel-crm::components.card-body')
{{ ucfirst(__('laravel-crm::lang.details')) }}

Number
{{ $invoice->xeroInvoice->number ?? $invoice->invoice_id }}
Reference
{{ $invoice->xeroInvoice->reference ?? $invoice->reference }}
@hasordersenabled @if($invoice->order)
Order
{{ $invoice->order->order_id }}
@endif @endhasordersenabled
Issue Date
{{ ($invoice->issue_date) ? $invoice->issue_date->format($dateFormat) : null }}
Due Date
{{ ($invoice->due_date) ? $invoice->due_date->format($dateFormat) : null }}
Terms
{{ $invoice->terms }}
{{ ucfirst(__('laravel-crm::lang.organization')) }}

@if($invoice->organisation){{ $invoice->organisation->name }}@endif

{{ ($organisation_address) ? \VentureDrake\LaravelCrm\Http\Helpers\AddressLine\addressSingleLine($organisation_address) : null }}

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

@if($invoice->person){{ $invoice->person->name }}@endif

@isset($email)

{{ $email->address }} ({{ ucfirst($email->type) }})

@endisset @isset($phone)

{{ $phone->number }} ({{ ucfirst($phone->type) }})

@endisset @can('view crm products')
{{ ucfirst(__('laravel-crm::lang.invoice_lines')) }} ({{ $invoice->invoiceLines->count() }})
@foreach($invoice->invoiceLines()->whereNotNull('product_id')->get() as $invoiceLine) @if($invoiceLine->comments) @endif @endforeach
{{ ucfirst(__('laravel-crm::lang.item')) }} {{ ucfirst(__('laravel-crm::lang.price')) }} {{ ucfirst(__('laravel-crm::lang.quantity')) }} {{ $taxName }} {{ ucfirst(__('laravel-crm::lang.amount')) }}
{{ $invoiceLine->product->name }} @if($invoiceLine->product->code)
{{ $invoiceLine->product->code }} @endif
{{ money($invoiceLine->price ?? null, $invoiceLine->currency) }} {{ $invoiceLine->quantity }} {{ money($invoiceLine->tax_amount ?? null, $invoiceLine->currency) }} {{ money($invoiceLine->amount ?? null, $invoiceLine->currency) }}
{{ ucfirst(__('laravel-crm::lang.comments')) }}
{{ $invoiceLine->comments }}
{{ ucfirst(__('laravel-crm::lang.sub_total')) }} {{ money($invoice->subtotal, $invoice->currency) }}
{{ $taxName }} {{ money($invoice->tax, $invoice->currency) }}
{{ ucfirst(__('laravel-crm::lang.total')) }} {{ money($invoice->total, $invoice->currency) }}
@endcan
@include('laravel-crm::partials.activities', [ 'model' => $invoice ])
@endcomponent @endcomponent