diff --git a/replit.md b/replit.md index b47d895..5a1a166 100644 --- a/replit.md +++ b/replit.md @@ -40,7 +40,7 @@ The platform is built with a clear separation of concerns, utilizing a modern fu - **Reporting:** Statistical reporting, including monthly summaries of deliveries. - **UI Harmonization:** All detail modals across modules (orders, deliveries, calendar) use a unified component for consistent information display. - **Analyse Vente (Sales Analysis):** A dedicated module for admins and directors that displays a configurable external URL/IP in an iframe. Configuration is managed via a dedicated tab in the Utilities page, allowing administrators to set or update the sales analysis dashboard URL. The menu is visible only to admin and directeur roles, ensuring proper access control. Includes intelligent error handling with informative messages when the URL is not configured. Features a refresh button to force complete iframe reloads. -- **Échéancier des Paiements (Payment Schedule):** A comprehensive payment deadline tracking system integrated with NocoDB. Displays monthly aggregations of supplier payment schedules with breakdown by payment method (Virement, Traite, Traite Magnétique, Chèque). Features include: role-based access (admin/director), group-based filtering with selectedStoreId, Zod validation for security, robust supplier name normalization (case/accent/whitespace handling), monthly statistics with payment method breakdowns, and configurable NocoDB column mapping for due dates. Requires configuration of nocodbDueDateColumnName in Groups settings and paymentMethod in Suppliers. **Security (November 2025)**: Implements strict authorization - directors can only access their assigned groups, preventing cross-group data access. +- **Échéancier des Paiements (Payment Schedule):** A comprehensive payment deadline tracking system with hybrid architecture for optimal performance. **Architecture Refactorization (November 2025):** Due dates are now stored locally in deliveries table (dueDate column) as the single source of truth, retrieved once during invoice verification from NocoDB and cached locally for fast queries. Features include: role-based access (admin/director), group-based filtering with selectedStoreId, intelligent fallback to NocoDB for historical deliveries without cached dates, automatic date normalization handling multiple formats (ISO, French DD/MM/YYYY, American MM/DD/YYYY), monthly aggregations with payment method breakdowns (Virement, Traite, Traite Magnétique, Chèque), Zod validation for security, and robust supplier name normalization. Requires configuration of nocodbDueDateColumnName in Groups settings and paymentMethod in Suppliers. **Data Flow:** Invoice verification → NocoDB (fetch dueDate) → deliveries (local storage) → payment-schedule (fast local reads with NocoDB fallback). **Security (November 2025)**: Implements strict authorization - directors can only access their assigned groups, preventing cross-group data access. ## External Dependencies - **API Météo:** Visual Crossing API