{{-- HEADER --}} {{ $invoice->title }} @if($invoice->sent != 1) @endif @if($invoice->fully_paid_at) @elseif(! $invoice->fully_paid_at && $invoice->due_date->isToday()) @elseif(! $invoice->fully_paid_at && $invoice->due_date->isTomorrow()) @elseif(! $invoice->fully_paid_at && $invoice->due_date->isYesterday()) @elseif(! $invoice->fully_paid_at && abs($invoice->due_date->diffinDays()) > 0 && $invoice->due_date >= \Carbon\Carbon::now()->timezone($timezone)) @elseif(! $invoice->fully_paid_at && abs($invoice->due_date->diffinDays()) > 0 && $invoice->due_date < \Carbon\Carbon::now()->timezone($timezone)) @endif @if($invoice->pipelineStage) @endif {{-- ACTIONS --}} | {{--@php (! \VentureDrake\LaravelCrm\Http\Helpers\CheckAmount\subTotal($invoice)) ? $subTotalError = true : $subTotalError = false; (! \VentureDrake\LaravelCrm\Http\Helpers\CheckAmount\tax($invoice)) ? $taxError = true : $taxError = false; (! \VentureDrake\LaravelCrm\Http\Helpers\CheckAmount\total($invoice)) ? $totalError = true : $totalError = false; @endphp @can('edit crm invoices') @if($subTotalError || $taxError || $totalError) @else @if(! $invoice->deliveryComplete()) @haspurchaseinvoicesenabled @endhaspurchaseinvoicesenabled @endif @if(! $invoice->invoiceComplete()) @hasinvoicesenabled @endhasinvoicesenabled @endif @if(! $invoice->deliveryComplete()) @hasdeliveriesenabled @endhasdeliveriesenabled @endif @endif @endcan @can('view crm invoices') @if(! $subTotalError && ! $taxError && ! $totalError) @endif @endcan--}} @if(! $invoice->xeroInvoice) @if(! $invoice->fully_paid_at) @endif @endif @can('view crm invoices') @endcan | | @if(! $invoice->xeroInvoice) @if($invoice->amount_paid <= 0) @can('edit crm invoices') @endcan @can('delete crm invoices') @endcan @endif @endif @if($invoice->xeroInvoice) @endif
{{ ucfirst(__('laravel-crm::lang.created')) }} {{ $invoice->created_at->diffForHumans() }}
{{ ucfirst(__('laravel-crm::lang.number')) }} {{ $invoice->invoice_id }}
{{ ucfirst(__('laravel-crm::lang.reference')) }} {{ $invoice->reference }}
{{ ucwords(__('laravel-crm::lang.issue_date')) }} {{ $invoice->issue_date ? $invoice->issue_date->format(app('laravel-crm.settings')->get('date_format', 'Y-m-d')) : null }}
{{ ucwords(__('laravel-crm::lang.due_date')) }} {{ $invoice->due_date ? $invoice->due_date->format(app('laravel-crm.settings')->get('date_format', 'Y-m-d')) : null }}
{{ ucfirst(__('laravel-crm::lang.terms')) }} {{ $invoice->terms }}
@if($invoice->person){{ $invoice->person->name }}@endif
@if($email) {{ $email->address }} ({{ ucfirst($email->type) }}) @endif
@if($phone) {{ $phone->number }} ({{ ucfirst($phone->type) }}) @endif
@if($invoice->organization){{ $invoice->organization->name }}@endif
{{ ($address) ? \VentureDrake\LaravelCrm\Http\Helpers\AddressLine\addressSingleLine($address) : null }}
@foreach($invoice->invoiceLines()->whereNotNull('product_id')->orderBy('order', 'asc')->orderBy('created_at', 'asc')->get() as $invoiceProduct) @if($invoiceProduct->comments) @endif @endforeach
{{ ucfirst(__('laravel-crm::lang.item')) }} {{ ucfirst(__('laravel-crm::lang.price')) }} {{ ucfirst(__('laravel-crm::lang.quantity')) }} {{ $taxName }} {{ ucfirst(__('laravel-crm::lang.amount')) }}
{{ $invoiceProduct->product->name }} @if($invoiceProduct->product->code)
{{ $invoiceProduct->product->code }} @endif
{{ money($invoiceProduct->price ?? null, $invoiceProduct->currency) }} {{ $invoiceProduct->quantity }} {{ money($invoiceProduct->tax_amount ?? null, $invoiceProduct->currency) }} @if(! \VentureDrake\LaravelCrm\Http\Helpers\CheckAmount\lineAmount($invoiceProduct)) {{ money($invoiceProduct->amount ?? null, $invoiceProduct->currency) }} @else {{ money($invoiceProduct->amount ?? null, $invoiceProduct->currency) }} @endif
{{ ucfirst(__('laravel-crm::lang.comments')) }}
{{ $invoiceProduct->comments }}
{{ ucfirst(__('laravel-crm::lang.sub_total')) }} {{ money($invoice->subtotal, $invoice->currency) }}
{{ ucfirst(__('laravel-crm::lang.tax')) }} {{ money($invoice->tax, $invoice->currency) }}
{{ ucfirst(__('laravel-crm::lang.total')) }} {{ money($invoice->total, $invoice->currency) }}