Unify accounting analysis on Client FY mirror registry

This commit is contained in:
A R R R Associates
2026-09-20 16:36:14 +05:30
parent 24b13e5d6e
commit c63fc2773c
11 changed files with 103 additions and 45 deletions
+5 -4
View File
@@ -25,6 +25,7 @@ from app.modules.accounting.opening_balance_service import (
)
from app.modules.accounting.ui import (
_accounting_storage_payload,
_analysis_accounting_storage_payload,
_financial_year_for_date,
_find_visible_client,
_node_online,
@@ -187,7 +188,7 @@ def page(
response = request_agent_command(
node.node_code,
"accounting_mirror_status",
_accounting_storage_payload(selected, fy_value),
_analysis_accounting_storage_payload(selected, fy_value, db=db, tenant_id=scope.tenant_id),
timeout_seconds=20,
)
status = (response.get("result") or {}) if response.get("ok") else {}
@@ -570,8 +571,8 @@ def compare(
if not node or not _node_online(node):
raise ValueError("ERP Local Agent is offline for the active branch.")
previous_payload = _accounting_storage_payload(client, previous_fy)
current_payload = _accounting_storage_payload(client, current_fy)
previous_payload = _analysis_accounting_storage_payload(client, previous_fy, db=db, tenant_id=scope.tenant_id)
current_payload = _analysis_accounting_storage_payload(client, current_fy, db=db, tenant_id=scope.tenant_id)
response = request_agent_command(
node.node_code,
"accounting_opening_balance_mirror_snapshot",
@@ -768,7 +769,7 @@ async def apply_corrections(
node.node_code,
"accounting_opening_balance_apply",
{
**_accounting_storage_payload(client, selected_financial_year or None),
**_analysis_accounting_storage_payload(client, selected_financial_year or None, db=db, tenant_id=scope.tenant_id),
"current_company_name": run.current_company_name,
"current_company_guid": run.current_company_guid,
"source_key": f"OPENING-RUN-{run.id}",