{% extends "ui/templates/base/layout.html" %} {% block content %} {% if synced %}
Tally accounting masters synchronized successfully.
{% endif %} {% if transactions_synced %}
Tally accounting transactions synchronized successfully.
{% endif %}

Tools · Accounting

Tally Accounting

Company mapping, master sync and transaction sync remain available. Accounting tools are now grouped into Purchases & Expenses and Sales & Income without changing existing routes or controls.

Accounting Foundation
Build the client Chart of Accounts from Tally Groups and Ledgers before transaction-level classification.
Sales & Income
Sales & Income now mirrors the structured Purchases & Expenses menu. Every visible button below is a working Phase 14–15 tool.
{% if initialized %}
Client accounting storage was initialized successfully.
{% endif %} {% if mapped %}
Tally company mapping was saved successfully.
{% endif %} {% if unmapped %}
Tally company mapping was removed.
{% endif %} {% if command_error %}
{{ command_error }}
{% endif %} {% set agent = live_result.agent if live_result else None %} {% set tally = live_result.tally if live_result else None %} {% set accounting = live_result.accounting if live_result else None %}
ERP Local Agent
{{ 'Connected' if agent_online else 'Offline' }}
{{ storage_node.node_name if storage_node else 'No active branch agent' }}
Mapping Module
{{ 'Available' if agent and agent.tally_mapping_capability else ('Update Agent' if agent_online else 'Unavailable') }}
Agent {{ agent.version if agent and agent.version else '-' }}
TallyPrime
{{ 'Connected' if tally and tally.connected else ('Not connected' if tally else 'Not checked') }}
{{ tally.url if tally and tally.url else '127.0.0.1:9000' }}
Loaded Companies
{{ tally.company_count if tally else '-' }}
GUID-based discovery

Only clients assigned to the logged-in Partner in the active branch are shown.

{% if selected_client %}

Accounting Storage

{{ selected_client.client_name }}

{{ 'Initialized' if accounting and accounting.exists else 'Not initialized' }}
{% if accounting and accounting.exists %}
.act Database
{{ accounting.db_path }}
Schema Version
{{ accounting.metadata.schema_version or '2' }}
{% else %}
{% endif %}
{% if accounting and accounting.exists and tally and tally.connected %}

Map ERP Scope to Tally Company

The Tally GUID is stored as the permanent identifier. Company name and GSTIN are retained as descriptive snapshots.

{% endif %} {% if accounting and accounting.exists %}

Full Accounting Export · ODBC → SQLite

Export the selected mapped Tally company into the client Accounting Mirror .act database in local storage. This refreshes ledgers, vouchers, voucher ledger entries, stock items, stock movements, HSN and GST rates, then refreshes the existing client .act snapshots used by older accounting tools.

Read-only export
Before export: open the mapped company in TallyPrime and set Tally's active period (Alt+F2) to cover the full period you want exported. The ODBC mirror reads Tally's active period; the ERP does not change Tally's period automatically.
{% endif %} {% if accounting and accounting.exists and tally and tally.connected %}

Phase 3 · Accounting Master Sync

Select the company that is currently open/loaded in TallyPrime. The Local Agent verifies that the selected company is already mapped to this ERP client before reading masters.

Read-only
{% set last_sync = accounting.latest_master_sync if accounting else none %}
Latest Sync
{{ last_sync.completed_at_utc if last_sync and last_sync.completed_at_utc else 'Not synced yet' }}
Company
{{ last_sync.company_name if last_sync else '-' }}
Rows Stored
{{ last_sync.rows_processed if last_sync else 0 }}
Status
{{ last_sync.status|title if last_sync else '-' }}
Synced into the selected client's .act database: Groups, Ledgers, Voucher Types, Stock Groups, Stock Categories, Stock Items, Units, Cost Categories and Cost Centres. No voucher or transaction data is imported in Phase 3.
{% endif %} {% if accounting and accounting.exists and tally and tally.connected %}

Phase 4 · Accounting Transaction Sync

Read vouchers and their accounting allocations from the selected company currently open in TallyPrime. The selected company must already be mapped to this ERP client.

Read-only
{% set tx = accounting.latest_transaction_sync if accounting else none %}
Latest Sync
{{ tx.completed_at_utc if tx and tx.completed_at_utc else 'Not synced yet' }}
Period
{% if tx and tx.details %}{{ tx.details.date_from or '-' }} → {{ tx.details.date_to or '-' }}{% else %}-{% endif %}
Vouchers
{% if tx and tx.details and tx.details.counts %}{{ tx.details.counts.vouchers or 0 }}{% else %}0{% endif %}
Rows Stored
{{ tx.rows_processed if tx else 0 }}
Stored locally in the client's .act database: vouchers, ledger entries, inventory entries, bill allocations, cost-centre allocations and bank allocations. Raw voucher XML is preserved. Re-syncing a date range replaces only that company's vouchers in the selected range. No Tally data is modified.
{% endif %} {% if accounting and accounting.exists %}

Active Tally Mappings

Mappings remain valid across Tally company renames because the GUID is the persistent key.

{% if accounting.mappings %}
{% for mapping in accounting.mappings %} {% endfor %}
ERP Scope Tally Company GUID ERP GSTIN Tally GSTIN GSTIN Match Loaded Action
{% if mapping.registration_id %}
{{ mapping.registration_type_code or 'Registration' }} · {{ mapping.registration_number or mapping.registration_id }}
{{ mapping.registration_trade_name or mapping.registration_legal_name or selected_client.client_name }}
{% else %}
Client level
{{ selected_client.client_name }}
{% endif %}
{{ mapping.company_name }} {{ mapping.tally_guid }} {% if mapping.erp_gstins %} {% for gstin in mapping.erp_gstins %}
{{ gstin }}
{% endfor %} {% else %}-{% endif %}
{{ mapping.tally_gstin_display or '-' }} {% if mapping.gstin_match_status == 'matched' %} Matched {% elif mapping.gstin_match_status == 'mismatch' %} Mismatch {% elif mapping.gstin_match_status == 'tally_missing' %} Tally GSTIN unavailable {% elif mapping.gstin_match_status == 'erp_missing' %} ERP GSTIN unavailable {% else %} Unavailable {% endif %} {{ 'Yes' if mapping.currently_loaded else 'No' }}
{% else %}
No Tally company has been mapped for this client yet.
{% endif %}
{% endif %} {% if tally %}

Loaded Tally Companies

Read-only company discovery from the local TallyPrime instance.

{% if tally.companies %}
{% for company in tally.companies %} {% endfor %}
CompanyGUIDTally GSTIN
{{ company.name }} {{ company.guid or '-' }} {{ company.gstin or '-' }}
{% else %}
TallyPrime responded, but no loaded company was returned.
{% endif %}
{% endif %} {% endif %}
Phase 4 synchronizes accounting transactions read-only. Tally write-back remains disabled and is reserved for Phase 6.
{% endblock %}