@extends('layouts.admin') @section('title', 'Invoice Details') @section('subtitle', $invoice->invoice_number) @section('actions')
🖨️ Print Receipt @if($invoice->status != 'refunded') ↩️ Process Refund @endif
@endsection @section('content')
{{-- Main Info --}}
{{-- Items --}}

Invoice Items

@foreach($invoice->items as $item) @endforeach
Product Qty Unit Price Discount Total
{{ $item->product_name }}

{{ $item->product_barcode }}

{{ $item->quantity }} LKR {{ number_format($item->unit_price, 2) }} -LKR {{ number_format($item->discount, 2) }} LKR {{ number_format($item->line_total, 2) }}
{{-- Payments --}}

Payments

@forelse($invoice->payments as $payment)
{{ strtoupper($payment->method) }} @if($payment->reference)

Ref: {{ $payment->reference }}

@endif
+ LKR {{ number_format($payment->amount, 2) }}
@empty

No payment records

@endforelse
{{-- Refunds --}} @if($invoice->refunds->count() > 0)

Refunds

@foreach($invoice->refunds as $refund)
{{ ucfirst($refund->refund_type) }} Refund

{{ $refund->reason }}

- LKR {{ number_format($refund->amount, 2) }}

{{ $refund->created_at->format('M d, H:i') }}

@endforeach
@endif
{{-- Sidebar --}}
{{-- Summary --}}

Summary

Subtotal LKR {{ number_format($invoice->subtotal, 2) }}
Item Discounts -LKR {{ number_format($invoice->item_discount, 2) }}
Bill Discount -LKR {{ number_format($invoice->bill_discount, 2) }}
Tax LKR {{ number_format($invoice->tax_amount, 2) }}
Total LKR {{ number_format($invoice->total, 2) }}
{{-- Details --}}

Details

Status @php $statusColors = [ 'completed' => 'bg-green-50 text-green-600', 'pending' => 'bg-yellow-50 text-yellow-600', 'refunded' => 'bg-red-50 text-red-600', ]; @endphp {{ ucfirst($invoice->status) }}
Date {{ $invoice->created_at->format('M d, Y H:i') }}
Cashier {{ $invoice->user->name ?? 'N/A' }}
Branch {{ $invoice->branch->name ?? 'N/A' }}
@if($invoice->customer_name)
Customer {{ $invoice->customer_name }}
@endif @if($invoice->customer_phone)
Phone {{ $invoice->customer_phone }}
@endif
@endsection