@extends('backend.partials.master') @section('title') {{ ___('label.invoice') }} @endsection @section('maincontent') @if(hasPermission('accounting_create')) {{ ___('label.add') }} @endif @foreach($items as $r) @php $c = match($r->status) { 'paid' => 'success', 'overdue' => 'danger', 'refunded' => 'info', default => 'warning', }; $refundable = round((float) $r->paid_amount - (float) $r->refunded_amount, 2); @endphp {{ $r->invoice_no }} {{ $r->customer->name ?? $r->customer_name }} {{ $r->issue_date?->format('Y-m-d') }} {{ $r->due_date?->format('Y-m-d') }} {{ currency_symbol() }}{{ number_format($r->amount, 2) }} {{ currency_symbol() }}{{ number_format($r->paid_amount, 2) }} {{ currency_symbol() }}{{ number_format($r->refunded_amount, 2) }} {{ currency_symbol() }}{{ number_format($r->dueAmount(), 2) }} {{ admin_label(ucfirst($r->status)) }}
@if(hasPermission('accounting_update') && $refundable > 0) @endif @if(hasPermission('accounting_update')) @endif @if(hasPermission('accounting_delete')) @endif
@if(hasPermission('accounting_update') && $refundable > 0) {{-- Refunding never edits the invoice: it records a refund against it, which posts Dr Refunds / Cr cash, bank or wallet. --}} @endif @endforeach
@endsection @push('scripts') @endpush