- Add is_hub_admin() and resolve_tenant_id_required() to core/security
- hub_admin resolves tenant from company or uses None as global sentinel
- Update routes and services to skip tenant filter when tenant_id is None
- UserService accepts is_hub_admin flag for cross-tenant user management
- get_my_companies returns all companies for hub_admin without tenant restriction
- Deleted the MovementService class, which handled movement operations for temporary imports, including methods for building query clauses and calculating exchange rates.
- This removal streamlines the codebase by eliminating unused legacy code, improving maintainability and clarity in the invoice processing logic.
- Updated invoice processing functions to eliminate legacy fields related to returned quantities, now relying on new balance movement and discharge records.
- Adjusted various components and services to reflect changes in quantity handling, including updates to the frontend for displaying used quantities instead of returned ones.
- Improved the logic for invoice total updates and validation processes to ensure consistency with the new data structure.
These changes aim to streamline invoice management and improve data integrity across the application.
- Renamed the 'download' field to 'discharge' in the FaLineItem model and updated related services and schemas accordingly.
- Adjusted frontend components to reflect the new 'discharge' terminology.
- Ensured consistency in filtering and validation logic across the application to use the updated field name.
- 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.
- Renamed 'is_processed' fields to 'status' in the InvoiceHeader model and updated corresponding attributes in schemas, services, and frontend components for consistency.
- Adjusted query filters and validation logic to reflect the new 'status' terminology.
- Updated comments and documentation to clarify changes in invoice status handling.
- Renamed fields in the `InvoiceHeader` model from `is_updated` to `is_processed` and updated corresponding attributes in schemas, services, and frontend components.
- Adjusted query filters and validation logic to reflect the new processing status.
- Updated comments and documentation to ensure clarity regarding the changes in invoice status handling.
- Added `common.py` to handle shared validation logic for line items, including checks for invoice existence, class validity, and customs data.
- Introduced `create.py` for validating new line items, ensuring required fields are present and calculating costs based on currency type.
- Created `update.py` to manage partial updates of line items, maintaining existing values when new data is not provided.
- Enhanced error handling with specific messages and solutions for various validation failures.
- Fix bidirectional R1 resolution in all report query builders (Temporary,
Definitive, Repair, Export, ExportRepair): use JOIN on
pedimento_rectification_origin in both directions so the rectified
pedimento number is resolved correctly and not duplicated.
- Restore original CSV export format (ValorComercialMN, ValorMPTemp,
ValorAgre as separate columns); compute them from item_line_financials
SUM instead of invoice-level header totals which were always 0.
- Rename CSV column "PEDIMENTO RECTIFICACION" to "PEDIMENTO R1" in both
backend csv_utils.py and frontend manual download.
- Harden temporary invoice update validator to safely handle null
compliance_mx / logistics objects without crashing.
- Add R1 rectification fields (es_rectificacion, pedimento_original, etc.)
to the pedimento other-data form and initialize their default state.
- Remove default companyId parameter from pedimentosApi methods to avoid
hardcoded company ID 1.
- Minor: whitespace cleanup, error handler adjustments, keyboard manager
fix.
- Renamed LineItem interface to Item and adjusted properties accordingly.
- Updated CreateItemData and UpdateItemData interfaces to reflect new structure.
- Modified components to use the new Item interface, removing nested lines.
- Adjusted data binding in item configuration, main data, and other related components.
- Simplified item creation and editing logic by removing unnecessary nesting.
- Ensured all references to line items are updated to reflect the new structure.