From e341de5ecbad99287e72a93abe3b6ca29d0f1d82 Mon Sep 17 00:00:00 2001 From: A R R R Associates Date: Thu, 3 Sep 2026 22:09:15 +0530 Subject: [PATCH] Expose cash payment entry allocation tool --- app/modules/accounting/cash_payment_ui.py | 42 +++++++++++++++++++ .../accounting/cash_payment_review.html | 14 ++++++- .../templates/accounting/tally.html | 1 + 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/app/modules/accounting/cash_payment_ui.py b/app/modules/accounting/cash_payment_ui.py index b23a755..e15d06f 100644 --- a/app/modules/accounting/cash_payment_ui.py +++ b/app/modules/accounting/cash_payment_ui.py @@ -224,6 +224,47 @@ def cash_payment_review( command_error=command_error, allocation_plan=None, allocation_input={"total_amount": "", "party_name": "", "expense_ledger": "", "source_payments": ""}, + page_mode="compliance", + ) + finally: + db.close() + + +@router.get("/allocation") +def cash_payment_allocation( + request: Request, + client_id: int | None = None, + error: str = "", +): + db = CommonSessionLocal() + try: + user, response = _require_partner(request, db, "accounting.tally.view") + if response: + return response + clients, scope = _visible_clients(db, request, user) + selected_client = next((row for row in clients if client_id and int(row.id) == int(client_id)), None) + setting = _setting(db, _tenant_id(request, user)) + node = get_active_storage_node_for_branch(db, scope.tenant_id, scope.branch_id) + return _render( + request, + db, + user, + title="Cash Payment Entry Allocation", + clients=clients, + selected_client=selected_client, + storage_node=node, + agent_online=_node_online(node), + live_result=None, + selected_tally_guid="", + date_from="", + date_to="", + setting=setting, + review=None, + saved=False, + command_error=error or "", + allocation_plan=None, + allocation_input={"total_amount": "", "party_name": "", "expense_ledger": "", "source_payments": ""}, + page_mode="allocation", ) finally: db.close() @@ -348,6 +389,7 @@ async def cash_payment_allocation_plan(request: Request): "expense_ledger": expense_ledger, "source_payments": source_payments, }, + page_mode="allocation", ) finally: db.close() diff --git a/app/modules/accounting/templates/accounting/cash_payment_review.html b/app/modules/accounting/templates/accounting/cash_payment_review.html index e7d22f2..470ca02 100644 --- a/app/modules/accounting/templates/accounting/cash_payment_review.html +++ b/app/modules/accounting/templates/accounting/cash_payment_review.html @@ -4,8 +4,12 @@

Tools · Accounting · Tally

-

Cash Payment Compliance Review

-

Read-only Tally review for cash payments above the configured limit, same-day party aggregation and possible split-payment patterns. The accounting planner below uses only actual source payment dates supplied by the user; it never invents or changes dates.

+

{{ 'Cash Payment Entry Allocation' if page_mode == 'allocation' else 'Cash Payment Compliance Review' }}

+ {% if page_mode == 'allocation' %} +

Prepare and validate cash payment entry allocation using only actual source payment dates. The tool checks totals, the configured daily limit and the permitted source-date window; it never invents or changes dates.

+ {% else %} +

Read-only Tally review for cash payments above the configured limit, same-day party aggregation and possible split-payment patterns.

+ {% endif %}
Back to Tally
@@ -13,6 +17,7 @@ {% if saved %}
Cash payment rule settings saved.
{% endif %} {% if command_error %}
{{ command_error }}
{% endif %} + {% if page_mode != 'allocation' %}

Tax Payment Compliance Review

@@ -81,6 +86,10 @@
{% endif %} + + {% endif %} + + {% if page_mode == 'allocation' %}

Cash Payment Entry Allocation — Actual Source Dates

Use this when the source records establish that one accounting amount was actually paid on multiple dates. Enter the real dates and amounts. The tool validates totals, daily limits and the configured date window; it does not fabricate dates or automatically rewrite Tally vouchers.

@@ -105,5 +114,6 @@ {% endif %}
+ {% endif %} {% endblock %} diff --git a/app/modules/accounting/templates/accounting/tally.html b/app/modules/accounting/templates/accounting/tally.html index 2dae43c..fb88351 100644 --- a/app/modules/accounting/templates/accounting/tally.html +++ b/app/modules/accounting/templates/accounting/tally.html @@ -47,6 +47,7 @@ Bank Reconciliation Depreciation (IT) Cash Payment Compliance + Cash Payment Entry Allocation Accounting AI Internal Model