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

Sales & Income · Phase 15

Customer & Sales Ledger Intelligence

Learn how each client historically treats customers and Sales/Income ledgers. Purchase historical evidence remains in its existing store; this page keeps Sales evidence separate.

Sales & Income Register
{% if message %}
{{ message }}
{% endif %} {% if error %}
{{ error }}
{% endif %}
{% if selected_client %}
{% for label,value in [('Customer mappings',summary.mapping_count),('Historical Sales pairs',summary.historical_rows),('Reviewed mappings',summary.review_confirmed),('High confidence',summary.high_confidence)] %}
{{ label }}
{{ value }}
{% endfor %}
{% if latest_run %}
Latest Historical Sales Run
{{ latest_run.status|replace('_',' ')|title }}
{{ latest_run.company_name or latest_run.tally_guid }}
Run #{{ latest_run.id }}
{% endif %}

Collect Historical Sales Evidence from Tally

Read-only. The selected workstation refreshes Sales vouchers from the currently open mapped Tally company for the chosen period, then stores neutral historical evidence. It does not create or alter Tally vouchers.

{% if not workstations %}
No recent ERP Local Agent workstation with Tally connected is advertising a company for this branch. Update/start the Local Agent, open the mapped company in TallyPrime, and refresh this page.
{% endif %}

Learned Customer Mappings

Reviewer confirmations take priority over historical evidence.

{% for m in mappings %} {% else %}{% endfor %}
CustomerGSTINTally CustomerSales LedgerEvidenceConfidence
{{ m.customer_name }}{{ m.customer_gstin or '—' }}{{ m.tally_customer_ledger_name or '—' }}{{ m.sales_ledger_name or '—' }}{{ m.evidence_count }} · {{ m.source }}{{ m.confidence_percent }}%
Mappings will appear as Sales & Income rows are reviewed.

Historical Tally Sales Evidence

{% for e in evidence %} {% else %}{% endfor %}
Customer ledgerCounter / Sales ledgerVoucherCountAmountLast used
{{ e.party_ledger_name }}{{ e.counter_ledger_name }}{{ e.voucher_type_name }}{{ e.voucher_count }}₹{{ '%.2f'|format(e.absolute_amount_total) }}{{ e.last_voucher_date or '—' }}
No historical Sales evidence collected yet.
{% endif %}
{% endblock %}