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.
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user