From e3d4686abebce4dc21688e41384277ab8f706b83 Mon Sep 17 00:00:00 2001 From: AlexeerCT Date: Fri, 13 Mar 2026 13:02:35 -0500 Subject: [PATCH] Update invoice processing terminology from 'who_updated' to 'who_processed' - Renamed instances of 'who_updated' to 'who_processed' in the InvoiceService and related tasks to enhance clarity and consistency in invoice processing. - Adjusted comments and documentation to reflect the updated terminology across various modules, ensuring alignment with recent changes in invoice status handling. --- backend/api/v1/modules/a76/invoices/services.py | 4 ++-- backend/api/v1/modules/a76/layouts_csv/facturas/tasks.py | 8 ++++---- .../reports/movements/invoices/services/export_repair.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/api/v1/modules/a76/invoices/services.py b/backend/api/v1/modules/a76/invoices/services.py index 06c084bb..ecd8cc25 100644 --- a/backend/api/v1/modules/a76/invoices/services.py +++ b/backend/api/v1/modules/a76/invoices/services.py @@ -162,7 +162,7 @@ class InvoiceService: # Automatic status and audit fields username = _get_current_username() invoice_dict["capture_user"] = username - invoice_dict["who_updated"] = username + invoice_dict["who_processed"] = username # Ensure document_type respects DB constraints for MEX invoices (bypass clean_dict) if invoice_dict.get("invoice_type") == "MEX" and not invoice_dict.get("document_type"): @@ -306,7 +306,7 @@ class InvoiceService: # Audit update fields username = _get_current_username() - invoice.who_updated = username + invoice.who_processed = username invoice.updated_date = func.now() # Backfill capture_user if missing or previous generic 'System' diff --git a/backend/api/v1/modules/a76/layouts_csv/facturas/tasks.py b/backend/api/v1/modules/a76/layouts_csv/facturas/tasks.py index 4f2a1cd7..3c52da6c 100644 --- a/backend/api/v1/modules/a76/layouts_csv/facturas/tasks.py +++ b/backend/api/v1/modules/a76/layouts_csv/facturas/tasks.py @@ -3,7 +3,7 @@ Tareas Celery para importación CSV de facturas (encabezados, partidas, series). Flujo: scan_file (validación) → insert_valid_rows (commit). Objetivo en BD (paridad con flujo normal): al terminar el commit, los datos deben quedar -igual que por UI/API: encabezados con capture_user/who_updated; partidas con costos, +igual que por UI/API: encabezados con capture_user/who_processed; partidas con costos, pesos y descripciones calculados/heredados según items/imports/validators; series con campos no presentes en CSV en null. No se modifican plantillas CSV; no se inventan datos sin fuente (p. ej. LineReference solo si hay fuente explícita). @@ -4916,7 +4916,7 @@ def _do_insert_valid_rows(job_id: str, model_target: str, job_type_override: Opt header.status = True # Mark as updated header.updated_date = datetime.utcnow() capture_user = meta.get("capture_user") or "CSV" - header.who_updated = capture_user + header.who_processed = capture_user # Backfill capture_user if missing or generic (paridad con service) if not header.capture_user or header.capture_user == "System": if capture_user != "CSV": @@ -4946,7 +4946,7 @@ def _do_insert_valid_rows(job_id: str, model_target: str, job_type_override: Opt # SQLAlchemy relationship assignment usually handles 1-to-1 updates correctly. else: - # CREATE new header (paridad con InvoiceService.create: capture_user, who_updated) + # CREATE new header (paridad con InvoiceService.create: capture_user, who_processed) capture_user = meta.get("capture_user") or "CSV" header = InvoiceHeader( invoice_number=invoice_number, @@ -4956,7 +4956,7 @@ def _do_insert_valid_rows(job_id: str, model_target: str, job_type_override: Opt system="CSV", capture_date=datetime.utcnow(), capture_user=capture_user, - who_updated=capture_user, + who_processed=capture_user, invoice_type=inv_type_value, document_type=( None if inv_type_value == "MEX" else diff --git a/backend/api/v1/modules/a76/reports/movements/invoices/services/export_repair.py b/backend/api/v1/modules/a76/reports/movements/invoices/services/export_repair.py index 63704ddd..f867acd7 100644 --- a/backend/api/v1/modules/a76/reports/movements/invoices/services/export_repair.py +++ b/backend/api/v1/modules/a76/reports/movements/invoices/services/export_repair.py @@ -60,7 +60,7 @@ class ExportRepairService: [18] C48 - exchange_rate ← TipoCambio [19] C49 - emission_date [20] C50 - capture_user ← UsuarioCap - [21] C51 - who_updated ← UsuarioAcr + [21] C51 - who_processed ← UsuarioAcr [22] C52 - carrier_id ← Transportista [23] C53 - transport ← NumCaja [24] total_me