Skip to content

Conversation

robwa
Copy link
Contributor

@robwa robwa commented Aug 7, 2025

This pull request introduces a plugin with new features related to SEPA functionality and group order invoices.

  • Group Order Invoice Features:

    • Added a new OrdergroupInvoice model and associated controllers.
    • Support for full CRUD and batch actions, including creating, downloading, and sending invoices.
    • Enhanced UI with features to toggle invoice statuses (paid, SEPA downloaded) and bulk actions.
    • PDF generation for invoices.
    • Subscription for automated email notifications on group invoice creation.
  • SEPA Enhancements:

    • Added SEPA King and IBAN tools dependencies.
    • SEPA sequence type selection support in UI.
    • Collective direct debit generation.
    • Dutch, English, and German translations for SEPA-related texts.
  • Infrastructure and Documentation:

    • Added tests and RSpec coverage for new functionalities.
    • Detailed README with configuration, setup instructions, and feature details.

@robwa robwa self-assigned this Aug 7, 2025
@robwa robwa force-pushed the feature/1200-combined-invoices branch from e85a541 to 308f15f Compare August 7, 2025 10:59
@robwa robwa changed the title Add SEPA functionality and automation for group order invoices Add group order invoice plugin Aug 12, 2025
@robwa robwa marked this pull request as ready for review August 13, 2025 08:31
@robwa robwa requested review from lentschi and yksflip August 13, 2025 08:32
@lentschi
Copy link
Contributor

lentschi commented Oct 4, 2025

@robwa Wow - that looks like a lot of work, you've done there! 👍

Before I try to review (Not sure I without a call or a screencast, in which things are explained): Is this something you wrote from scratch or something copied from a fork?
Is there an issue or a discussion, in which requirements were elaborated?

@lentschi
Copy link
Contributor

lentschi commented Oct 4, 2025

Ah, I think, I see now. This supersedes #1207 which in turn mentions https://git.local-it.org/Foodsoft/foodsoft/src/branch/automatic_group_order_invoice, right? But that still doesn't clarify all the requirements of this for me.

Maybe add an issue describing what's required linking to the existing copied code in depth...?

Alternatively someone who already knows what all this does can review, of course 😄

robwa added 21 commits October 7, 2025 13:34
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.

# Conflicts:
#	app/assets/stylesheets/application.css
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.
robwa added 23 commits October 8, 2025 15:43
Implements SEPA sequence type dropdowns for group orders and invoices.
Updates controllers, routes, views, and JavaScript for seamless integration.
Implements logic for generating SEPA XML for collective direct debits.
Adds controller action, helper methods, and routing support. Improves UI
for managing SEPA export and error handling. Updates models and JavaScript
for seamless integration. Bumps version to 0.1.0 due to new
dependencies.
Refactors SEPA collective direct debit generation logic for clarity
and maintainability. Adds helper methods to reduce duplication and
improve error handling. Updates formatting and improves overall
code structure to fix rubocop offenses.
Introduces SEPA downloaded status toggle and sequence type selection
for ordergroup invoices. Updates UI with dynamic checkboxes and
dropdowns. Adds necessary partial views, JavaScript, and controller
updates.
Introduces group order invoices configuration options and UI updates.
Adds locale translations, form fields, and deface override for tab payment.
Adds a new `tax_number` input field for admin configurations.
Updates locale files with translations for the tax number label.
Corrects `multi_group_order_ids` parameter usage in controller logic.
Re-enables UI elements for SEPA direct debit export for selected items.
Adds German translations for SEPA and invoice-related texts.
Replaces hardcoded strings with I18n in views and PDF generation.
Adds Dutch and English translations for SEPA and invoice-related texts.
Enhances UI with new SEPA options for direct debit generation.
Moves extension enabling logic to a separate method for reusability.
Updates specs to ensure extensions are explicitly enabled before tests.
This fixes javascript bug.
Enhances README with detailed features, setup, and usage instructions.
Covers SEPA, configuration, and new plugin capabilities.
Adds RSpec tests for `SepaAccountHolder` and `OrdergroupInvoice`.
Covers validation, initialization, and SEPA-specific behaviors.
Adds RSpec tests for `OrdersController` and `Finance::BalancingController`.
Covers SEPA validation, direct debit, and multi-order balancing behaviors.
Adds internationalized texts for multi-order creation messages.
Improves Dutch, German, and English translations for better clarity.
Adds RSpec specs for `MultiOrdersController` covering creation, deletion,
and invoice generation behaviors. Introduces factories for `SepaAccountHolder`
and `ordergroup_with_sepa` to support testing SEPA-related functionality.
Adds RSpec feature spec to test MultiOrder and single order display
on the Finance Balancing index page. Updates the engine to precompile
test assets for JavaScript and CSS in the test environment.
Upgrades `foodsoft_invoices` to v0.1.0 with SEPA enhancements.
Adds `sepa_king` and `iban-tools` for handling direct debits.
Introduces a new field for tax number in foodcoop configurations.
Adds `Foodsoft::AssetRegistry` to manage and register assets.
Ensures stylesheets and javascripts are precompiled after plugins load.
Replaces outdated button classes with `btn-sm` and `btn-default`.
Improves UI consistency across the finance balancing view.
@yksflip
Copy link
Member

yksflip commented Oct 10, 2025

@robwa I tried to start a review but ran into a lot of css errors after rebasing on master (not entirely sure if I did a mistake during rebase), but what I could already see that some of your changes need to adapt to the new bootstrap version.
Could you in the meantime make a rebase and try to adapt this PR to it?
This would help a lot to review so I can try stuff out and see what happens :)

@robwa
Copy link
Contributor Author

robwa commented Oct 13, 2025

Yes, I'll try to rebase this ASAP.

@robwa robwa force-pushed the feature/1200-combined-invoices branch 2 times, most recently from 747fc6f to cb75c69 Compare October 17, 2025 07:44
Adds missing `multi_order` and `multi_group_order` references to orders.
Updates test environment to include plugin factories for specs (was a
rebase error).
Fixes alert redirection method.
Fix Rubocop offenses.
@robwa robwa force-pushed the feature/1200-combined-invoices branch from cb75c69 to ebd4480 Compare October 17, 2025 07:50
Updates selector to ignore expanded rows when adding the invoice column.
Prevents unintended styling or behavior in the finance balancing view.
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.

3 participants