Commit Graph
15 Commits
Author SHA1 Message Date
Jeppe Bundgaard 0dc1581eb4 Add unit tests for self-serve invoice billing logic, refactor minute-based billing calculations, and improve error handling for billable minutes adjustments. 2026-03-26 21:09:21 +01:00
Jeppe Bundgaard ffc5d6bc21 Add support for per-department custom daily targets
- Introduced `department_daily_targets` field in criteria, renderer, and API to define daily target overrides for departments.
- Enhanced daily target logic to honor per-department overrides while maintaining backward compatibility.
- Updated SMS, email, and Slack renderers for consistent enforcement of text length limits with fallback to non-mbstring functions.
- Refactored order item update logic to improve database interaction safety by using setters.
2026-02-25 13:03:04 +01:00
Jeppe Bundgaard 08077df618 Add getOrderItemObjects and getProduct methods, and enhance Slack notifications in invoicing routes
- Introduce `getOrderItemObjects` in `orders_o` to retrieve item objects for an order.
- Add `getProduct` in `order_items_o` for product retrieval by item.
- Enhance Slack notification logic in invoicing routes for better error reporting and fixed pricing summaries.
- Temporarily comment out permission checks in certain invoicing endpoints for debugging purposes.
2026-02-02 12:57:27 +01:00
Jeppe Bundgaard 51b8198a67 Introduce goals module with methods for result, percentage, and remaining calculations
- Add `goals` class for managing goal metrics and calculations.
- Extend `goals_criteria` with timeframe initialization and validation.
- Implement `getListByCriteria` in `order_items_o.php` for product-based goal evaluation.
- Add unit tests for `goals` to validate
2026-01-26 16:24:23 +01:00
Jeppe Bundgaard 4c7084ee7b Invalidate order cache on updates and adjust delete logic for order_items_o
- Added `objectChanged()` to notify the order object when items are updated or deleted.
- Refactored `delete()` method to ensure the order is informed before executing the database query.
2025-09-24 13:00:38 +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 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 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 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 b837f572af Add handling for forced prices, arrays, and improved type checks
Introduced support for forced pricing in `addItemToOrder` and added stricter validation for array inputs in SQL queries. Enhanced JSON handling in type validation and improved code reuse with new objects. Added new endpoint `/modules/xlvask/related-orders` to fetch related orders by wash IDs.
2025-05-22 22:51:05 +02:00
Jepp9350 7b82be6c57 Implement vehicle subscription handling and department SMS feature
Added functionality to handle vehicle subscriptions in invoices, including validation and item visibility. Introduced department notification SMS capability with endpoints for creating, retrieving, and deleting SMS records. Enhanced invoice drafting logic to exclude items not flagged for inclusion in invoices.
2025-04-14 16:03:29 +02:00
Jepp9350 cc23c83aaf Add support for adding notes to order items.
Extended the `addItemToOrder` method to accept an optional `notes` parameter and updated relevant logic to handle it. Modified input validation in `orderItemsRoute` to ensure notes are a valid string. Adjusted `set_name` in `product_options_o` to handle empty strings by nullifying the name.
2025-03-06 16:05:14 +01:00
Jepp9350 d430f6ff7f Add support for related item ID in order items
Enhanced the order items functionality to include a related item ID. This involved adding a new property, updating methods to handle the related item ID, and ensuring appropriate validation and sanitation in the API routes. Also improved input sanitization for motorapi lookups to prevent SQL injection risks.
2025-02-25 18:06:57 +01:00
Jepp9350 c240bbd94f Refactor database object trait and improve data handling
Added `delete`, `restore`, and other utility methods to enhance CRUD operations, including support for soft deletes. Introduced `objectChanged` hooks across objects for better cache or event handling, ensuring scalability and maintainability. Refactored and standardized object property handling while restructuring related methods.
2025-02-12 09:23:35 +01:00
Jepp9350 707df910b0 Refactor: migrate files 2025-01-29 14:27:44 +01:00