Consolidated invoice does not include a reseller's billing order
Modified on: Fri, 17 Nov 2023 1:14 PM2023-06-05
Symptoms
A reseller's billing order is missing in the consolidated invoice.
Cause
This happens when processing of a reseller's billing order fails before all its details are processed, or when processing of all reseller's billing order details completes after the consolidated invoice is created.
Resolution
Note: If the consolidated invoice of a reseller only includes one order, it is recommended to disable consolidated invoice for such a reseller.
It is possible to adjust the billing configuration so that the consolidated invoice happens after billing order processing completes:
- Daily billing finishes.
- The status of orders with failed processing is changed so that they can be included in a consolidated invoice.
- Consolidated invoice generation starts.
To make sure those steps are performed in that exact order, the following adjustments can be made:
- Configure consolidated invoice creation to start with a delay after the daily billing process completes. The idea is to let the KickSleepingOrders event that we will configure in the next step happen during this delay.
- In billing, go to System > Settings and click Events.
- Search for the DailyBillingFinished event and open it.
- Switch to the Event Handlers tab.
- Open BM:: ProcessConsolidatedInvoices and click Edit.
- Set the Delay (minutes) to the maximum time it takes to complete the daily billing process on your installation, plus a small buffer. For example, 420 minutes.
- Click Save to apply the changes.
- Configure the KickSleepingOrders to happen more frequently so that it is triggered between the daily billing process end and consolidated invoice creation start:
- In billing, go to System > Settings and click Events.
- Search for the KickSleepingOrders event and open it.
- Switch to the Scheduler tab.
- Open the scheduler and click Edit.
- Set the Execution Interval (sec) to 3600.
- Click Save to apply the changes.
- Configure consolidated invoice generation to start outside the daily billing process hours and after all orders are already processed or pushed by the KickSleepingOrders event:
- In billing, go to System > Settings and click Events.
- Search for the Generate Consolidated Invoices event and open it.
- Switch to the Scheduler tab.
- Open the scheduler and click Edit.
- Set the Next Execution Time to, for example, 5 hours before daily billing starts, but after the KickSleepingOrders event is triggered.
- Click Save to apply the changes.
With these configuration updates, the reseller's order should always be included in the consolidated invoice.