@extends('layouts.admin') @section('title', 'Invoice ' . $invoice->invoice_no) @section('content') @php $state = $invoice->state(); $badges = ['paid' => 'success', 'partial' => 'warning', 'unpaid' => 'danger', 'overdue' => 'danger', 'draft' => 'secondary', 'cancelled' => 'secondary']; $money = fn ($amount) => $invoice->currency . ' ' . number_format((float) $amount, 2); @endphp
Invoice {{ $invoice->invoice_no }} {{ ucfirst($state) }}
Back Edit Download Invoice PDF
@csrf
@csrf @method('DELETE')
Billed To: {{ $invoice->bill_to_name }}
Email: {{ $invoice->bill_to_email ?: '-' }}
Phone: {{ $invoice->bill_to_phone ?: '-' }}
Address: {{ $invoice->bill_to_address ?: '-' }}
Customer Record: @if ($invoice->customer) {{ $invoice->customer->full_name }} @else - @endif
Invoice For: {{ $invoice->title ?: '-' }}
Issued: {{ $invoice->issue_date->format('d M Y') }}
Payment Due: {{ $invoice->due_date?->format('d M Y') ?: 'On receipt' }}
Created By: {{ $invoice->creator?->name ?: '-' }}

Line Items
@foreach ($invoice->items as $item) @endforeach @if ((float) $invoice->discount_amount > 0) @endif @if ((float) $invoice->tax_amount > 0) @endif
# Description Qty Unit Price Amount
{{ $loop->iteration }} {{ $item->description }}@if ($item->details)
{!! nl2br(e($item->details)) !!}@endif
{{ (float) $item->quantity }} {{ number_format($item->unit_price, 2) }} {{ number_format($item->amount, 2) }}
Subtotal{{ $money($invoice->sub_total) }}
Discount- {{ $money($invoice->discount_amount) }}
Tax ({{ (float) $invoice->tax_percent }}%){{ $money($invoice->tax_amount) }}
Total{{ $money($invoice->total_amount) }}
Amount received{{ $money($invoice->paid_amount) }}
Balance due{{ $money($state === 'cancelled' ? 0 : $invoice->dueAmount()) }}
@if ($invoice->notes)

Notes:
{!! nl2br(e($invoice->notes)) !!}

@endif @if ($invoice->terms)

Terms & Conditions:
{!! nl2br(e($invoice->terms)) !!}

@endif
@endsection