A recurring coupon replaces the service price in getRecurringAmount

Sheernox

New Member
Env: ClientExec 7.3.0 stable (ionCube), PHP 8.5.12, MariaDB 11.4.14. Reproduced on staging on 2026-12-01.

Where: modules/clients/models/UserPackage.php, UserPackage::getRecurringAmount(). The release model is encoded.

Bug: Once a package has a recurring coupon fee (billing type -3), the method returns the coupon line's amount instead of the service price. A service priced at 8.99 with a 20% recurring coupon returns 1.798. Stock downgrade proration uses the same value, so its prorated credit is wrong while the coupon lasts.

Repro:
  1. Take a package with a recurring price of 8.99 and call getRecurringAmount() for it: it returns 8.99.
  2. Add a 20% recurring coupon that creates a billing type -3 fee for the same package.
  3. Call getRecurringAmount() again: it returns 1.798, while the catalog price (or the enabled custom price) is still 8.99.

Fix: Resolve the package price from its base recurring fee's billing cycle and the client's currency (or the custom price when enabled), and keep the coupon amount separate from it.
 
Hi there,

This has been fixed for our next version. Just a note: this is a function that isn't called anywhere in the app, so there's no actual issue in the UI, just if you use this in a custom plugin.
 
Back
Top