6 lines
5.5 KiB
HTML
6 lines
5.5 KiB
HTML
{% extends "ui/templates/base/layout.html" %}
|
|
{% block content %}
|
|
<div class="space-y-6">
|
|
<div class="flex flex-wrap items-start justify-between gap-3"><div><p class="text-xs font-semibold uppercase tracking-[0.16em] text-brand-600">TDS & Withholding Tax</p><h1 class="mt-1 text-2xl font-semibold text-slate-900">TDS Entry & Liability</h1><p class="mt-1 text-sm text-slate-500">Calculate missing/short TDS, prepare structured ERP posting instructions, then post only after explicit user action. Prepared instructions are future-agent ready and idempotently referenced.</p></div><a href="/tools/tally" class="rounded-xl border px-3 py-2 text-sm font-semibold">Tally</a></div>{% if saved %}<div class="rounded-xl bg-emerald-50 p-3 text-sm text-emerald-800">TDS instruction updated.</div>{% endif %}{% if error %}<div class="rounded-xl bg-red-50 p-3 text-sm text-red-800">{{ error }}</div>{% endif %}<form method="get" class="rounded-2xl bg-white p-5 shadow-soft"><div class="grid gap-3 lg:grid-cols-4"><label class="text-sm">Client<select name="client_id" required class="mt-1 w-full rounded-xl border px-3 py-2"><option value="">Select client</option>{% for c in clients %}<option value="{{ c.id }}" {% if selected_client and c.id==selected_client.id %}selected{% endif %}>{{ c.client_name }}</option>{% endfor %}</select></label><label class="text-sm">Tally company GUID<input name="tally_guid" value="{{ tally_guid or '' }}" required class="mt-1 w-full rounded-xl border px-3 py-2" placeholder="Select/copy GUID from mapped/open company"></label><label class="text-sm">From<input type="date" name="date_from" value="{{ date_from }}" required class="mt-1 w-full rounded-xl border px-3 py-2"></label><label class="text-sm">To<input type="date" name="date_to" value="{{ date_to }}" required class="mt-1 w-full rounded-xl border px-3 py-2"></label></div><input type="hidden" name="run" value="1"><button class="mt-4 rounded-xl bg-brand-600 px-4 py-2 text-sm font-semibold text-white">Find TDS Liability</button></form>{% if review %}<div class="space-y-3"><h2 class="text-lg font-semibold">Unbooked / short TDS</h2>{% for x in review.transactions if x.liability>0 %}<form method="post" action="/tools/accounting/tds/liability/prepare" class="rounded-2xl bg-white p-4 shadow-soft"><input type="hidden" name="csrf_token" value="{{ csrf_token }}"><input type="hidden" name="client_id" value="{{ selected_client.id }}"><input type="hidden" name="tally_guid" value="{{ tally_guid }}"><input type="hidden" name="company_name" value="{{ review.company_name }}"><input type="hidden" name="rule_id" value="{{ x.rule_id }}"><input type="hidden" name="party_ledger" value="{{ x.party }}"><input type="hidden" name="source_voucher_number" value="{{ x.voucher_number }}"><input type="hidden" name="source_voucher_date" value="{{ x.date }}"><input type="hidden" name="taxable_base" value="{{ x.taxable_base }}"><input type="hidden" name="expected_tds" value="{{ x.expected_tds }}"><input type="hidden" name="actual_tds" value="{{ x.actual_tds }}"><input type="hidden" name="liability_amount" value="{{ x.liability }}"><input type="hidden" name="statutory_reference" value="{{ x.statutory_reference }}"><div class="grid gap-2 md:grid-cols-6"><div><div class="text-xs text-slate-500">Party</div><div class="font-semibold">{{ x.party }}</div></div><div><div class="text-xs text-slate-500">Voucher</div><div>{{ x.date }} · {{ x.voucher_number }}</div></div><div><div class="text-xs text-slate-500">Rule</div><div>{{ x.rule_name }}</div></div><div><div class="text-xs text-slate-500">Expected</div><div>{{ '%.2f'|format(x.expected_tds) }}</div></div><div><div class="text-xs text-slate-500">Already booked</div><div>{{ '%.2f'|format(x.actual_tds) }}</div></div><label class="text-sm">TDS ledger<input name="tds_ledger" value="TDS Payable" class="mt-1 w-full rounded-xl border px-2 py-1"></label></div><button class="mt-3 rounded-xl bg-brand-600 px-3 py-2 text-sm font-semibold text-white">Prepare ₹{{ '%.2f'|format(x.liability) }} Entry</button></form>{% else %}<div class="rounded-xl bg-emerald-50 p-3 text-sm text-emerald-800">No positive liability identified in this scan.</div>{% endfor %}</div>{% endif %}{% if instructions %}<div class="space-y-3"><h2 class="text-lg font-semibold">Prepared / Posted Instructions</h2>{% for i in instructions %}<div class="rounded-2xl bg-white p-4 shadow-soft"><div class="flex flex-wrap justify-between gap-3"><div><div class="font-semibold">{{ i.erp_reference }} · {{ i.party_ledger }}</div><div class="text-xs text-slate-500">{{ i.statutory_reference }} · Status {{ i.status }}</div></div><div class="text-lg font-semibold">₹{{ '%.2f'|format(i.liability_amount) }}</div></div>{% if i.status!='posted' %}<form method="post" action="/tools/accounting/tds/liability/{{ i.id }}/post" class="mt-3 flex flex-wrap gap-2"><input type="hidden" name="csrf_token" value="{{ csrf_token }}"><input type="hidden" name="tally_guid" value="{{ tally_guid or i.company_guid or '' }}"><input type="date" name="voucher_date" value="{{ i.source_voucher_date or '' }}" required class="rounded-xl border px-3 py-2 text-sm"><input name="tds_ledger" value="{{ i.tds_ledger }}" required class="rounded-xl border px-3 py-2 text-sm"><button class="rounded-xl bg-slate-900 px-3 py-2 text-sm font-semibold text-white">Post Approved Entry to Tally</button></form>{% else %}<div class="mt-2 text-sm text-emerald-700">Posted to Tally{% if i.tally_voucher_id %} · Voucher {{ i.tally_voucher_id }}{% endif %}</div>{% endif %}</div>{% endfor %}</div>{% endif %}</div>
|
|
{% endblock %}
|