@extends('layouts.admin') @section('title', 'Preview Invoice') @section('page-title', 'Design & Finalize Invoice') @section('content')

Design & Finalize Invoice

Invoice #{{ $data['invoice_number'] ?? 'INV-2024-001' }} • Draft

check_circle Details Design & Share
@if(isset($templateView) && view()->exists($templateView)) @include($templateView, [ 'invoice' => $invoice ?? null, 'invoiceData' => $data ?? [], 'customer' => $customer ?? null, 'companySettings' => $companySettings ?? null, 'currency' => $selectedCurrency ?? null, 'signature' => $signature ?? null, 'items' => $items ?? [], 'calculatedTotals' => [ 'subtotal' => $subtotal ?? 0, 'tax_amount' => $taxAmount ?? 0, 'discount' => $discount ?? 0, 'total' => $total ?? 0, 'paid_amount' => $paidAmount ?? 0, 'balance_due' => $balanceDue ?? 0, ], 'showWatermark' => false, ]) @else
@if($companySettings->company_logo && \Illuminate\Support\Facades\Storage::disk('public')->exists($companySettings->company_logo)) Company Logo @else
{{ strtoupper(substr($companySettings->company_name ?? 'FA', 0, 2)) }}
@endif

{{ $companySettings->company_name ?? config('app.name', 'ProInvoice') }}

@if($companySettings->company_address)

{{ $companySettings->company_address }}

@endif @if($companySettings->company_city || $companySettings->company_state || $companySettings->company_zip)

{{ trim(($companySettings->company_city ?? '') . ', ' . ($companySettings->company_state ?? '') . ' ' . ($companySettings->company_zip ?? ''), ', ') }}

@endif

INVOICE

#{{ $data['invoice_number'] ?? 'INV-2024-001' }}

Issue Date: {{ \Carbon\Carbon::parse($data['issue_date'] ?? now())->format('M d, Y') }}
Due Date: {{ \Carbon\Carbon::parse($data['due_date'] ?? now()->addDays(30))->format('M d, Y') }}
@if($customer)

Bill To

{{ $customer->name }}

@if($customer->email)

{{ $customer->email }}

@endif @if($customer->phone)

{{ $customer->phone }}

@endif @if($customer->address)

{{ $customer->address }}

@endif
@endif
@forelse($items as $item) @empty @endforelse
Description Qty Price Total

{{ $item['description'] }}

@if(!empty($item['notes']))

{{ $item['notes'] }}

@endif
{{ number_format($item['quantity'], 2) }} {{ $selectedCurrency->symbol ?? '$' }}{{ number_format($item['unit_price'], 2) }} {{ $selectedCurrency->symbol ?? '$' }}{{ number_format($item['total'], 2) }}
No items added
Subtotal {{ $selectedCurrency->symbol ?? '$' }}{{ number_format($subtotal, 2) }}
@if($taxAmount > 0)
Tax {{ $selectedCurrency->symbol ?? '$' }}{{ number_format($taxAmount, 2) }}
@endif @if($discount > 0)
Discount -{{ $selectedCurrency->symbol ?? '$' }}{{ number_format($discount, 2) }}
@endif
Total Due {{ $selectedCurrency->symbol ?? '$' }}{{ number_format($balanceDue, 2) }}
@if(empty($data['signature_id']))
@endif
@if(!empty($data['signature_id'])) @php $signature = isset($signatures) ? $signatures->where('id', $data['signature_id'])->first() : null; @endphp @if($signature && $signature->content && \Illuminate\Support\Facades\Storage::disk('public')->exists($signature->content)) Signature @endif @endif

AUTHORIZED SIGNATURE

Powered by {{ config('app.name', 'ProInvoice') }}

@endif
@if(isset($isExisting) && $isExisting) arrow_back Back to Invoices @else arrow_back Back to Details @endif
@if(!isset($isExisting) || !$isExisting)
@csrf @foreach($data as $key => $value) @continue(in_array($key, ['_token', '_method'], true)) @if(is_array($value)) @foreach($value as $subKey => $subValue) @if(is_array($subValue)) @foreach($subValue as $itemKey => $itemValue) @endforeach @else @endif @endforeach @else @endif @endforeach
@csrf @foreach($data as $key => $value) @continue(in_array($key, ['_token', '_method'], true)) @if(is_array($value)) @foreach($value as $subKey => $subValue) @if(is_array($subValue)) @foreach($subValue as $itemKey => $itemValue) @endforeach @else @endif @endforeach @else @endif @endforeach
@endif
@endsection