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:

  1. Daily billing finishes.
  2. The status of orders with failed processing is changed so that they can be included in a consolidated invoice.
  3. Consolidated invoice generation starts.

To make sure those steps are performed in that exact order, the following adjustments can be made:

  1. 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.
    1. In billing, go to System > Settings and click Events.
    2. Search for the DailyBillingFinished event and open it.
    3. Switch to the Event Handlers tab.
    4. Open BM:: ProcessConsolidatedInvoices and click Edit.
    5. 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.
    6. Click Save to apply the changes.
  2. Configure the KickSleepingOrders to happen more frequently so that it is triggered between the daily billing process end and consolidated invoice creation start:
    1. In billing, go to System > Settings and click Events.
    2. Search for the KickSleepingOrders event and open it.
    3. Switch to the Scheduler tab.
    4. Open the scheduler and click Edit.
    5. Set the Execution Interval (sec) to 3600.
    6. Click Save to apply the changes.
  3. 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:
    1. In billing, go to System > Settings and click Events.
    2. Search for the Generate Consolidated Invoices event and open it.
    3. Switch to the Scheduler tab.
    4. Open the scheduler and click Edit.
    5. Set the Next Execution Time to, for example, 5 hours before daily billing starts, but after the KickSleepingOrders event is triggered.
    6. Click Save to apply the changes.

With these configuration updates, the reseller's order should always be included in the consolidated invoice.