Commit Graph
505 Commits
Author SHA1 Message Date
Jeppe Bundgaard 3dca3c8a24 Add support for date range in department daily reports
- Introduced optional `date_to` parameter across relevant routes and methods for handling date ranges in department daily reports.
- Added `getDate_to` method and refactored date validation logic into `validateDateLocally` for reuse and reduced redundancy.
- Updated SQL queries in `department_daily_reports_o` to support date range queries using `BETWEEN`.
- Enhanced error handling and parameter validation for date-related inputs.
- Cleaned up comments and redundant code for improved readability.
2025-09-03 12:52:03 +02:00
Jeppe Bundgaard c2a5bad0a8 Improve error handling for draft invoice lines and refine invoice collection logic
- Added detailed error handling in `economic_invoices_draft_endpoint` to throw exceptions with line-specific error messages when adding draft invoice lines fails.
- Removed unnecessary `echo` statement from `orderInvoicesRoute`.
- Updated `collected_order_invoices_o` to allow empty invoice collections for customers with fixed price agreements.
2025-09-02 15:49:39 +02:00
Jeppe Bundgaard 6e539a92d6 Remove deprecated scanner test endpoint in moduleScannerRoute
- Deleted the `/modules/scanner/test` route, including unused cURL implementation and base64 image logic.
- Cleaned up related comments and redundant code.
- Updated comments to reflect future usage plans with OpenAI integration.
2025-09-01 10:12:30 +02:00
Jeppe Bundgaard 81aa406fb6 Add License Plate Recognizer integration and vehicle product suggestion route
- Implemented `licensePlateRecognizer` module with configuration classes (`enabled`, `api_key`) and API handling.
- Introduced `moduleConfigRoute` endpoints for fetching and updating `licensePlateRecognizer` configurations.
- Added `vehicleProductSuggestionRoute` with logic to fetch product suggestions based on vehicle plates.
- Extended `moduleScannerRoute` with license plate recognition test and exception handling.
- Updated `index.php` to include `licensePlateRecognizer` class.
2025-09-01 10:11:37 +02:00
Jeppe Bundgaard 7a852f5b54 Add nullable return types and improve exception handling in MotorAPI
- Updated `getCachedResult` methods across `motorapi`, `motorapi_i`, and `motorapi_lookups_o` to return `?object` for nullable results.
- Enhanced error handling in `xlvask_parser_stor_bil` by wrapping `getLicensePlateInformation` in a try-catch block to handle API exceptions gracefully.
- Introduced `cleanJSON` method in `motorapi` to sanitize and validate JSON data, ensuring robust parsing of cached responses.
- Optimized `getCachedResult` logic to handle null and invalid JSON scenarios with detailed error reporting.
2025-08-31 13:33:10 +02:00
Jeppe Bundgaard c95116f2c9 Add float type support and SQL handling for float values in object properties
- Included `float` as a valid type in type validation.
- Added SQL update logic for handling float values in object properties.
2025-08-27 08:40:24 +02:00
Jeppe Bundgaard 455cd14f22 Add latitude and longitude properties to departments
- Introduced `latitude` and `longitude` properties in `departments_o` for geographic data support.
- Updated department routes to handle latitude/longitude in responses and parameter updates.
- Adjusted serialization and object creation to include new properties.
2025-08-26 16:47:36 +02:00
Jeppe Bundgaard 5f400e1dd0 Add advanced invoice handling, cached result lookups, and customer-specific pricing
- Enhanced `orderInvoicesRoute` with `reset`, `unlink`, and `remove-special-arrangements` handlers for invoice actions, improving E-Conomic integration.
- Added `resetPricesOfItemsNotIncludedInInvoice`, `setAllItemsToBeIncludedInInvoice`, and `unlinkFromEconomic` methods in `collected_order_invoices_o` for robust invoice control.
- Introduced `getCustomerProductPrice` in `orders_o` to calculate customer-specific product pricing with discounts.
- Added `getCachedResultsBySubstring` in `motorapi_lookups_o` for efficient cached lookup based on result substrings.
2025-08-25 15:59:03 +02:00
Jeppe Bundgaard 2721ef6620 Update product options defaults and include price in output array
- Set default values for `min` and `max` when null (`0` and `-1` respectively).
- Added `price` property to the output array for enhanced product data completeness.
2025-08-19 14:19:52 +02:00
Jeppe Bundgaard a0fd41fba1 Add image upload support, file handling improvements, and OpenAI integration
- Introduced `uploadRoute` to handle image uploads with MIME type validation and size restrictions.
- Added `upload_store` class for managing file storage and generating presigned URLs for upload/download.
- Enhanced file server to differentiate between PDFs and uploaded files, supporting dynamic content delivery.
- Integrated OpenAI module for License Plate Recognition (LPR), including API configuration and schema validation.
- Updated core structure with new interfaces (`minio_uploads_i`, `openai_i`) and classes (`openai`, `upload_store`).
- Adjusted `index.php` and file routes to support dynamic MIME checks and direct link generation.
2025-08-18 16:50:30 +02:00
Jeppe Bundgaard 841062bfca Add product IDs to category array and update product count calculation 2025-08-13 17:21:51 +02:00
Jeppe Bundgaard f281b1c4d6 Skip orders without registration number and simplify order queries for department-based filtering 2025-08-07 12:19:15 +02:00
Jeppe Bundgaard abd21e0ad7 Add OCR processing integration and module scanner routes
- Implemented `get_ocr_result` method in the `ocr_space` class to interact with the OCR Space API.
- Added `process_ocr` method to `image_processor_t` for handling OCR logic.
- Updated interfaces (`ocr_space_i` and `image_processor_i`) to support OCR functionality.
- Introduced `moduleScannerRoute` with endpoints for testing and license plate recognition workflows.
- Included data validation and exception handling for OCR processing.
2025-08-06 15:19:43 +02:00
Jeppe Bundgaard 69ceafcce6 Add OCR Space module with configuration and image processing support
- Introduced `ocrSpace` module with classes: `ocr_space`, `ocrSpace_c`, and configuration objects for `enabled` and `api_key`.
- Added routes for fetching and updating OCR Space configuration.
- Created `image_processor` class and interface for handling and processing base64-encoded images.
- Integrated new traits and classes for image validation and processing.
- Updated `index.php` to include `ocr_space` and `image_processor`.
2025-08-06 10:27:39 +02:00
Jeppe Bundgaard f98ca5f199 Update getTransactionsForCustomersInDateRange to include exception handling for invalid date ranges and no transactions found 2025-08-04 11:47:29 +02:00
Jeppe Bundgaard c397c20ea7 Refactor discount calculation and integrate MotorAPI checks in XL Vask module
- Updated `orders_o` to use `round` for consistent discounted price calculations.
- Refined `xlvask_parser_stor_bil` with MotorAPI-based vehicle type validation and added `checkMotorAPI` method.
- Optimized `motorapi_lookups_o` license plate validation to streamline database queries.
2025-07-29 15:13:09 +02:00
Jeppe Bundgaard e449b25092 Add Certbot Service with Dockerfile and Adjust Nginx Config Path
- Added `services/certbot/Dockerfile` for Certbot configuration with Ubuntu 22.04.
- Set up volumes, dependencies, and command for automatic certificate renewal.
- Corrected Nginx configuration file path in `services/nginx/Dockerfile`.
2025-07-29 10:52:36 +02:00
Jeppe Bundgaard f5ba9dd891 Add product discount calculation and update handling for dynamic usage logs
- Introduced `getProductDiscountPercentage` method to calculate accurate discounts for users across products, categories, and global settings.
- Adjusted `importUsageLogs` to refine date modifier parameter and enhance `usage log` checks.
- Enhanced `orders_o` to include product discount logic with stricter type casting for consistency.
- Added `updateFieldsWhere` method for selective database updates based on specific conditions.
- Updated `customers_o` to handle updates for existing customers while adding new ones.
2025-07-23 09:31:43 +02:00
Jeppe Bundgaard 16198f49e6 Refactor XL Vask module for better null handling and primary item validation
- Improved null safety by updating product ID retrieval logic in parsers and usage logs.
- Enhanced primary wash item selection with stricter checks for valid product types.
- Adjusted import date modifier in `importUsageLogs` for extended range (`-7 day`).
- Streamlined product and user association in order creation with additional validations.
- Removed redundant checks and refined permission handling in import tasks.
2025-07-21 16:47:05 +02:00
Jeppe Bundgaard 4cc270e258 Refactor order creation to use addArray method and sanitize inputs
- Introduced `addArray` method in `orders_o` for streamlined order creation using an associative array.
- Updated `ordersRoute` to utilize `addArray`, replacing older implementation for better manageability.
- Improved input handling by trimming whitespaces from registration numbers.
- Enhanced product pricing by incorporating department-specific prices and discount percentages.
2025-07-21 13:10:15 +02:00
Jeppe Bundgaard af3b0666fb Add import tasks and new parsers to XL Vask module
- Introduced `runImportTasks` method for vehicle, user, and usage log imports.
- Added new product parsers: `ht_b_rstel_s`, `ht_turbo`, and `ikke_b_rster_p_kabinen`.
- Implemented simulation and duplicate detection for usage logs via order objects.
- Updated usage log handling to include default customer checks and user association.
- Enhanced request handling with fast-link functionality for usage orders.
2025-07-21 10:32:56 +02:00
Jeppe Bundgaard e057b225a6 Make importUsageLogs and getUsageLogsFromXLVask accept dynamic date modifiers 2025-07-16 13:59:08 +02:00
Jeppe Bundgaard 648a58b724 Add import usage logs functionality to XL Vask module 2025-07-16 10:38:06 +02:00
Jeppe Bundgaard 7a4c53df1b Add xlvask_usage_log_id property to wash item usage log 2025-07-16 10:02:17 +02:00
Jeppe Bundgaard 4e89d168de Add wash item usage log functionality to XL Vask module 2025-07-16 09:01:03 +02:00
Jeppe Bundgaard 6a696eeb71 Add usage logs functionality to XL Vask module 2025-07-16 09:00:51 +02:00
Jeppe Bundgaard f74a904738 Add import vehicles functionality to XL Vask module 2025-07-15 15:01:03 +02:00
Jeppe Bundgaard 026942f772 Add import customers functionality to XL Vask module 2025-07-15 14:25:40 +02:00
Jeppe Bundgaard 1551d37f19 Handle null salesPrice in product mapping 2025-07-15 12:36:39 +02:00
Jeppe Bundgaard fb28c7a7df Remove unused delete method from customer_vehicles_o class 2025-07-15 10:52:17 +02:00
Jepp9350 ffd0606ece Enhance xlvask_tasks: introduce date range options and additional debug outputs for runSyncUsage. Add new parsers xlvask_parser_ingen_b_rster_foran_no_brush_wash_front and xlvask_parser_ht_dysebom and integrate into xlvask_helpers. Improve rate limiting and reduce FastCGI timeout in nginx configuration. Adjust execution time and memory limits in cli.php. 2025-07-14 09:22:32 +02:00
Jepp9350 edcb6e5926 Adjust cron job intervals: increase execution intervals for SyncUserEconomicCustomerDiscounts, SyncEconomicInvoiceStatus, and SyncXLVaskModuleCron to reduce frequency. 2025-07-11 08:37:34 +02:00
Jepp9350 0f8ec71ffe Enhance orders_o: add wash ID, timestamp creation, and detailed debug logging for mismatched totals. Add new parsers (xlvask_parser_ikke_b_rster_mellom_bil_og_trailer, xlvask_parser_s_be_dysebom_tak) and integrate into xlvask_helpers. Set memory limit in moduleXLVaskRoute. 2025-07-06 19:31:07 +02:00
Jepp9350 7a8edd0f28 Enhance orders_o and InvoicingPeriodRoute: expand duplicate detection logic by including additional registration fields, refine duplicate filtering criteria, and update transaction handling flag for possible duplicates. Add new xlvask_parser_ikke_ht_dysebom_mellom_bil_trailer parser and integrate it into xlvask_helpers. 2025-07-06 13:38:34 +02:00
Jepp9350 112f28228d Enhance vehiclesRoute: strip whitespace from vehicle registration numbers before setting values. 2025-07-03 12:23:02 +02:00
Jepp9350 3d8700bad6 Refactor InvoicingPeriodRoute: add meta parameter for transactions, enhance fixed pricing retrieval, and implement utility method for array-based object matching. 2025-07-03 09:59:12 +02:00
Jepp9350 bf6c2d711d Refactor getOrder in order_items_o: add explicit type casting for order_id to ensure proper ID handling. 2025-07-02 12:19:43 +02:00
Jepp9350 c429c359ea Refactor getOrdersWithPossibleDuplicates and InvoicingPeriodRoute: simplify duplicate order detection, enhance customer transaction handling, and streamline object construction for improved efficiency. 2025-07-01 13:51:31 +02:00
Jepp9350 f503a5379e Enhance orders_o, order_items_o, and InvoicingPeriodRoute: add transaction and calculation methods, implement debug execution timing, refine invoicing period handling, optimize order retrieval, improve caching, and expand database query logic. 2025-07-01 13:01:01 +02:00
Jepp9350 e583a269d0 Add getOrdersWithPossibleDuplicates method in orders_o and getPossibleDuplicates method in InvoicingPeriodRoute to identify and handle potential duplicate orders within a specified date range. 2025-06-30 17:39:11 +02:00
Jepp9350 6b80637208 Refactor InvoicingPeriodRoute and vehiclesRoute: streamline invoicing period data retrieval, enhance transaction handling across customer types, introduce new methods for efficient object construction, and add improved type validation in object_property. 2025-06-30 14:37:37 +02:00
Jepp9350 e0f582289f Refactor orders_o, InvoicingPeriodRoute, and object_property: enhance ID validation, streamline customer processing, and improve method structures for better data handling. 2025-06-26 16:55:37 +02:00
Jepp9350 c5a6b2006f Add methods for retrieving customers and transactions within date ranges, enhance orders_o functionality, and improve customer object construction in invoicing routes. 2025-06-26 16:06:02 +02:00
Jepp9350 1bcd15fa2f Enhance customer_vehicles_o: add asArray caching with expiration, implement cache invalidation in object changes, and improve vehicle update flow with cache management. 2025-06-26 12:33:38 +02:00
Jepp9350 5b88ef9dc3 Refactor order and order item management: add cache invalidation, improve object change tracking, and enhance asArray conversion with caching and expiration support. 2025-06-26 08:55:58 +02:00
Jepp9350 0e90c80ee1 Uncomment vehicle cache retrieval in xlvask_vehicles helper. 2025-06-26 07:59:46 +02:00
Jepp9350 2b3ebfe357 Add xlvask_parser_h_nger to XLVask helpers imports for extended parsing functionalities 2025-06-24 10:40:52 +02:00
Jepp9350 c16d8729cb Add xlvask_parser_h_nger to XLVask helpers imports for extended parsing functionalities 2025-06-24 09:48:10 +02:00
Jepp9350 b65b1346bb Update XLVask helpers: modify parser setup string, add 'Hænger' to usage log, and clean up whitespace. 2025-06-24 09:39:20 +02:00
Jepp9350 c0ff18761d Add useDynamicPricing property and getUnitPriceExVat method in XLVask helpers. Refactor parsing logic to use integer type casting for price and count. 2025-06-24 09:16:03 +02:00