@php // Read permissions once so the invoice actions stay easy to follow. $canCreateInvoice = \App\Support\AdminAccess::canAction('invoices', 'create'); $canViewInvoice = \App\Support\AdminAccess::canAction('invoices', 'view'); $canEditInvoice = \App\Support\AdminAccess::canAction('invoices', 'edit'); $canDeleteInvoice = \App\Support\AdminAccess::canAction('invoices', 'delete'); @endphp
{{ __('Invoice Management') }}
@if($canCreateInvoice) {{ __('New Sale') }} @endif
@forelse($invoices as $invoice) @empty @endforelse
{{ __('Invoice #') }} {{ __('Customer') }} {{ __('Date') }} {{ __('Total Amount') }} {{ __('Paid') }} {{ __('Status') }} {{ __('Actions') }}
#{{ $invoice->invoice_number }} @if(! empty($invoice->is_exchange)) {{ __('Exchange') }} @elseif(! empty($invoice->exchange_invoice_number)) {{ __('Exchange Sale') }} @endif {{ $invoice->customer->display_name ?? __('Walking Customer') }} {{ $invoice->created_at->format('d M, Y') }} Rs. {{ number_format($invoice->total, 0) }} Rs. {{ number_format($invoice->paid_amount, 0) }} @php $invoiceDisplayStatus = $this->resolveInvoiceDisplayStatus($invoice); @endphp @if($invoiceDisplayStatus == 'paid') {{ __('Fully Paid') }} @elseif($invoiceDisplayStatus == 'unpaid') {{ __('Unpaid') }} @else {{ __('Partial') }} @endif @if(! empty($invoice->is_exchange))
{{ __('Marked as exchanged') }}
@elseif(! empty($invoice->exchange_invoice_number))
{{ __('Created in exchange') }}
@endif
@if($canViewInvoice) @endif @if($canEditInvoice) @endif @if($canDeleteInvoice) @endif

Koi invoice nahi mili.

@if($showViewModal && $selectedInvoice) @php $invoicePaidAmount = (float) ($selectedInvoice->paid_amount ?? 0); $invoiceChangeAmount = max((float) ($selectedInvoice->change_amount ?? 0), 0); $invoiceDueAdjustedAmount = max((float) ($selectedInvoice->due_adjusted_amount ?? 0), 0); $invoiceTenderedCash = $invoicePaidAmount + $invoiceChangeAmount + $invoiceDueAdjustedAmount; $invoiceRemainingBalance = max((float) $selectedInvoice->total - $invoicePaidAmount, 0); $selectedInvoiceStatus = $this->resolveInvoiceDisplayStatus($selectedInvoice); @endphp
{{ __('Invoice Number') }}
#{{ $selectedInvoice->invoice_number }} @if(! empty($selectedInvoice->is_exchange)) {{ __('Exchange') }} @elseif(! empty($selectedInvoice->exchange_invoice_number)) {{ __('Exchange Sale') }} @endif
{{ __('Date:') }} {{ $selectedInvoice->created_at->format('d M, Y') }}
{{ __('Time:') }} {{ $selectedInvoice->created_at->format('h:i A') }}
@if(! empty($selectedInvoice->exchange_invoice_number))
{{ __('Exchange Invoice:') }} #{{ $selectedInvoice->exchange_invoice_number }}
@endif @if((float) ($selectedInvoice->exchange_credit_amount ?? 0) > 0)
{{ __('Exchange Credit:') }} PKR {{ number_format((float) $selectedInvoice->exchange_credit_amount, 2) }}
@endif
{{ __('Customer') }}
{{ $selectedInvoice->customer->display_name ?? __('Walk-in Customer') }}
{{ $selectedInvoice->customer->phone ?? __('Phone not available') }}
{{ $selectedInvoice->customer->address ?? __('Address not available') }}
{{ __('Payment Account') }}
{{ $selectedInvoice->account->account_name ?? __('No account selected') }}
{{ $selectedInvoice->account->account_type ?? __('N/A') }}
{{ __('Reference:') }} {{ $selectedInvoice->reference ?: __('N/A') }}
@forelse($selectedInvoice->items as $item) @empty @endforelse
{{ __('Product') }} {{ __('Qty') }} {{ __('Price') }} {{ __('Total') }}
{{ $item->product_name }} {{ number_format($item->qty, 2) }} Rs. {{ number_format($item->price, 2) }} Rs. {{ number_format($item->total, 2) }}
{{ __('No invoice items found.') }}
{{ __('Payment Status') }}
@if($selectedInvoiceStatus === 'paid') {{ __('Fully Paid') }} @elseif($selectedInvoiceStatus === 'unpaid') {{ __('Unpaid') }} @else {{ __('Partial Payment') }} @endif
{{ __('This invoice was generated from the POS checkout screen.') }}
{{ __('Sub Total') }} Rs. {{ number_format($selectedInvoice->subtotal, 2) }}
{{ __('Discount') }} Rs. {{ number_format($selectedInvoice->discount, 2) }}
{{ __('Other Charges') }} Rs. {{ number_format((float) ($selectedInvoice->other_charges_total ?? 0), 2) }}
@foreach($selectedInvoice->charges as $charge)
+ {{ $charge->name }} Rs. {{ number_format((float) $charge->amount, 2) }}
@endforeach
{{ __('Paid Amount') }} Rs. {{ number_format($invoiceTenderedCash, 2) }}
@if($invoiceDueAdjustedAmount > 0)
{{ __('Due Adjustment') }} Rs. {{ number_format($invoiceDueAdjustedAmount, 2) }}
@endif @if($invoiceChangeAmount > 0)
{{ __('Change') }} Rs. {{ number_format($invoiceChangeAmount, 2) }}
@endif
{{ __('Due') }} Rs. {{ number_format($invoiceRemainingBalance, 2) }}
{{ __('Grand Total') }} Rs. {{ number_format($selectedInvoice->total, 2) }}
@endif