From cd37acb41fdbc59df7d37b5a6266a2d47ca64d9e Mon Sep 17 00:00:00 2001 From: Thomas Da Silva Date: Fri, 23 Oct 2026 11:59:52 +0200 Subject: [PATCH 1/3] feat(#122): lay out the credit note list like the order list One search over the reference, the invoice reference, the order and the customer (every word, in any order); status, type, invoice date and amount filters in a collapsed panel with chips for the active ones; columns sorted by reference, total, creation or update date, rendered by the BoDataTable and BoPagination components of default-twig. The id column is gone. The invoice reference has its own column with the date of the document; the customer shows the flag of the invoice country, the name and the e-mail. Edit and delete show only with the update or delete right on the module. The parameters of the previous list (status_id of the side menu, ref, creditNoteDateMin, creditNoteDateMax) still filter, and a parameter of the wrong shape is ignored instead of answering 400. CreditNoteHookPresenter::listRows() is replaced by CreditNoteListReader and CreditNoteListRowPresenter. Version 4.4.0. --- CHANGELOG.md | 1 + Config/module.xml | 2 +- Controller/CreditNoteController.php | 60 +-- I18n/backOffice/default-twig/en_US.php | 17 + I18n/backOffice/default-twig/fr_FR.php | 17 + I18n/en_US.php | 13 + I18n/fr_FR.php | 13 + Service/CreditNoteHookPresenter.php | 48 --- Service/CreditNoteListFilterPresenter.php | 130 +++++++ Service/CreditNoteListFilters.php | 317 ++++++++++++++++ Service/CreditNoteListReader.php | 132 +++++++ Service/CreditNoteListRowPresenter.php | 234 ++++++++++++ .../default-twig/credit-note-list.html.twig | 347 +++++++++++------- tests/Integration/CreditNoteListTest.php | 187 ++++++++++ tests/Unit/CreditNoteListFiltersTest.php | 166 +++++++++ 15 files changed, 1468 insertions(+), 216 deletions(-) create mode 100644 Service/CreditNoteListFilterPresenter.php create mode 100644 Service/CreditNoteListFilters.php create mode 100644 Service/CreditNoteListReader.php create mode 100644 Service/CreditNoteListRowPresenter.php create mode 100644 tests/Integration/CreditNoteListTest.php create mode 100644 tests/Unit/CreditNoteListFiltersTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index cc52eb4..9c8d257 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Unreleased +- The credit note list of the back-office is laid out like the order list of default-twig: one search over the reference, the number, the order and the customer; status, type, date and amount filters in a collapsed panel; chips for the active filters; columns sorted by reference, total, creation or update date; pages of the `BoDataTable` and `BoPagination` components. The id column is gone; the reference opens the modal; the invoice reference of a numbered credit note has its column, with the date of its document underneath; the customer shows the flag of the invoice country, the name and the e-mail. The search matches every word in any field, so the names of a customer can come in any order. The date filter bounds the invoice date, as before: the date of its creation for a credit note not numbered yet, the date of its number once accepted. A parameter of the wrong shape is ignored instead of answering 400. The previous parameters (`status_id` of the side menu, `ref`, `creditNoteDateMin`, `creditNoteDateMax`) still filter; `credit_note_page` and `credit_note_order` are no longer read (the list opens on its first page, newest first). Edit and Delete show only to an administrator with the update or delete right on the module. `CreditNoteHookPresenter::listRows()` is removed, replaced by `CreditNoteListReader` and `CreditNoteListRowPresenter`. - The back-office screens are translated again: their labels used the `creditnote.bo.default` domain, which the kernel stopped loading once the Smarty back-office (`templates/backOffice/default/`) was removed, since it registers a `.bo.