{% extends "ui/templates/base/layout.html" %}
{% block content %}<div class="space-y-6"><div class="flex items-center justify-between"><h1 class="text-2xl font-semibold">Platform Invoices</h1>{% if can_create %}<a href="/platform-billing/invoices/new" class="rounded-xl bg-brand-600 px-4 py-2 text-sm font-semibold text-white">New Platform Invoice</a>{% endif %}</div><form method="get" class="rounded-2xl border bg-white p-4 shadow-soft"><input name="q" value="{{ q or '' }}" placeholder="Search invoice/account" class="w-full rounded-xl border px-3 py-2 text-sm" /></form><div class="overflow-hidden rounded-2xl border bg-white shadow-soft"><table class="min-w-full text-sm"><thead class="bg-slate-50 text-left"><tr><th class="px-4 py-3">Invoice No</th><th class="px-4 py-3">Date</th><th class="px-4 py-3">Account</th><th class="px-4 py-3 text-right">Total</th><th class="px-4 py-3">Status</th><th class="px-4 py-3"></th></tr></thead><tbody class="divide-y">{% for row in rows %}<tr><td class="px-4 py-3 font-medium">{{ row.invoice_no }}</td><td class="px-4 py-3">{{ row.invoice_date }}</td><td class="px-4 py-3">{{ row.account.display_name if row.account else row.account_id }}</td><td class="px-4 py-3 text-right">₹ {{ '%.2f'|format(row.total_amount or 0) }}</td><td class="px-4 py-3">{{ row.status }}</td><td class="px-4 py-3 text-right"><a href="/platform-billing/invoices/{{ row.id }}" class="text-brand-600 hover:underline">View</a></td></tr>{% else %}<tr><td colspan="6" class="px-4 py-8 text-center text-slate-500">No platform invoices found.</td></tr>{% endfor %}</tbody></table></div></div>{% endblock %}
