Add Phase 11B client aware multi bank ownership and engagement archive

This commit is contained in:
A R R R Associates
2026-08-22 20:45:36 +05:30
parent 8748ee9539
commit 016299cf0c
9 changed files with 714 additions and 8 deletions
+7
View File
@@ -79,6 +79,13 @@ def import_completed_job(db, *, tenant_id, client_id, job_id, user_id):
raise ValueError("Completed Bank Analyzer workbook was not found.")
if job.tenant_id not in (None, tenant_id):
raise ValueError("Bank Analyzer job belongs to a different firm.")
if getattr(job, "client_id", None) and int(job.client_id) != int(client_id):
raise ValueError(
"This Bank Analyzer job is already bound to a different ERP client. "
"Import it using the client confirmed during statement ownership validation."
)
if getattr(job, "client_id", None) and getattr(job, "ownership_status", "") != "confirmed":
raise ValueError("Client-bound Bank Analyzer job has not passed ownership validation.")
frame = pd.read_excel(job.output_file, sheet_name="Transaction Classification")
tally_options = available_tally_guids(db, tenant_id, client_id)