{% extends "ui/templates/base/layout.html" %}
{% block content %}<div class="max-w-4xl space-y-6"><h1 class="text-2xl font-semibold">New Platform Invoice</h1><form method="post" class="space-y-4 rounded-2xl border bg-white p-5 shadow-soft"><input type="hidden" name="csrf_token" value="{{ csrf_token }}" /><div class="grid gap-4 md:grid-cols-2"><label class="text-sm">Account<select name="account_id" required class="mt-1 w-full rounded-xl border px-3 py-2">{% for a in accounts %}<option value="{{ a.id }}">{{ a.display_name }} ({{ a.account_type }})</option>{% endfor %}</select></label><label class="text-sm">Subscription optional<select name="subscription_id" class="mt-1 w-full rounded-xl border px-3 py-2"><option value="">Manual invoice</option>{% for s in subscriptions %}<option value="{{ s.id }}">{{ s.subscription_code }} - {{ s.account.display_name if s.account else s.account_id }}</option>{% endfor %}</select></label><label class="text-sm">Invoice No<input name="invoice_no" required class="mt-1 w-full rounded-xl border px-3 py-2" /></label><label class="text-sm">Tax Type<select name="tax_type" class="mt-1 w-full rounded-xl border px-3 py-2">{% for x in tax_types %}<option value="{{ x }}">{{ x }}</option>{% endfor %}</select></label><label class="text-sm">Invoice Date<input type="date" name="invoice_date" required class="mt-1 w-full rounded-xl border px-3 py-2" /></label><label class="text-sm">Due Date<input type="date" name="due_date" class="mt-1 w-full rounded-xl border px-3 py-2" /></label><label class="text-sm">Period From<input type="date" name="billing_period_from" class="mt-1 w-full rounded-xl border px-3 py-2" /></label><label class="text-sm">Period To<input type="date" name="billing_period_to" class="mt-1 w-full rounded-xl border px-3 py-2" /></label></div><div class="rounded-2xl border bg-slate-50 p-4"><h2 class="font-semibold">Invoice Line</h2><div class="mt-3 grid gap-4 md:grid-cols-2"><label class="text-sm">Charge Type<select name="charge_type" class="mt-1 w-full rounded-xl border px-3 py-2">{% for x in charge_types %}<option value="{{ x }}">{{ x }}</option>{% endfor %}</select></label><label class="text-sm">GST Rate<input name="gst_rate" value="18" class="mt-1 w-full rounded-xl border px-3 py-2" /></label><label class="text-sm md:col-span-2">Description<input name="description" required class="mt-1 w-full rounded-xl border px-3 py-2" /></label><label class="text-sm">Quantity<input name="quantity" value="1" class="mt-1 w-full rounded-xl border px-3 py-2" /></label><label class="text-sm">Rate<input name="rate" value="0" class="mt-1 w-full rounded-xl border px-3 py-2" /></label><label class="text-sm">Discount<input name="discount_amount" value="0" class="mt-1 w-full rounded-xl border px-3 py-2" /></label></div></div><label class="block text-sm">Notes<textarea name="notes" class="mt-1 w-full rounded-xl border px-3 py-2"></textarea></label><button class="rounded-xl bg-brand-600 px-4 py-2 text-sm font-semibold text-white">Create Draft Invoice</button></form></div>{% endblock %}
