Skip to content

Conversation

robwa
Copy link
Contributor

@robwa robwa commented Jul 29, 2025

Introduces the initial basic implementation of the Group Order Invoices feature, alongside various supportive functionalities. Most parts of the code are ported from https://git.local-it.org/Foodsoft/foodsoft/src/branch/automatic_group_order_invoice.

Features

  • Group Order Invoice Management:
    • Add creation, bulk creation, and deletion functionalities for group order invoices.
    • Enable toggling of paid status via UI, with actions for marking invoices as paid/unpaid in bulk.
    • Provide bulk download of invoices in a ZIP archive.
    • Support for PDF generation with taxation breakdowns (including VAT exemptions).
  • Plugin Infrastructure:
    • The above functionality is encapsulated in a new foodsoft_invoices plugin (disabled by default)
    • The plugin provides configuration settings for tax numbers and VAT exemptions.
  • Dynamic Asset Registry:
    • The plugin needs to register stylesheets and scripts to be loaded when enabled.
    • Add dynamic asset registration with Foodsoft::AssetRegistry.

Localization

  • Add Dutch, English and German translations for invoices and related UI elements.

Tests

  • Add database migration steps in Ruby CI for plugin tests to work.
  • Add basic model tests.
  • Integration/ Feature tests are not yet added, as I did not manage to get script handling in tests working. Any help appreciated.
  • Do we want more tests? If so, what kind of tests?

Missing features

  • This PR does not include all features of the Local-IT branch yet. They could be added in subsequent PRs.
  • Particularly are not yet included:
    • SEPA functionality
    • Support for Ordergroup Invoices (an invoice that can span multiple group orders for the same ordergroup)
    • Email invoice notifications
    • Settings management

Checklist

  • PDF styling is fixed.
  • Other styling issues are fixed.
  • Documentation is updated as required.

robwa added 23 commits July 25, 2025 20:44
Introduces the Foodsoft Invoices plugin with essential features:
- Basic infrastructure and initialization.
- Configuration for enabling/disabling the plugin.
- Gem dependencies and versioning.

This serves as the foundation for further invoice-related functionalities.
Adds detailed views and actions for group order invoices:
- Introduces clickable expandable rows in the orders table.
- Includes styles for better UI representation of invoice states.
- Extends the `GroupOrder` model with invoice association.
- Adds locale support for both English and German.
- Enables invoices-related partials for order management features.
Adds `Foodsoft::AssetRegistry` to handle dynamic asset registration.
Updates layout to use registered assets for stylesheets and scripts.
Ensures registered assets are precompiled after initialization.
Registers `foodsoft_invoices` stylesheets and scripts dynamically
using `Foodsoft::AssetRegistry`. Removes static asset references
from application manifest files.
Adds `tax_number` and `use_invoices` configurations to app sample config.
Introduces options for group order invoices, including VAT exemptions.
Adds invoice plugin reference to Gemfile.
Adds controller actions and routes for group order invoices:
- Allows toggling of statuses (paid, SEPA downloaded).
- Adds bulk actions for SEPA and paid states.
Introduces views and handling for invoice creation and deletion.
Includes download functionality for individual and bulk invoices.
Introduces PDF generation for group order invoices.
Includes dynamic localization for invoice details and table structures.
Adds support for both VAT-exempt and detailed taxation breakdowns.
Ensures proper functionality and confirmation prompt for deletion.
Enables toggling of the "paid" status via UI for group order invoices.
Adds partial and JavaScript rendering for seamless status updates.
Removes support for SEPA sequence type management and downloads:
- Deletes SEPA-specific helper constants, routes, and actions.
- Removes related front-end views and partials.
- Cleans up locale entries and model methods.

Streamlines the invoice plugin by focusing on core functionalities.
Introduces route, view, and controller support for bulk creation.
Provides form and modal updates for improved UI interaction.
Restores functionality to toggle all invoices as paid/unpaid in bulk.
Adds downloadable zip for all group order invoices. Updates locales.
Introduces `file` time format (%Y-%d-%B) in multiple locale files.
Supports consistent date formatting in generated file names.
Adds Dutch (nl) locale file for group order invoice functionality.
Updates English (en) locale file with fixes and refinements.
Includes foodsoft_invoices gem in Gemfile and Gemfile.lock.
Adds unit tests for GroupOrderInvoice ensuring validation and uniqueness.
Adds `null: false` constraint to `paid` and `sepa_downloaded` fields.
Ensures data integrity by explicitly disallowing null values.
Adds step to apply plugin migrations and run `db:migrate` in CI.
Ensures database schema is up-to-date before running tests.
Refactors GroupOrderInvoicePdf to enhance readability and maintainability.
Includes modular methods for VAT and VAT-exempt invoice handling.
Adds RSpec coverage for newly introduced methods and logic.
Adds detailed configuration options with examples.
Includes steps for running migrations and clarifies maintainers.
Replaces links with checkboxes for toggling individual and bulk invoice status.
Adds locale entries for new confirmation messages and updates translations.
@robwa robwa marked this pull request as ready for review July 30, 2025 07:07
@robwa robwa requested review from RayOei, lentschi and yksflip July 30, 2025 07:08
@robwa robwa self-assigned this Aug 4, 2025
@robwa
Copy link
Contributor Author

robwa commented Aug 11, 2025

Closing in favor of #1211 which includes these changes.

@robwa robwa closed this Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant