@extends('portal.layout') @section('title', 'Invoice ' . $sale->invoice_no) @section('content')

Invoice {{ $sale->invoice_no }}

Date: {{ displayDate($sale->created_at) }}

Back

Total Amount

{{ number_format($sale->total_amount, 2) }}

Paid Amount

{{ number_format($sale->paid_amount, 2) }}

@php $remainingInvoice = $sale->remaining_amount; @endphp

Remaining

{{ number_format($remainingInvoice, 2) }}

Status

@if($sale->payment_status === 'paid') Paid @elseif($sale->payment_status === 'partial') Partial @else Unpaid @endif @if($gatewayEnabled && $sale->payment_status !== 'paid') Pay Now @endif

Items

@foreach($sale->items as $item) @endforeach @if($sale->discount > 0) @endif @if($sale->tax > 0) @endif
Product Price Qty Total
{{ $item->product->name ?? 'N/A' }} @if($item->is_promo) PROMO @endif @if($item->is_promo && $item->regular_price) {{ number_format($item->regular_price, 2) }} @endif {{ number_format($item->price, 2) }} {{ $item->quantity }} {{ number_format($item->subtotal, 2) }}
Subtotal: {{ number_format($sale->subtotal, 2) }}
Discount: -{{ number_format($sale->discount, 2) }}
Tax: {{ number_format($sale->tax, 2) }}
Total: {{ number_format($sale->total_amount, 2) }}
@if($sale->payments->count())

Payment History

@foreach($sale->payments as $payment) @endforeach
Date Amount Method
{{ displayDate($payment->created_at) }} {{ number_format($payment->amount, 2) }} {{ $payment->payment_method ?? 'N/A' }}
@endif
@endsection