Clarify historical Sales learning screen

This commit is contained in:
A R R R Associates
2026-08-23 13:11:54 +05:30
parent bc5866f857
commit 10b12a3dea
@@ -3,11 +3,16 @@
<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-emerald-700">Sales & Income · Phase 15</p>
<h1 class="mt-1 text-2xl font-semibold text-slate-900">Customer & Sales Ledger Intelligence</h1>
<p class="mt-1 max-w-4xl text-sm text-slate-500">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.</p>
<p class="text-xs font-semibold uppercase tracking-[0.16em] text-emerald-700">Sales & Income · Historical Learning</p>
<h1 class="mt-1 text-2xl font-semibold text-slate-900">Historical Sales Learning & Collection</h1>
<p class="mt-1 max-w-4xl text-sm text-slate-500">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.</p>
</div>
<div class="flex flex-wrap gap-2">
<a href="/tools/accounting/sales-income{% if selected_client %}?client_id={{ selected_client.id }}{% endif %}" class="rounded-xl border border-slate-300 bg-white px-3 py-2 text-sm font-semibold">Sales & Income Register</a>
<a href="/tools/accounting/customer-intelligence{% if selected_client %}?client_id={{ selected_client.id }}{% endif %}" class="rounded-xl border border-slate-300 bg-white px-3 py-2 text-sm font-semibold">Customer Intelligence</a>
<a href="/tools/accounting/historical-sales-learning{% if selected_client %}?client_id={{ selected_client.id }}{% endif %}" class="rounded-xl border border-emerald-300 bg-emerald-50 px-3 py-2 text-sm font-semibold text-emerald-800">Historical Sales Learning</a>
<a href="/tools/accounting/sales-ledger-learning{% if selected_client %}?client_id={{ selected_client.id }}{% endif %}" class="rounded-xl border border-slate-300 bg-white px-3 py-2 text-sm font-semibold">Sales Ledger Learning</a>
</div>
<a href="/tools/accounting/sales-income{% if selected_client %}?client_id={{ selected_client.id }}{% endif %}" class="rounded-xl border border-slate-300 bg-white px-4 py-2 text-sm font-semibold">Sales & Income Register</a>
</div>
{% if message %}<div class="rounded-xl border border-emerald-200 bg-emerald-50 p-3 text-sm text-emerald-800">{{ message }}</div>{% endif %}
@@ -40,21 +45,22 @@
<div class="flex flex-wrap items-center justify-between gap-3">
<div>
<div class="text-xs font-semibold uppercase tracking-[0.14em] text-blue-700">Latest Historical Sales Run</div>
<div id="runProgressLabel" class="mt-1 text-lg font-semibold text-slate-900">{{ latest_run.status|replace('_',' ')|title }}</div>
<div id="runProgressDetail" class="mt-1 text-sm text-slate-500">{{ latest_run.company_name or latest_run.tally_guid }}</div>
<div id="runProgressLabel" class="mt-1 text-lg font-semibold text-slate-900">{% 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 %}</div>
<div id="runProgressDetail" class="mt-1 text-sm text-slate-500">{{ 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 %}</div>
</div>
<div id="runProgressMeta" class="text-right text-xs text-slate-500">Run #{{ latest_run.id }}</div>
</div>
<div class="mt-4 h-2 overflow-hidden rounded-full bg-slate-200">
<div id="runProgressBar" class="h-full w-1/3 rounded-full bg-blue-600 transition-all duration-500"></div>
<div id="runProgressBar"
class="h-full rounded-full transition-all duration-500 {% if latest_run.status == 'completed' %}w-full bg-emerald-600{% elif latest_run.status in ['failed','cancelled'] %}w-full bg-red-600{% elif latest_run.status in ['claimed','processing'] %}w-2/3 bg-blue-600 animate-pulse{% else %}w-1/3 bg-blue-600 animate-pulse{% endif %}"></div>
</div>
<div id="runProgressError" class="mt-3 hidden rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-800"></div>
</section>
{% endif %}
<section class="rounded-2xl bg-white p-5 shadow-soft">
<h2 class="font-semibold">Collect Historical Sales Evidence from Tally</h2>
<p class="mt-1 text-sm text-slate-500">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.</p>
<h2 class="font-semibold">Collect / Refresh Historical Sales Evidence from Tally</h2>
<p class="mt-1 text-sm text-slate-500">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.</p>
{% if not workstations %}
<div class="mt-4 rounded-xl border border-amber-200 bg-amber-50 p-3 text-sm text-amber-800">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.</div>
{% endif %}
@@ -84,7 +90,7 @@
</section>
<section class="rounded-2xl bg-white shadow-soft">
<div class="border-b border-slate-200 px-5 py-4"><h2 class="font-semibold">Learned Customer Mappings</h2><p class="text-sm text-slate-500">Reviewer confirmations take priority over historical evidence.</p></div>
<div class="border-b border-slate-200 px-5 py-4"><h2 class="font-semibold">Customer Mappings Produced by Review</h2><p class="text-sm text-slate-500">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.</p></div>
<div class="overflow-x-auto">
<table class="min-w-full text-sm">
<thead><tr class="border-b bg-slate-50 text-left text-xs uppercase text-slate-500"><th class="px-3 py-3">Customer</th><th class="px-3 py-3">GSTIN</th><th class="px-3 py-3">Tally Customer</th><th class="px-3 py-3">Sales Ledger</th><th class="px-3 py-3">Evidence</th><th class="px-3 py-3">Confidence</th></tr></thead>