Add option to leave orders out of reports

Created on 30 October 2023, 8 months ago

Problem/Motivation

We have a setup in which we use Drupal Commerce to power both a webshop and a physical point of sale. Our point of sale has a training mode that we can use to train new employees. Orders made in training mode are marked using a custom field.

We would like to be able to exclude the training orders from the reports. But currently \Drupal\commerce_reports\OrderReportGenerator::generateReports() just loads all entities of type commerce_order and passes them to reporting plugins. Of course we can decorate the commerce_reports.order_report_generator service and implement our own generateReports() method. But with a few code changes in the Commerce Reporting module we might enable a more elegant way that is usable for different use cases.

Steps to reproduce

N/A

Proposed resolution

TBD

Remaining tasks

- Design solution
- Create MR
- Review MR
- Merge MR

User interface changes

N/A

API changes

Introduce an option to filter out orders when generating reports.

Data model changes

N/A

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands ricovandevin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024