diff --git a/app/modules/accounting/cash_payment_ui.py b/app/modules/accounting/cash_payment_ui.py index 59210af..18791c3 100644 --- a/app/modules/accounting/cash_payment_ui.py +++ b/app/modules/accounting/cash_payment_ui.py @@ -252,7 +252,7 @@ def cash_payment_review( @router.post("/ledgers") async def cash_payment_ledgers(request: Request): - """Load Cash-in-Hand ledgers directly; keep full-ledger sync only as manual fallback.""" + """Load Cash ledgers using the same live Tally master snapshot path as Opening Balance Review.""" form = await request.form() validate_csrf(request, str(form.get("csrf_token") or "")) db = CommonSessionLocal() @@ -287,23 +287,19 @@ async def cash_payment_ledgers(request: Request): "tally_guid": tally_guid, "company_name": company_name, } - if ledger_scope == "all": - # Explicit manual fallback preserves the existing full-master async flow. - payload["force_refresh"] = force_refresh - result = request_agent_command( - node.node_code, - "accounting_cash_payment_ledgers_start", - payload, - timeout_seconds=20, - ) - else: - # Normal path: small filtered Tally collection, no full ledger cache. - result = request_agent_command( - node.node_code, - "accounting_cash_payment_cash_ledgers", - payload, - timeout_seconds=30, - ) + # Use the same proven live Tally master-snapshot mechanism used by + # Opening Balance Review. The Local Agent resolves the selected open + # company, reads the standard Tally masters and returns either only + # Cash-in-Hand ledgers or all ledgers for explicit manual selection. + # No separate cash-ledger cache/job is required for this selector. + payload["ledger_scope"] = ledger_scope + payload["force_refresh"] = force_refresh + result = request_agent_command( + node.node_code, + "accounting_cash_payment_cash_ledgers", + payload, + timeout_seconds=180, + ) except Exception as exc: return JSONResponse({"ok": False, "error": str(exc)}, status_code=502) if not result.get("ok"): diff --git a/app/modules/accounting/templates/accounting/cash_payment_review.html b/app/modules/accounting/templates/accounting/cash_payment_review.html index 54ffa31..17aa98b 100644 --- a/app/modules/accounting/templates/accounting/cash_payment_review.html +++ b/app/modules/accounting/templates/accounting/cash_payment_review.html @@ -69,7 +69,7 @@ -

By default only ledgers classified under Cash-in-Hand are shown. Choose “All Tally ledgers” only when you need to manually select a ledger that Tally has grouped differently.

+

Uses the same live Tally master-reading mechanism as Opening Balance Review. By default only ledgers under Cash-in-Hand are shown; choose “All Tally ledgers” only for manual selection when required.