Expose cash payment entry allocation tool

This commit is contained in:
A R R R Associates
2026-09-03 22:09:15 +05:30
parent 024b3e1ad6
commit e341de5ecb
3 changed files with 55 additions and 2 deletions
+42
View File
@@ -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()