@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) {{ ___('admin.refund_e17c8a') }} @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. --}} @csrf {{ ___('admin.refund_e17c8a') }} {{ $r->invoice_no }} × {{ ___('admin.amount_43dc85') }} {{ ___('admin.received_27548c') }} {{ currency_symbol() }}{{ number_format($r->paid_amount, 2) }}{{ ___('admin.already_refunded_eb9a76') }} {{ currency_symbol() }}{{ number_format($r->refunded_amount, 2) }}. {{ ___('admin.refund_to_43e75f') }} {{ ___('admin.cash_758ec5') }} {{ ___('admin.bank_9e8998') }} customer_id)>{{ ___('admin.customer_wallet_ea7077') }} {{ ___('admin.reason_f219cc') }} @endif @endforeach @endsection @push('scripts') @endpush