56

When Unified Pricing Management (UPM) is enabled on a sales order, supplementary items that are marked as Free of Charge (SuppItemFree = Yes) receive a price calculated by UPM instead of the expected zero price. This behavior contradicts the explicit configuration intent and breaks a core supplementary item feature that functions correctly in all non-UPM scenarios.

Steps to reproduce:

  1. Enable feature: Unified Pricing Management
  2. Create a sales order for a customer
  3. Confirm that UPM calculates a price on the order
  4. Add a supplementary item via the supplementary items feature (SuppItemTable) with Free of Charge = Yes
  5. Observe: the supplementary item line carries a non-zero price

Root cause (technical):

SuppItemCreate_Sales.updateSalesLine() calls SalesLine.updateRetailDiscounts() unconditionally for all lines, regardless of the Free of Charge flag. When UPM is active, GUPSalesLine_Extension overrides shouldUpdateRetailDiscountsInternal() to return true for all UPM-enabled orders — including standard SCM orders without a Retail channel. This causes a whole-order recalculation via RetailSalesOrderCalculator::setPricesDiscountsOnOrderOnServer(), which reprices all lines including the intentionally zero-priced free supplementary item. The ManualEntry change policy set by initFromTmpSuppItem() does not reliably prevent this recalculation because GUP's guard in GUPSalesOrderCalculator.setPriceOnCurrentLine() uses a different field reference (PriceDiscResultFields.Price) than the one stored by the standard code (SalesLine.SalesPrice), causing the guard to be bypassed.


Expected behavior:

Supplementary items with Free of Charge = Yes must retain a zero price regardless of whether UPM is enabled, consistent with the behavior in standard SCM orders without UPM.

Business impact:

  • Customers are unintentionally charged for items that should be delivered free of charge
  • Affects any company using both UPM and the supplementary items functionality (common in manufacturing, distribution, and retail-adjacent scenarios)
  • Cannot be resolved through configuration alone — a code fix or official extension point is required
  • Workaround requires a custom extension that suppresses updateRetailDiscounts() per line, which creates upgrade risk and maintenance overhead

Suggested fix:

SuppItemCreate_Sales.updateSalesLine() (or the GUP CoC extension layer) should check whether the corresponding supplementary item is flagged as Free of Charge and, if so, skip the UPM retail discount recalculation for that line. Alternatively, the standard code in initFromTmpSuppItem() should set SkipPriceDiscCalc = Yes for free supplementary items, consistent with how GUP handles its own free item lines (IsFreeItemLine).

STATUS DETAILS
New