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

Tools · Accounting Intelligence

E-Invoice / E-Way Bill Enrichment

Phase 8 links E-Invoice and E-Way Bill source documents to existing GSTR-2B purchases and enriches classification with item description, HSN, quantity and logistics context. Original source fields remain unchanged and nothing is posted to Tally.

{% if message %}
{{ message }}
{% endif %} {% if error %}
{{ error }}
{% endif %}
{% if selected_client %} {% endif %}
{% if selected_client %}

Import enrichment source

Supported: JSON, XLSX/XLSM and CSV. JSON supports common GST E-Invoice and E-Way Bill field structures, including item lists.

Enrichment only · No voucher posting
{% if selected_batch %}
Source
{{ selected_batch.source_type|replace('_',' ')|title }}
Imported
{{ selected_batch.records_imported }}
Linked
{{ selected_batch.records_linked }}
Unmatched
{{ selected_batch.records_unmatched }}
Ambiguous
{{ selected_batch.records_ambiguous }}
Duplicates
{{ selected_batch.records_duplicate }}

{{ selected_batch.original_filename }}

Automatic matching uses supplier GSTIN + invoice number/date first, with a conservative value/date fallback.

{% for record in records %} {% set linked = gstr2b_by_id.get(record.gstr2b_purchase_id) if record.gstr2b_purchase_id else None %}

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

{{ record.source_type|replace('_',' ')|title }} {{ record.match_status|title }}
GSTIN: {{ record.supplier_gstin or '-' }}
Document: {{ record.document_number }} · {{ record.document_date }}
Reference: {{ record.external_reference or '-' }}
{% if record.vehicle_number %}
Vehicle: {{ record.vehicle_number }}{% if record.transport_mode %} · {{ record.transport_mode }}{% endif %}
{% endif %}
Taxable
₹{{ '%.2f'|format(record.taxable_value) }}
Invoice Value
₹{{ '%.2f'|format(record.invoice_value) }}
IGST
₹{{ '%.2f'|format(record.igst) }}
CGST + SGST
₹{{ '%.2f'|format(record.cgst + record.sgst) }}
{% if linked %}
Linked GSTR-2B purchase · {{ record.match_confidence }}%
{{ linked.invoice_number }} · {{ linked.invoice_date }}
₹{{ '%.2f'|format(linked.taxable_value) }} taxable · {{ record.match_method|replace('_',' ') }}
{% else %}
{% endif %}
{% if items_by_record.get(record.id) %}
{% for item in items_by_record.get(record.id) %} {% endfor %}
ItemHSNQtyUnitTaxable
{{ item.product_name or item.description_text or '-' }}
{% if item.description_text and item.description_text != item.product_name %}
{{ item.description_text }}
{% endif %}
{{ item.hsn_code or '-' }} {{ item.quantity }} {{ item.unit or '-' }} ₹{{ '%.2f'|format(item.taxable_value) }}
{% endif %}
{% else %}
No enrichment records in this batch.
{% endfor %}
{% endif %} {% endif %}
{% endblock %}