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

Sales & Income · Historical Learning

Historical Sales Learning & Collection

Collect read-only historical Sales vouchers from Tally and convert them into customer-to-Sales-ledger evidence for this ERP client. This screen manages historical collection; Customer Intelligence and Sales Ledger Learning use the resulting evidence separately.

{% 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
{% if latest_run.status == 'completed' %}Completed · {{ latest_run.evidence_rows }} evidence row(s){% elif latest_run.status == 'failed' %}Failed{% else %}{{ latest_run.status|replace('_',' ')|title }}{% endif %}
{{ latest_run.company_name or latest_run.tally_guid }}{% if latest_run.date_from and latest_run.date_to %} · {{ latest_run.date_from }} → {{ latest_run.date_to }}{% endif %}
Run #{{ latest_run.id }}
{% endif %}

Collect / Refresh Historical Sales Evidence from Tally

Read-only. Select the workstation and currently open Tally company, choose the period, and refresh historical Sales voucher evidence. The Local Agent reads Tally and updates the client's accounting evidence store; it does not create, edit or post 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 %}

Customer Mappings Produced by Review

These are resulting customer mappings created by Sales & Income review. They are shown here only so you can see how historical evidence is being converted into reusable learning.

{% 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 %}