Commit Graph
100 Commits
Author SHA1 Message Date
Jepp9350 22562be135 Add API reference topics for XLVask OpenAPI v1
Added documentation topics for API endpoints related to `/Customers` and `/Vehicles` with GET, POST, PUT, and DELETE methods. Included a general API Reference topic and updated redirection rules for removed structure pages.
2025-05-06 12:13:47 +02:00
Jepp9350 b1ba8a2e34 Add support for vehicle reference field
Introduce a new "reference" field for vehicles to allow storing and validating additional information. Updates include parameter handling, validation, and database integration for creating, modifying, and retrieving the "reference" field.
2025-05-06 09:09:17 +02:00
Jepp9350 be9ba1a2fa Add fixed pricing logic for order invoices
Introduced a check to apply fixed pricing for customers with predefined rates. This ensures that customer-specific fixed prices override default prices before adding invoices to E-Conomic. The change improves pricing consistency and accuracy for eligible customers.
2025-05-05 16:42:03 +02:00
Jepp9350 30ff7d385e Add support for fixed pricing in collected order invoices
Introduced functionality to handle fixed prices for collected order invoices, allowing customer-specific pricing overrides. Added a new route and methods to integrate fixed pricing logic, modify invoice items, and ensure proper data management in E-Conomic. Adjusted discount calculations to accommodate cases where final price is zero.
2025-05-05 16:21:31 +02:00
Jepp9350 3868b2b867 Add attribute management methods and set default attributes
Introduced methods to add, delete, and check user attributes. Updated the user object initialization to set default attributes (`invoiceAllOrdersIndividually` and `restrictTankCleaning`). Removed redundant definitions of these methods to avoid duplication.
2025-05-05 13:53:35 +02:00
Jepp9350 91d215ffcc Add customer fixed pricing routes and object
Introduce routes for managing customer fixed pricing, including retrieval, creation, and deletion. Create `customer_fixed_pricing_o` object to handle database operations for fixed pricing data. This change enables structured handling of fixed pricing-related logic and functionality.
2025-05-05 13:36:04 +02:00
Jepp9350 8d2fe8d75d Add support for closed_at field in order invoices
Introduce the closed_at field to track closure dates for order invoices. Updated validation, processing logic, and database integration to ensure correct handling of the new field. Adjusted related routes to pass and store the closed_at value where applicable.
2025-05-01 15:45:59 +02:00
Jepp9350 8ae3a35a91 Add endpoints for unknown customer vehicles and suggestions
Introduced two new endpoints: one for listing unknown customer vehicles and another for fetching customer suggestions based on a vehicle registration. These changes include authentication, input validation, and proper logging for each new route.
2025-04-30 14:37:53 +02:00
Jepp9350 29e76b58d8 Fix and enhance order processing with improved data handling
Set proper timestamps for collected invoices and added `getLastOrderId` for vehicles. Streamlined order fetching logic by fixing parameter usage, refining customer and order item retrieval, and improving type casting in multiple methods.
2025-04-29 15:22:26 +02:00
Jepp9350 6cc5e6bbf0 Add custom routes, subscription features, and refactor orders
Introduced a new POST route for collected vehicle subscription invoices and enhanced responses with wash subscription transactions. Refactored order handling by adding department-based pricing logic and simplifying reusable methods. Various minor improvements include exception handling, input validation, and updated permissions.
2025-04-28 14:24:11 +02:00
Jepp9350 c19ed3389c Update permission check for Stripe payment intent
Replaced 'charge_order_stripe' with a more general 'charge_order' permission check in the Stripe payment intent endpoint. This ensures consistent permission handling across payment modules.
2025-04-28 09:01:15 +02:00
Jepp9350 c56955ee28 Add logic to remove vehicle subscription transactions
Introduced a method to handle the removal of vehicle subscription transactions from invoice collections. Refactored references to a hardcoded cashier ID by using a class property for better maintainability. This ensures a cleaner and more dynamic transaction-handling process.
2025-04-28 08:26:44 +02:00
Jepp9350 941ed2dce6 Disable transaction creation in wash certificate generation
Commented out the transaction creation step for bookings to prevent unnecessary or redundant transactions. This ensures the booking process focuses solely on wash certificate completion and status updates without altering the transactional state.
2025-04-28 08:11:03 +02:00
Jepp9350 e140c3242f Add default addons functionality to customer vehicles
Introduced a method to automatically add default addons to customer vehicles based on predefined product IDs. Updated the vehicle creation workflow to include the addition of these default addons. Adjusted type casting and comments for better clarity and functionality.
2025-04-24 12:40:27 +02:00
Jepp9350 28dd7d39ce Fix invoice processing logic and improve null safety checks
Updated default values for department IDs to prevent null issues and ensure proper handling of optional fields. Adjusted logic to skip non-invoiceable items and corrected department validation to avoid invalid entries. Improved overall robustness and consistency in invoice-related operations.
2025-04-23 15:47:34 +02:00
Jepp9350 7c49514a34 Ensure visibility filtering for departments
Added a `visible` property to manage department visibility. Updated routes, traits, and objects to filter out non-visible departments and restrict access to internal system departments for end-users. This improves data security and enhances control over information exposure.
2025-04-23 13:09:36 +02:00
Jepp9350 a92781cceb Add user email and phone support with security routes
Introduced support for user email and phone management, including phone country code and email validation. Added API endpoints for email change and password validation to enhance account security features. Updated Stripe processor logic for better external ID handling.
2025-04-23 10:52:13 +02:00
Jepp9350 56fa77be11 Remove unnecessary return statement in slack.php
The return statement was redundant as the function naturally concludes without it. Removing it improves code clarity and eliminates dead code.
2025-04-22 15:47:57 +02:00
Jepp9350 7a48710fb1 Validate recipients and improve SMS notification handling
Add recipient validation to the SMS gateway API to ensure no empty recipient arrays are processed. Enhance department SMS notification logic by dynamically retrieving phone numbers and logging failures for improved error tracking. Simplify SMS delivery flag logic for better readability.
2025-04-22 15:24:04 +02:00
Jepp9350 0511e6e31e Fix type casting and validation issues in SMS delete route
Ensure proper type casting for 'id' parameter and validate its length for consistency. Address potential type mismatch in department access check with explicit casting. These changes improve data integrity and robustness of the delete operation.
2025-04-22 15:08:14 +02:00
Jepp9350 3b6949cb21 Refactor phone number field and add update endpoint.
Renamed `phone_number` field to `phone` across the codebase for consistency and simplicity. Introduced a new endpoint to update department notification SMS, supporting edits to fields like `label`, `phone_country_code`, `phone`, and `enabled`.
2025-04-22 14:54:38 +02:00
Jepp9350 9025ad79b7 Set specific subscription addons to zero-priced where applicable.
Introduced logic to handle free subscription addons by setting their price to zero based on a predefined list. Updated affected areas to apply this change consistently when adding or modifying order items. This ensures correct pricing and aligns with business rules for these products.
2025-04-22 13:01:23 +02:00
Jepp9350 6edb1fdd8d Add support for fetching economic payment terms
Introduced `economicPaymentTermsRoute` and `economic_payment_terms_endpoint` to handle fetching payment terms from the economic API. Updated the `economic` class to include the new payment terms endpoint. Logging and session validation were also implemented for enhanced traceability and security.
2025-04-22 12:30:39 +02:00
Jepp9350 26ccab3d3c Add endpoint for booking collected invoices to Stripe
Introduce a new POST endpoint to handle adding collected order invoices to Stripe, with necessary validations and logging. Extend `collected_order_invoices_o` to include Stripe integration, fetching details of Stripe payment intents when applicable.
2025-04-22 12:01:55 +02:00
Jepp9350 60de6ae998 Add Stripe payment capture functionality
Introduced methods to handle Stripe payment capture and updated related classes and endpoints. Refactored constants for payment processors and integrated order collections to reflect Stripe payments. Ensured robust error handling and session validation for payment operations.
2025-04-22 10:17:06 +02:00
Jepp9350 8c70e6e3bc Enhance booking handling with service options and transactions
Added support for including customer name, department name, and parsed services in `asArray()` method. Introduced functionality for creating transactions, linking bookings to orders, and properly handling related services. Improved department daily report handling and removed unnecessary fields.
2025-04-16 12:37:57 +02:00
Jepp9350 69b39fcba2 Enhance query to include 'val' and skip empty values
Update the SQL query to fetch 'val' alongside 'user_id' and modify the logic to skip rows with empty 'val'. This ensures only relevant data is processed, improving data integrity and correctness.
2025-04-15 13:32:24 +02:00
Jepp9350 dfe3950866 Fix default values for country and currency in customer data
Previously, the country and currency fields could return null if not explicitly set. This update ensures that 'Ukendt' is returned as the default country and 'DKK' as the default currency when no value is provided, enhancing data consistency.
2025-04-15 11:32:18 +02:00
Jepp9350 627e4d87c2 Update text constants and add fallback values for customer data
Revised a string constant for transaction purposes to improve clarity. Added fallback values for address, zip code, and city in customer data methods to ensure defaults are returned when data is missing. These changes enhance robustness and readability.
2025-04-15 11:29:24 +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 6efa414251 Refactor SMS and notification logic; add email template.
Updated the SMS sending logic to improve validation and handling of recipients in `gatewayapi.php`. Refactored notification conditions in `bookings_o.php` to ensure proper fallback mechanisms. Additionally, included a new booking notification email template in `email.php`.
2025-04-14 09:58:25 +02:00
Jepp9350 e0b2e5dade Remove permission check from PDF generator test route
The unused permission check was commented out, so it has been fully removed to simplify the code. This change maintains the existing functionality while cleaning up redundant code.
2025-04-11 13:59:58 +02:00
Jepp9350 45d8f813a8 Update booking ID and modify wash certificate template
Changed the hardcoded booking ID from 434 to 477 in pdfGeneratorRoute.php to align with the correct data. Also, updated the wash certificate template image to reflect the new design or content requirements.
2025-04-11 13:17:49 +02:00
Jepp9350 a3f158a920 Refactor invoice collection creation logic in orders
Simplified the loop by removing the special-case handling for the first order. Adjusted variable usage to improve clarity and ensure proper assignment. This streamlines the creation of invoice collections for orders.
2025-04-11 12:49:37 +02:00
Jepp9350 4248a585d9 Add email and notification improvements for bookings
Refactored notification methods to handle Slack, SMS, and email delivery logic more effectively. Introduced `sendBookingNotification` email functionality and a new template for booking notifications. Improved handling of booking data for emails and centralized logic for retrieving booking details.
2025-04-11 12:16:11 +02:00
Jepp9350 b6f2629bed Add invoice splitting, booking notifications, and minor fixes
Implemented functionality to split collected order invoices, ensuring proper validation and handling processor constraints. Added a notification system to inform departments about new bookings via Slack or SMS. Also, included minor enhancements such as a corrected Gateway API URL and improved form handling for wash certificate emails.
2025-04-11 09:39:49 +02:00
Jepp9350 697181f508 Refactor booking creation to improve structure and validation
Replaced raw SQL with a consolidated object-based approach for adding bookings, enhancing maintainability and reducing redundancy. Adjusted form handling to include stricter type casting, additional property checks, and default fallbacks for wash certificate data. These changes improve code readability and error handling while ensuring consistent data processing.
2025-04-10 14:08:09 +02:00
Jepp9350 4f19efb6f9 Remove unused cron tasks and debug print statements
Commented out unused cron tasks 'CheckUnfulfilledBookings' and 'SyncBookings' in the cron configuration. Also removed a debug print statement from the booking wash form to clean up the code.
2025-04-10 13:15:29 +02:00
Jepp9350 6e77269418 Add functionality to send wash certificates to customers
Introduced a method to handle the sending of wash certificates via email for bookings with valid certificates. Updated the wash certificate generation process to trigger this new functionality automatically.
2025-04-10 13:08:39 +02:00
Jepp9350 c8df3230d1 Remove unused form and enhance wash certificate handling
The `book_interior_wash_f` form was removed due to redundancy. Added functionality to handle wash certificate generation, including safety seal and operator data, and added a new form `complete_booking_f` to finalize bookings without certificates. Adjustments were made to several related components to ensure seamless integration.
2025-04-10 12:57:29 +02:00
Jepp9350 849f1cc53e Add GatewayAPI module with configuration, routing, and core logic
Introduced a new GatewayAPI module to handle SMS messaging integration. This includes interfaces, core classes for API interaction, configuration management, and routing for config retrieval and update. Added necessary initializations in `index.php` to integrate the module seamlessly.
2025-04-10 10:51:32 +02:00
Jepp9350 9025f381df Add functionality to set user passwords and related API route
Introduce a `setPassword` method in the `users_o` class to hash and update user passwords in the database. Add a new `/superuser/user/password` API route that allows setting user passwords, with appropriate permission checks, validation, and logging.
2025-04-10 08:39:03 +02:00
Jepp9350 0a804b4d46 Replace text with signature image in wash certificates
Updated the wash certificate template to include a signature image instead of plain text in the specified table cell. Added new image assets to support this update, ensuring proper rendering and appearance. This enhances the visual presentation of the certificates.
2025-04-09 16:09:02 +02:00
Jepp9350 3ad09e9367 Fix type comparison in vehicle deletion logic
Ensure correct comparison between customer ID and user number by explicitly casting both to integers. This prevents potential logical errors when checking permissions for vehicle deletion.
2025-04-09 15:55:31 +02:00
Jepp9350 400054f0ea Add checks before defining constants and comment out sync method
Previously defined constants could cause errors if redefined, so checks are added to ensure they are defined only once. Additionally, the `syncAllUsersEconomicCustomerDetails` call in the Cron job is commented out, likely to prevent unintended executions.
2025-04-09 15:27:44 +02:00
Jepp9350 20442ea441 Set unlimited execution time and memory limit in CLI script
Added `set_time_limit(0)` to prevent timeout for long-running scripts and set `memory_limit` to unlimited to handle extensive memory usage. These changes ensure the script can handle resource-intensive operations without interruptions.
2025-04-09 15:18:34 +02:00
Jepp9350 ce2e233e5f Integrate dynamic booking data and add Economic sync task
Enhanced PDF generation with dynamic booking, department, and customer data, improving template variability. Introduced a new cron job and script to sync Economic invoice statuses, ensuring data consistency and error handling in automated tasks.
2025-04-09 15:10:30 +02:00
Jepp9350 110ac5c28f Enhance PDF generation and wash certificate functionality
Added support for presigned URLs in PDF responses and improved image handling by dynamically setting dimensions. Refactored and expanded wash certificate templates with additional fields and styles, along with a new background template. Updated HTML2PDF configuration for better rendering and full-page display mode.
2025-04-09 14:19:06 +02:00
Jepp9350 d2201448c1 Add Stripe payment intent simulation endpoint for testing
This new endpoint allows simulating Stripe payment intents for debugging purposes. It includes validation checks for session, order existence, and payment intent status, ensuring controlled execution. This functionality is intended strictly for testing and should not be used in production environments.
2025-04-09 10:58:13 +02:00
Jepp9350 1a71da0526 Refactor vehicle management and add vehicle add-on functionality.
This update refactors vehicle-related routes to include consistent endpoints, enhanced functionality, and stricter permission checks. It introduces vehicle add-on management with toggling and retrieval APIs, enabling detailed customization and user control. Additionally, the new `asArray` methods and updated logic improve data handling and validation.
2025-04-09 09:02:17 +02:00
Jepp9350 e4ec92d66c Add Stripe payment intents support and product subscription flag
Introduced functionality for handling Stripe payment intents, including creation, retrieval, and cancellation. Added a subscription_allowed flag to products for enabling subscription-specific operations. Integrated the necessary backend endpoints, object property updates, and route handling logic.
2025-04-08 14:11:11 +02:00
Jepp9350 d76bf03e95 Disable debugging output in economic_tasks.php
Commented out debug echo and print_r statements that were used for logging error messages and invoice details. This ensures cleaner output and avoids unnecessary clutter in logs during execution.
2025-04-07 10:25:34 +02:00
Jepp9350 a73a715000 Add functionality to handle error checking in Economic module
Introduce a new route for running error checks and implement a method to evaluate and clear specific invoice errors. Enhance draft handling with additional error checks and new helper methods to fetch and manage draft invoices.
2025-04-07 10:13:55 +02:00
Jepp9350 60bcbb6e75 Enhance invoice handling and filtering mechanisms
Refactored invoice draft handling to improve error checks, added support for optional fetch skipping, and enhanced currency management. Expanded filtering capabilities with date range and attribute-based filters. Adjusted Nginx config to increase FastCGI read timeout for long-running processes.
2025-04-07 07:43:47 +02:00
Jepp9350 ab91909fb3 Add "NOT ZERO" filter for active invoices validation
Introduced a "NOT ZERO" filter in `db_object_t` to enable stricter checks for fields with non-zero values. Applied this filter to enforce restrictions on active invoices in relevant routes to improve data consistency and validation accuracy.
2025-04-02 16:17:44 +02:00
Jepp9350 8bc4252089 Add Economic invoice overview and draft check functionalities
Introduce new endpoints for viewing Economic invoice summaries and running draft checks. Implement `economic_tasks` helper for managing draft validations, and enhance `collected_order_invoices_o` and SQL clauses to improve query flexibility, including handling "NOT NULL" filters.
2025-04-02 15:08:57 +02:00
Jepp9350 02b91b4c77 Update invoice handling to support custom dates and validations
Modified functionalities for creating invoice drafts by adding support for custom dates and enhanced validations. Updated methods now check and validate date formats, handle booked invoice collections, and ensure proper invoice creation workflows.
2025-04-01 15:38:27 +02:00
Jepp9350 f9379d6c14 Remove unused collected invoices transactions route
The /collected-invoices/transactions route was removed as it was no longer in use. Removing this unused code improves maintainability and reduces potential confusion in the codebase.
2025-04-01 11:54:46 +02:00
Jepp9350 5f65c5ea65 Add new routes and enhance invoice handling in backend
Introduced new superuser-only routes for handling collected invoices, including viewing invoices per order/month, invoice totals, and transactions. Enhanced validation for invoice closure with processors and added support for database views in multiple classes and objects. These updates improve backend functionality and data granularity while maintaining strict permission control.
2025-04-01 11:53:54 +02:00
Jepp9350 21563449b9 Update invoice discount line to use dynamic currency
Replaced hardcoded "DKK" with a dynamic currency variable to ensure the correct currency is displayed on invoice discounts. This improves flexibility and localization for international users.
2025-03-31 14:50:32 +02:00
Jepp9350 68ab9bc84c Add support for dynamic currency conversion in invoices
Introduced dynamic currency handling in invoice generation by adding methods to set currency and retrieve conversion rates. Adjusted logic to ensure accurate currency conversions when processing orders, draft invoices, and customer data. Default behavior falls back to DKK if no currency is specified.
2025-03-31 14:42:19 +02:00
Jepp9350 67cf1c5880 Add currency conversion logic and API endpoint for rates
Implemented a method to handle currency conversion in `currency_conversion_rates_o` and introduced a new API endpoint to fetch conversion rates. These changes improve functionality for managing and retrieving currency data through the FXRatesAPI module.
2025-03-31 13:40:42 +02:00
Jepp9350 9b53ae4403 Add fxratesapi module for currency conversion functionality
Integrated a new fxratesapi module to handle currency conversions, including API configurations, rate conversion actions, and request logging. Added support for module settings such as enablement status, API key, and daily request limits. New routes, database interactions, and object handling were implemented to facilitate the module's operations.
2025-03-31 13:19:45 +02:00
Jepp9350 a5cfbf64e4 Refactor order invoice handling and add PDF generation feature
Refactored `orderInvoicesRoute` to use a central method for fetching invoice details, reducing code duplication. Added functionality for generating and storing material transaction PDFs using a new HTML2PDF template. Updated database handling for accommodating null filters and enhanced customer data retrieval in orders.
2025-03-28 16:53:18 +01:00
Jepp9350 48bb2c194c Add feature to mark orders as completed
Implemented a new endpoint to mark orders as completed and updated the `orders_o` object with the necessary logic and database integration. Added a `completed_at` property to track when an order is marked as completed. Includes validation, error handling, and logging to ensure proper functionality.
2025-03-27 14:38:48 +01:00
Jepp9350 dce9f1b616 Refactor bookings handling and update wash certificate logic
Reverted table name from 'bookings_new' to 'bookings' and removed unused sync data structure. Updated routes to use 'wash_certificate_store' instead of 'pdf_store' for wash certificate management. Added 'taulov' as a new department legacy name entry.
2025-03-27 13:11:17 +01:00
Jepp9350 95625e70b9 Add email sending for wash certificates and update form text.
Introduced `sendWashCertificateEmail` method to handle email dispatch, including necessary exception handling for MailerSend. Updated the wash booking form text to enhance clarity and ensure appropriate instructions in Danish.
2025-03-27 11:21:23 +01:00
Jepp9350 8aee687106 Add new booking handling features and improve validations
Introduced support for a `data` property in bookings, extended form handling with additional validation and input fields, and added functionality for retrieving booking counts by date and status. Improved safety seal labeling and enhanced PDF generation comments.
2025-03-27 10:53:54 +01:00
Jepp9350 91520e1b54 Refactor booking wash certificate handling logic
Replaced `wash_certificate_store` with `pdf_store` for handling wash certificate operations. Enhanced error handling with booking status checks (pending, completed, or cancelled) and added validation for wash certificate URL existence. This improves code clarity and ensures better consistency in managing wash certificates.
2025-03-26 12:08:27 +01:00
Jepp9350 87251ee445 Add branding support to departments and related routes
This commit introduces changes to include branding information in departments. Updates were made to routes, forms, and objects to handle branding IDs and enforce validation. Additionally, a method call was added to track object changes when branding is updated.
2025-03-26 11:39:30 +01:00
Jepp9350 4deef9dc09 Add branding feature with form, route, and object implementations
Introduced a new branding functionality, including a `branding_o` object, `create_branding_f` form, and associated routes in `BrandingRoute`. Refactored the forms directory for better organization and added support for branding in departments. Extended validation, object handling, and response handling to accommodate this new feature.
2025-03-26 11:04:12 +01:00
Jepp9350 6f36dc230a Add wash certificate email functionality with attachments
Integrates a new method to send wash certificate emails, including support for attaching PDFs. Updates the email system to handle attachments and streamlines booking processes to send certificates upon completion.
2025-03-25 19:10:04 +01:00
Jepp9350 54940e7cd7 Add wash certificate generation feature and refine booking logic
Introduces a form for generating wash certificates associated with bookings, along with validations and access restrictions. Refactors booking management to integrate a new `bookings_new_o` class, enhancing structure and adding functionalities like caching and detailed error handling.
2025-03-25 18:40:42 +01:00
Jepp9350 78928a6c1b Add interior wash booking form and enhanced form validation
Introduce `BOOK_INTERIOR_WASH` functionality with new input fields, setup, and email confirmations in the booking process. Refactor form validation to include advanced field metadata, conditional display logic, and stricter validation requirements. Implement reusable methods for field requirement checks, sanitization, and dynamic metadata handling for better form management.
2025-03-25 13:09:34 +01:00
Jepp9350 82a6349218 Add booking confirmation email functionality
Implemented a new booking confirmation email template and its integration with email sending functionality. Updated form handling to trigger confirmation email after submission and enhanced error handling on department validation.
2025-03-24 14:40:22 +01:00
Jepp9350 ef6f009ad9 Add support for customer number in form submissions
Introduced a new `customer_number` property across the form handling codebase, enabling forms to store and manage customer numbers where applicable. Updated methods to handle this property, including sanitization, validation, and saving processes. Added a `beforeSave` method to set `customer_number` during form submission.
2025-03-24 11:35:06 +01:00
Jepp9350 7976b89fff Add form field options handling and invoice discount logic
Added support for defining and retrieving form field options, along with methods to manage field-specific configurations. Enhanced invoice draft generation to handle discounts, including the ability to calculate total discounts and display them as separate lines. These updates improve flexibility in forms and invoice processing.
2025-03-24 10:27:11 +01:00
Jepp9350 45328a6b72 Add PDF generation module with HTML2PDF integration.
This commit introduces a new PDF generation module leveraging the HTML2PDF library. The module generates PDFs from HTML templates, supports customization through styles and templates, and integrates with Minio for storage and retrieval. A test route is added for generating and serving PDFs dynamically.
2025-03-14 14:56:55 +01:00
Jepp9350 b95215677a Add spipu/html2pdf and tecnickcom/tcpdf dependencies
Updated composer.json to include spipu/html2pdf for HTML to PDF conversion and its dependency tecnickcom/tcpdf. Adjusted composer.lock to reflect the updated dependency tree for these additions.
2025-03-14 09:34:02 +01:00
Jepp9350 ac6976cb43 Refactor Slack message formatting for new bookings.
Updated the message format to simplify content, translate to Danish, and remove unnecessary fields. This improves clarity and aligns with localized conventions.
2025-03-13 15:23:31 +01:00
Jepp9350 411b11365d Refactor orderInvoicesRoute to clean up unused code.
Removed commented-out code snippets for better readability and maintainability. This streamlines the logic by eliminating unused query modifications and debug artifacts.
2025-03-13 14:36:17 +01:00
Jepp9350 32f0a1548f Add customer-specific filtering and refactor order invoice logic
Introduced customer attribute-based filtering for individual invoicing and enhanced collected order invoice processing with proper associations to customers and orders. Added new endpoints, fields, and utility methods to streamline data retrieval, ensure consistency, and support new use cases like 'Ready to Invoice'. Includes minor fixes, validations, and optimizations throughout the affected modules.
2025-03-13 14:35:49 +01:00
Jepp9350 f045611794 Add form handling system for dynamic form operations
Implemented a robust form management system with validation, sanitization, and database integration. Added reusable traits, classes, and methods to define, submit, and process forms. Introduced a "Book a Wash" form as an example implementation.
2025-03-12 14:35:21 +01:00
Jepp9350 aa07219b7a Add method to retrieve customer payment terms number
Introduced `getPaymentTermsNumber` method in the customer helper to fetch payment terms directly from the customer object. Refactored invoice drafts endpoint to use this method, ensuring cleaner and more reliable access to payment terms data.
2025-03-10 16:48:32 +01:00
Jepp9350 48ad281baa Add notifications module with routes, types, and helpers
Introduced a complete notifications module, including classes for managing notifications (`notifications_o`), traits for handling types and routing, and API routes to list, add, and delete notifications. Added input validation, permission handling, and JSON data processing capabilities.
2025-03-10 13:11:44 +01:00
Jepp9350 fdb536ea3e Add user data to collected order invoices array
Include customer user data in the collected order invoices payload by retrieving user information based on customer number. This ensures that relevant user details are available for further processing or integration.
2025-03-07 16:45:12 +01:00
Jepp9350 b3c4e9696f Refactor invoice handling and add total net amount calculation
Introduce logic for validating booked and draft invoices in E-conomic. Add methods to calculate the total net amount for invoice collections and improve error handling for specific invoice states. Updated related workflows to ensure consistent validation and data integrity.
2025-03-07 16:22:14 +01:00
Jepp9350 d160ecbb63 Add min and max fields to product options
This commit introduces support for `min` and `max` fields in product options. It includes backend changes to handle validation, setting, and retrieval of these new fields, ensuring compatibility. Additionally, a new `requireTypeIn` utility and `TYPE_NULL` constant were added for improved type validation.
2025-03-07 12:29:45 +01:00
Jepp9350 370760fbd3 Normalize data types for user prices and product attributes
Updated user price overrides and product attributes to enforce consistent data types. This improves data handling clarity and reduces type-related errors across the application.
2025-03-07 11:23:50 +01: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 02a5b811bc Add support for 'requires_note' property in products module
Introduced a new 'requires_note' property to the product object, including its initialization, serialization, and integration in relevant routes. This change ensures the property can be set, retrieved, and properly processed in API requests. It also updates logging to capture changes to this field when editing products.
2025-03-06 14:49:33 +01:00
Jepp9350 2038547d1c Enhance department report handling with date support
Added date parameter support for department daily reports, including validation, new functions, and route updates. Improved functionality allows fetching or creating reports for specific dates and prevents duplicate entries for the same date. Introduced a standardized date format within the API.
2025-03-06 14:37:32 +01:00
Jepp9350 9e7984b93a Cast department_id to integer in orders object
Ensure department_id is explicitly cast to an integer to prevent potential data type issues. This change improves type consistency and ensures reliability when processing order data.
2025-03-06 11:19:09 +01:00
Jepp9350 ec9f760bea Add user key management routes and enforce user context checks
Introduced GET and POST routes for managing user key-value pairs, restricted for administrative use. Added strict user context verification in `user_key_value_pairs_o` methods to ensure valid `user_id` is selected before operations. This enhances security and maintains data integrity for user-related actions.
2025-03-05 13:44:30 +01:00
Jepp9350 0d87b7acdd Add product option deletion functionality
Implemented endpoint and logic for deleting product options, ensuring user authentication, parameter validation, and proper logging. Added a delete method in the product options object to permanently remove records.
2025-03-05 11:54:17 +01:00
Jepp9350 a02729d5c6 Add module action handling and license plate lookup logging
Implemented `module_action_t` trait to standardize module actions with validation, logging, and execution. Added `module_action_logs_o` for logging module actions and integrated `license_plate_lookup_a` in motorapi for license plate lookup requests. Enhanced error handling to log failed actions and provide detailed feedback.
2025-03-05 11:11:09 +01:00
Jepp9350 cb62c66e5b Add earnings calculation and enhance department data handling
Introduced a method to calculate department earnings on a given date. Enhanced department object with new properties (dimension, created_at, updated_at) and improved data serialization for flexibility. Updated routes to accommodate these additions for more robust department insights.
2025-03-04 16:23:13 +01:00
Jepp9350 d6ed51f9ba Add endpoint to fetch the latest department daily report
Introduced a new method in `department_daily_reports_o` to select the latest daily report for a department. Added a corresponding API route to fetch the latest report details for a given department ID, with appropriate validations and access control measures. Adjusted parameter handling logic to enhance request validation.
2025-03-04 15:19:40 +01:00
Jepp9350 bf4879e593 Enhance product options and invoice data handling
Added support for `name`, `created_at`, and `updated_at` fields in product options API response for better data visibility. Updated invoice object logic to conditionally set draft and booked IDs based on `external_id`, improving flexibility and accuracy in handling external integrations.
2025-03-04 14:04:46 +01:00
Jepp9350 4d593c2b17 Add department daily reports feature and improve product handling
Introduced functionality for managing department daily reports, including endpoints for creating, updating, listing, and viewing product sales data. Enhanced product handling in reports by adding support for water usage, notes, and detailed product sales metrics. These changes improve tracking and reporting accuracy across departments.
2025-03-04 11:39:38 +01:00