@extends('layouts.admin') @section('title', 'Invoice View') @section('content')

Invoice #{{ $sale->id }}

Invoice Actions

Print Invoice Edit Sale @include('whatsapp.send-button', [ 'type' => 'invoice', 'data' => $sale, 'size' => 'md' ]) Back to Sales

Invoice Details

{{ config('app.name', 'POS System') }}
{{ config('app.name', 'POS System') }}
123 Business Street
Business City, BC 12345
Phone: (123) 456-7890
Email: info@possystem.com
Invoice Information

Invoice #: {{ $sale->id }}
Date: {{ $sale->created_at->format('M d, Y h:i A') }}
Status: @if($sale->payment_status == 'paid') Paid @elseif($sale->payment_status == 'partial') Partial Payment @else Unpaid @endif

Bill To:
@if($sale->customer)
{{ $sale->customer->name }}
@if($sale->customer->address) {{ $sale->customer->address }}
@endif @if($sale->customer->phone) Phone: {{ $sale->customer->phone }}
@endif @if($sale->customer->email) Email: {{ $sale->customer->email }} @endif
@else

Walk-in Customer

@endif
Payment Information

Payment Method: {{ ucfirst($sale->payment_method ?? 'Cash') }}
Total Amount: ${{ number_format($sale->total_amount, 2) }}
Paid Amount: ${{ number_format($sale->paid_amount ?? 0, 2) }}
@if($sale->due_amount > 0) Due Amount: ${{ number_format($sale->due_amount, 2) }} @endif

@forelse($sale->items as $index => $item) @empty @endforelse @if($sale->tax_amount > 0) @endif @if($sale->discount_amount > 0) @endif
# Product Description Qty Unit Price Total
{{ $index + 1 }} {{ $item->product_name ?? $item->product->name ?? 'Unknown Product' }} @if($item->product && $item->product->ProductBrand)
Brand: {{ $item->product->ProductBrand->name }} @endif
@if($item->product && $item->product->description) {{ Str::limit($item->product->description, 100) }} @else No description @endif {{ $item->quantity }} ${{ number_format($item->unit_price, 2) }} ${{ number_format($item->total_price, 2) }}
No items found
Subtotal: ${{ number_format($sale->subtotal ?? $sale->total_amount, 2) }}
Tax: ${{ number_format($sale->tax_amount, 2) }}
Discount: -${{ number_format($sale->discount_amount, 2) }}
Total Amount: ${{ number_format($sale->total_amount, 2) }}
@if($sale->notes)
Notes:

{{ $sale->notes }}

@endif
Terms & Conditions:

Thank you for your business! Payment is due within 30 days of invoice date. A late fee of 1.5% per month will be applied to overdue accounts.

@endsection @section('scripts') @endsection @section('styles') @endsection