Using the IOM it is possible to configure a customer to not generate an invoice for each order or dispatch, but to generate one invoice for all orders/ dispatches within a certain time frame (so-called aggregated invoices) for each customer.
This concept describes the basic ideas and the implementation of the feature aggregated invoices. The target audience are developers and consultants.
Term | Description |
---|---|
B2B | Business-to-Business |
EJB | Enterprise Java Beans |
IOM | The abbreviation for Intershop Order Management |
OMS | The abbreviation for Order Management System, the technical name of the IOM |
OMT | The abbreviation for Order Management Tool, the graphical management tool of the IOM |
ScheduleDO | Database table in IOM that contains the configurations for different custom jobs |
In general IOM can be configured to generate an invoice at certain points in the order flow through the system. E.g., an invoice can be generated when the order arrives at IOM or per dispatch that is being made.
For other business scenarios, e.g., B2B, it may be required to generate invoices for all orders or dispatches within a certain time frame, so-called aggregated invoices.
Customer settings can be configured to provide aggregated invoices. Additionally, an aggregation interval describes how often the customer gets the aggregated invoice, e.g., (daily, weekly or monthly). The configuration can be done in the OMT.
Once this setting is enabled the customer will receive only aggregated invoices for all orders with the payment method on account. Any other payment method still will generate a single invoice per order/ dispatch even if aggregated invoices are configured for the customer.
Note
Aggregated Invoice only when order payment is on account
This is hard-coded in default InvoicingDecisionBean
of IOM. A custom InvoicingDecisionBean
can be implemented and configured to override this behavior.
Note
Aggregated Invoice requires enabled Jobs
The aggregation jobs of IOM are disabled by default. They have to be activated.
This means that if the setting is enabled for one of the shop's customers, the jobs to aggregate invoices also need to be activated since otherwise no invoices will be created for the customer at all.
With IOM 2.2 a set of preconfigured jobs will be delivered, which are responsible to create aggregated invoices for dispatches where no invoice exists yet.
Technically one EJB is used for all job configurations (ScheduleDO
), and the different configIds
of the ScheduleDO
determine what the job does.
The individual jobs do not filter the dispatches to be aggregated by comparing the time frame but work on all dispatches for each customer that are not yet invoiced. Thus once the jobs are enabled, they aggregate all past dispatches regardless of how old they are.
key | configId | comment | runs at |
---|---|---|---|
aggregate_invoices4dispatches_daily | 1 | Per customer with the daily setting, aggregates all dispatch positions that are not invoiced yet into one invoice. | daily at 23:30 |
aggregate_invoices4dispatches_weekly | 2 | Per customer with the weekly setting, aggregates all dispatch positions that are not invoiced yet into one invoice. | weekly on Friday 23:30 |
aggregate_invoices4dispatches_monthly | 3 | Per customer with the monthly setting, aggregates all dispatch positions that are not invoiced yet into one invoice. | last day of each month at 23:30 |
aggregate_invoices4dispatches_weekly_cleanup | 4 | Per customer with the weekly setting, aggregates all dispatch positions that are not invoiced yet into one invoice. This means that at the end of the month all dispatch positions are invoiced, regardless of the weekday. | last day of each month at 23:45 |
aggregate_invoices4dispatches_disabled_cleanup | 5 | For all customers that have aggregate invoices disabled, creates one invoice per dispatch that has no invoice yet. This handles the case that the aggregate invoices switch was disabled for a customer, but he is missing the last aggregated invoice. | daily at 23:50 |
Note
Aggregation jobs are not active by default
Please note that the jobs for aggregating invoices are not active per default and need to be activated in the database.
Note
Do not use the current jobs for invoice aggregation on orders
One might think that the job to aggregate dispatches can also be used when the shop is configured to generate invoices per order, but the problem will appear that the cleanup job (configId 5) will generate invoices for all dispatches for all customers that have aggregate invoices switched off (regardless of whether the order itself was already invoiced). So at least the cleanup job cannot be used in this scenario.
Note
The IOM currently does not include jobs for aggregating orders
If you have configured the business processes to generate invoices for non-aggregated orders, you need to write another job (bean) and configure this new job with several ScheduleDOs.
In case you have configured the business processes to generate invoices for orders, you need to write another job (bean) and configure this new job with several ScheduleDOs.