Commit Graph
1710 Commits
Author SHA1 Message Date
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
Jeppe B 965bdf55fe Merge pull request #14 from copenhagentruckwash/development
Refactor and enhance order invoices and data handling
2025-03-13 14:39:04 +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