Unify accounting analysis on Client FY mirror registry
This commit is contained in:
@@ -18,6 +18,7 @@ from app.modules.accounting.agent_bridge import request_agent_command
|
||||
from app.modules.accounting.cash_payment_models import CashPaymentRuleSetting
|
||||
from app.modules.accounting.ui import (
|
||||
_accounting_storage_payload,
|
||||
_analysis_accounting_storage_payload,
|
||||
_denied,
|
||||
_find_visible_client,
|
||||
_financial_year_for_date,
|
||||
@@ -263,9 +264,11 @@ def cash_payment_review(
|
||||
"SQLite Accounting Mirror, so the storage agent must be online."
|
||||
)
|
||||
else:
|
||||
storage_payload = _accounting_storage_payload(
|
||||
storage_payload = _analysis_accounting_storage_payload(
|
||||
selected_client,
|
||||
review_fy,
|
||||
db=db,
|
||||
tenant_id=scope.tenant_id,
|
||||
)
|
||||
try:
|
||||
status_response = request_agent_command(
|
||||
@@ -387,7 +390,7 @@ async def cash_payment_ledgers(request: Request):
|
||||
try:
|
||||
fy = _financial_year_for_date(date.fromisoformat(date_from))
|
||||
payload = {
|
||||
**_accounting_storage_payload(selected_client, fy),
|
||||
**_analysis_accounting_storage_payload(selected_client, fy, db=db, tenant_id=scope.tenant_id),
|
||||
"tally_guid": tally_guid,
|
||||
"company_name": company_name,
|
||||
"ledger_scope": ledger_scope,
|
||||
@@ -470,7 +473,7 @@ def cash_payment_ledgers_progress(
|
||||
})
|
||||
fy = _financial_year_for_date(date.fromisoformat(date_from))
|
||||
payload = {
|
||||
**_accounting_storage_payload(selected_client, fy),
|
||||
**_analysis_accounting_storage_payload(selected_client, fy, db=db, tenant_id=scope.tenant_id),
|
||||
"job_id": str(job_id),
|
||||
"tally_guid": str(tally_guid or ""),
|
||||
"company_name": str(company_name or ""),
|
||||
@@ -576,7 +579,7 @@ async def start_cash_payment_cache(request: Request):
|
||||
node.node_code,
|
||||
"accounting_cash_payment_cache_start",
|
||||
{
|
||||
**_accounting_storage_payload(selected_client, _financial_year_for_date(parsed_from)),
|
||||
**_analysis_accounting_storage_payload(selected_client, _financial_year_for_date(parsed_from), db=db, tenant_id=scope.tenant_id),
|
||||
"tally_guid": tally_guid,
|
||||
"company_name": company_name,
|
||||
"date_from": date_from,
|
||||
@@ -632,7 +635,7 @@ async def cancel_cash_payment_cache(request: Request):
|
||||
node.node_code,
|
||||
"accounting_cash_payment_cache_cancel",
|
||||
{
|
||||
**_accounting_storage_payload(selected_client, _financial_year_for_date(parsed_from)),
|
||||
**_analysis_accounting_storage_payload(selected_client, _financial_year_for_date(parsed_from), db=db, tenant_id=scope.tenant_id),
|
||||
"job_id": job_id,
|
||||
},
|
||||
timeout_seconds=15,
|
||||
@@ -665,7 +668,7 @@ def cash_payment_cache_progress(request: Request, client_id: int, job_id: str, d
|
||||
result = request_agent_command(
|
||||
node.node_code,
|
||||
"accounting_cash_payment_cache_status",
|
||||
{**_accounting_storage_payload(selected_client, fy), "job_id": str(job_id)},
|
||||
{**_analysis_accounting_storage_payload(selected_client, fy, db=db, tenant_id=scope.tenant_id), "job_id": str(job_id)},
|
||||
timeout_seconds=20,
|
||||
)
|
||||
except Exception as exc:
|
||||
|
||||
Reference in New Issue
Block a user