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

Tools · Accounting Intelligence

Controlled Tally Purchase Posting

Phase 10 posts only accountant-reviewed purchases. Every voucher must pass workstation preflight, open-company verification, Tally ledger validation, duplicate screening and a durable Phase 2 idempotent job. Financial write jobs are never automatically retried.

{% if message %}
{{ message }}
{% endif %} {% if error %}
{{ error }}
{% endif %}
Controlled write boundary: Phase 10 never creates Tally ledgers or stock items. If a creditor, purchase ledger or GST input ledger cannot be verified in the currently opened Tally company, posting is blocked.
{% if selected_client %} {% endif %}
{% if selected_client and result %}

Reviewed Purchase Queue

{{ result.total }} reviewed purchase(s) · page {{ result.page }} of {{ result.pages }}

Refresh Job Status
{% for tuple_row in result.rows %} {% set row = tuple_row[0] %} {% set attempt = attempts.get(row.id) %} {% set choice = choices.get(row.id) %}

{{ row.supplier_name or row.supplier_gstin or 'Supplier' }}

{% if row.posting_status == 'posted' or (attempt and attempt.status == 'posted') %} Posted {% elif attempt %} {{ attempt.status|replace('_',' ')|title }} {% else %} Not started {% endif %}
GSTIN: {{ row.supplier_gstin or '-' }}
Invoice: {{ row.invoice_number }} · {{ row.invoice_date }}
Taxable: ₹{{ '%.2f'|format(row.taxable_value) }}
Invoice Value: ₹{{ '%.2f'|format(row.invoice_value) }}
Reviewed treatment
{{ row.final_ledger_name }}
IGST ₹{{ '%.2f'|format(row.igst) }}
CGST ₹{{ '%.2f'|format(row.cgst) }}
SGST ₹{{ '%.2f'|format(row.sgst) }}
Cess ₹{{ '%.2f'|format(row.cess) }}
{% if not attempt %}
{% elif attempt.status in ['preflight_queued','preflight_claimed'] %}
Preflight is waiting for workstation #{{ attempt.workstation_agent_id }}. Refresh after the Local Agent processes it.
{% elif attempt.status == 'preflight_failed' %}
Preflight failed
{{ attempt.last_error }}
{% elif attempt.status == 'preflight_ready' and choice %} {% if choice.duplicate_candidates %}
Possible duplicate found in Tally — posting blocked
{% for dup in choice.duplicate_candidates[:5] %}
{{ dup.voucher_number or '-' }} · {{ dup.reference or '-' }} · {{ dup.party_ledger_name or '-' }}
{% endfor %}
{% elif not choice.purchase_ledger_verified %}
Reviewed purchase ledger {{ row.final_ledger_name }} was not found in the currently opened Tally company. Sync/fix the mapping before posting.
{% else %}
Preflight passed · {{ choice.company_name }}
{% if row.igst > 0 %} {% else %}{% endif %} {% if row.cgst > 0 %} {% else %}{% endif %} {% if row.sgst > 0 %} {% else %}{% endif %} {% if row.cess > 0 %} {% else %}{% endif %}
{% endif %} {% elif attempt.status in ['posting_queued','posting_claimed'] %}
Purchase posting job is being executed by the selected workstation. Do not submit another posting job.
{% elif attempt.status == 'posted' %}
Posted successfully to Tally
Company: {{ attempt.tally_company_name }}
Voucher/ID: {{ attempt.tally_voucher_number or attempt.tally_voucher_id or '-' }}
Reference: {{ attempt.tally_reference or row.invoice_number }}
{% elif attempt.status == 'posting_indeterminate' %}
Manual verification required — do not retry
{{ attempt.last_error }}
The Local Agent began execution but acknowledgement was lost. Check Tally for invoice {{ row.invoice_number }} before any further action.
{% elif attempt.status == 'posting_failed' %}
Tally posting failed
{{ attempt.last_error }}
Run a new preflight after correcting the Tally-side issue. The prior financial write job is never automatically retried.
{% endif %}
{% else %}
No accountant-reviewed purchases are available for posting.
{% endfor %}
{% if result.pages > 1 %}
Page {{ result.page }} of {{ result.pages }}
{% if result.page > 1 %}Previous{% endif %} {% if result.page < result.pages %}Next{% endif %}
{% endif %}
{% endif %}
{% endblock %}