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

Tools · Accounting Intelligence

Self-improving Ledger Selection

Phase 6 ranks accounting natures and existing client Tally ledgers from confirmed learning, Phase 5 history, business context and conservative deterministic rules. It never posts to Tally.

{% if reviewed %}
Review saved. The confirmed choice has been added to this client's learning memory.
{% endif %} {% if error %}
{{ error }}
{% endif %}
{% if selected_client %}
{% endif %}
{% if selected_client %}
Business Model
{{ profile.business_model|replace('_',' ')|title if profile and profile.business_model else 'Not profiled' }}
Industry
{{ profile.primary_industry if profile and profile.primary_industry else '-' }}
Profile Status
{{ profile.profile_status|title if profile else 'Missing' }}
Learned Rules
{{ learning_summary|length }}
{% if suggestions %}

Ranked Suggestions

Confirm the proposed treatment or correct it. The final human choice becomes the learning label.

{% for item in suggestions %}

{{ item.nature.name }}

{{ item.confidence }}% confidence

{{ item.nature.code }} · {{ item.nature.capital_revenue|title }}

{% if item.suggested_ledger %}
Suggested Tally ledger: {{ item.suggested_ledger }}
{% endif %}
Why
    {% for reason in item.reasons %}
  • • {{ reason }}
  • {% endfor %}
{% endfor %}
{% elif query.supplier_name or query.supplier_gstin or query.hsn_code or query.description %}
No usable suggestion was produced. Map historical ledgers in Phase 5 or manually select a review-required nature after adding more transaction context.
{% endif %}

Learning Memory

Client-specific rules learned from reviewed selections. A correction lowers confidence in the rejected treatment and strengthens the confirmed one.

Top {{ learning_summary|length }}
{% for item in learning_summary %} {% else %} {% endfor %}
RuleValueNatureLedgerConfirmedCorrectedConfidence
{{ item.rule.rule_type|replace('_',' ')|title }} {{ item.rule.display_value }} {{ item.nature.name }} {{ item.rule.ledger_name or '-' }} {{ item.rule.confirmation_count }} {{ item.rule.rejection_count }} {{ item.rule.confidence_percent }}%
No reviewed selections yet.

Recent Review Feedback

{% for event in events %} {% else %} {% endfor %}
WhenSupplierAcceptedSuggestedFinal Ledger
{{ event.created_at_utc }} {{ event.supplier_name or event.supplier_gstin or '-' }} {{ 'Yes' if event.accepted_suggestion else 'Corrected' }} {{ event.suggested_ledger_name or '-' }} · {{ event.suggested_confidence }}% {{ event.final_ledger_name or '-' }}
No review feedback yet.
{% endif %}
{% endblock %}