{% extends "ui/templates/base/layout.html" %} {% block content %}

Accounting Engine · Phase 17

Common Native Tally Voucher Engine

Prepare one balanced accounting transaction and post it with the correct native Tally voucher type: Purchase, Sales, Receipt, Payment, Contra or Journal. Existing specialized accounting tools remain unchanged and can progressively feed this common engine.

{% if message %}
{{ message }}
{% endif %} {% if error %}
{{ error }}
{% endif %}
{% if selected_client and selected_tally_guid %}

Native Tally voucher selection

Purchase
Supplier bills, purchases, direct/indirect expenses and asset bills.
Sales
Customer invoices, sales and billed direct/indirect income.
Receipt
Money received into Bank/Cash from customers, income, loans or capital.
Payment
Money paid from Bank/Cash to suppliers, expenses, assets or loans.
Contra
Bank-to-bank, bank-to-cash and cash-to-bank transfers.
Journal
Accruals, provisions, depreciation, reclassification and adjustments.

Manual / Adjustment Voucher Draft

Automatic Bank/E-Way Bill preparation is available above. Use this manual form for adjustments, provisions, accruals, depreciation, reclassification, audit adjustments or unresolved source transactions. Every ledger must exist in the Chart of Accounts and Debit must equal Credit.

Voucher Lines

Add as many balanced Debit/Credit lines as needed.

{% for index in range(2) %}
{% endfor %}
Debit: ₹0.00 Credit: ₹0.00 Not balanced
{% elif selected_client %}
Refresh the client's Chart of Accounts and select a mapped Tally company before creating vouchers.
{% endif %} {% if selected_client %}

Voucher Review & Posting Queue

{{ total }} draft(s). Controlled flow: Draft → Reviewed → Approved → Tally Preflight → Post.

{% for draft in drafts %}
{{ draft.voucher_type }} {{ draft.status|replace('_',' ')|title }} Draft #{{ draft.id }}
{{ draft.company_name }} · {{ draft.voucher_date }}{% if draft.reference %} · Ref {{ draft.reference }}{% endif %}
Nature: {{ draft.business_nature|replace('_',' ')|title }} · Source: {{ draft.source_type }} · Audit use: {{ draft.audit_area or 'General Ledger' }}
{% if draft.narration %}
{{ draft.narration }}
{% endif %}
₹{{ '%.2f'|format(draft.total_debit) }}
{% if draft.tally_voucher_number %}
Tally voucher {{ draft.tally_voucher_number }}
{% endif %}
{% for line in draft.lines %} {% endfor %}
LedgerRoleDr/CrAmount
{{ line.ledger_name }} {{ role_labels.get(line.ledger_role_code, line.ledger_role_code) }} {{ line.dr_cr }} ₹{{ '%.2f'|format(line.amount) }}
{% if draft.items %}
Stock-item allocation
{% for item in draft.items %} {% endfor %}
Stock ItemHSNQtyUnitRateAmountAccounting Ledger
{{ item.stock_item_name }} {{ item.hsn_sac or '-' }} {{ item.quantity }} {{ item.unit or '-' }} {{ '%.4f'|format(item.rate) }} ₹{{ '%.2f'|format(item.amount) }} {{ item.accounting_ledger_name }}
{% endif %} {% if draft.last_error %}
{{ draft.last_error }}
{% endif %} {% if draft.status == 'preflight_ready' %}
Tally preflight completed. Ledger existence, balancing and duplicate checks completed.
{% endif %}
{% if draft.status == 'draft' %}
{% endif %} {% if draft.status == 'reviewed' %}
{% endif %} {% if draft.status in ['approved','preflight_failed'] %}
{% endif %} {% if draft.status == 'preflight_ready' %}
{% endif %} {% if draft.status not in ['posted','void','preflight_queued','preflight_claimed','posting_queued','posting_claimed'] %}
{% endif %}
{% else %}
No voucher drafts for this client yet.
{% endfor %}
{% if pages > 1 %}
Page {{ page }} of {{ pages }}
{% if page > 1 %}Previous{% endif %} {% if page < pages %}Next{% endif %}
{% endif %}
{% endif %}
{% if selected_client and selected_tally_guid %} {% endif %} {% endblock %}