Restoration Of Pending Affiliate Commissions

From WHMCS Documentation

An update routine in WHMCS 8.3.1 introduced a bug (CORE-17294) when using the Affiliate system with the commission delay feature.

This bug only affects systems that updated directly to WHMCS 8.3.1 and that use the Affiliate system with the commission delay feature.

Overview

The bug removes pending affiliate commission records during the update to WHMCS 8.3.1. The error occurs only once and is not persistent. WHMCS 8.3.2 provides a fix that recreates any erroneously-removed records using the invoice and commission payout history.

When you update from WHMCS 8.3.1 to 8.3.2 or later, the removed data will be restored and, in most cases, no further action will be required. For more information, see Further Considerations below.

If your system restored records as part of the upgrade, a notification banner will display in the Admin Area.

The notification banner is for informational purposes only. You can dismiss it by clicking the X.

Further Considerations

Most users will only need to perform the update from WHMCS 8.3.1 to 8.3.2 or higher.

Some conditions may affect WHMCS 8.3.2's ability to recreate records. Manually inspect the restored data if any of these conditions apply to your WHMCS installation:

Previous Manual Deletion of Pending Commissions

The update will recreate any pending commission that does not have a corresponding payout history entry for the affected time frame. Because manually-removed pending commissions are not tracked in affiliate accounting records, they will be recreated with any other pending commissions.

If you normally remove pending commissions manually, you must check all of the restored records after you update. Then, manually remove the unwanted records again.

Disabled Affiliate Systems

The restorative routine will not run if the affiliate system is disabled. In these cases, no automated discovery or record recreation will be performed.

If you need to know whether the routine would have restored records if the Affiliate system had been enabled, contact WHMCS Technical Support. They can analyze your database, help determine whether any pending commissions exist, and assist you in creating them.

To determine whether the affiliate system was disabled after applying the 8.3.1 update, perform these steps:

  1. Log in to the WHMCS Admin Area.
  2. Go to Configuration () > System Logs.
  3. Use the Search/Filter tab to search for Affiliate Enabled Disabled.
  4. Examine the results:
    • If there are no results, no further action is required.
    • If there are results, a entry date after your update to WHMCS 8.3.1 indicates that your system was enabled at the time of the update.

Commission Delay Change

Decreases in the Commission Delay setting's value after you update may result in fewer restored records. The restorative routine only analyzes a limited invoice and commission history. The setting is required to determine the maximum invoice history to cross reference. The decrease will result in referencing an equally fewer number of days of history.

To determine whether the setting was lowered after updating to WHMCS 8.3.1:

  1. Log in to the WHMCS Admin Area.
  2. Go to Configuration () > System Logs.
  3. Use the Search/Filter tab to search for Affiliate Delay Commission Changed.
  4. Examine the results:
    • If there are no results, no further action is required.
    • If there are results, a entry date after your update to WHMCS 8.3.1 indicates that your setting was altered after update.

If you know that the setting changed, review the invoice payment history for affiliate-tracked services. To find the oldest invoice to inspect, count the previous setting's number of days, working backwards from October 26th, 2021. For example, if your delay was 30 and is now 15, inspect paid affiliate invoices from September 26th to October 11th.

You can use a database backup from before your 8.3.1 update to compare the tblaffiliatespending table after the update to WHMCS 8.3.2. In most cases, the restorative routine will recreate all of the previous entries. Any entry that it did not recreate will have a correlative entry in the tblaffiliatehistory table clearing the pending amount. If an entry is still missing, check for the above conditions.

WHMCS Technical Support is available to assist with and address any concerns or questions you may have.