Show all open Tally companies in cash payment review

This commit is contained in:
A R R R Associates
2026-09-04 16:33:53 +05:30
parent d6ef57b434
commit 9a6b35c19b
5 changed files with 52 additions and 16 deletions
+4 -2
View File
@@ -273,7 +273,7 @@ async def cash_payment_ledgers(request: Request):
date_from = str(form.get("date_from") or date.today().isoformat()).strip()
force_refresh = str(form.get("force_refresh") or "").strip().lower() in {"1","true","yes","on"}
if not tally_guid:
return JSONResponse({"ok": False, "error": "Select a mapped Tally company."}, status_code=400)
return JSONResponse({"ok": False, "error": "Select an open Tally company."}, status_code=400)
node = get_active_storage_node_for_branch(db, scope.tenant_id, scope.branch_id)
if not node or not _node_online(node):
return JSONResponse({"ok": False, "error": "ERP Local Agent is offline."}, status_code=409)
@@ -351,6 +351,7 @@ async def start_cash_payment_cache(request: Request):
if not selected_client:
return JSONResponse({"ok": False, "error": "Select a valid client."}, status_code=400)
tally_guid = str(form.get("tally_guid") or "").strip()
company_name = str(form.get("company_name") or "").strip()
cash_ledger_name = str(form.get("cash_ledger_name") or "").strip()
date_from = str(form.get("date_from") or "").strip()
date_to = str(form.get("date_to") or "").strip()
@@ -362,7 +363,7 @@ async def start_cash_payment_cache(request: Request):
except Exception as exc:
return JSONResponse({"ok": False, "error": str(exc)}, status_code=400)
if not tally_guid:
return JSONResponse({"ok": False, "error": "Select a mapped Tally company."}, status_code=400)
return JSONResponse({"ok": False, "error": "Select an open Tally company."}, status_code=400)
if not cash_ledger_name:
return JSONResponse({"ok": False, "error": "Load the Tally ledgers and confirm the Cash ledger."}, status_code=400)
node = get_active_storage_node_for_branch(db, scope.tenant_id, scope.branch_id)
@@ -376,6 +377,7 @@ async def start_cash_payment_cache(request: Request):
{
**_accounting_storage_payload(selected_client, _financial_year_for_date(parsed_from)),
"tally_guid": tally_guid,
"company_name": company_name,
"date_from": date_from,
"date_to": date_to,
"cash_ledger_name": cash_ledger_name,