Advanced Price Management

Release: Advanced Price Management – 26.0.9791.38730

Description

This release fixes a critical calculation defect in the Discount Fee engine. When a user manually updated a unit price on a sales line, discount fees based on quantity were incorrectly squared — the discount amount was multiplied by itself instead of being applied once. This patch ensures that discount fee amounts are correctly computed and persisted on the first pass, preventing any subsequent recalculation from corrupting the value. This fix is especially relevant for Food & Beverage customers using advanced discount templates with quantity-based fee structures.

User Stories

No User Story developed in this release.

Bugs

Title Description Impact on previous version
[24628] – Discounts in value are squared when using a manual price When a discount fee with Application Base = Quantity or Quantity (Base) was applied, and the user manually changed the unit price on a sales line, the discount fee “Result Value” was multiplied by the “Application Value” a second time during recalculation, effectively squaring the discount amount. Root cause (verified from AL code): In codeunit isaAPM_PriceCalc. - isatech (ID 8120268), procedure UpdateSalesLineDetailResultValue previously set the initial Result Value without incorporating the Application Value, while procedure CalculateSalesDiscountLineDetailResultValue multiplied Result Value by Application Value on every call. When the calculation was triggered twice (once inside ApplyDiscount and again from RunBeforeValidateUnitPrice), the amount was squared. Fix: The initial Result Value now includes Application Value at creation time (UpdateSalesLineDetailResultValue), and the recalculation procedure (CalculateSalesDiscountLineDetailResultValue) now exits immediately for Discount Fee lines, preventing double multiplication. Breaking risk: Medium. Any customization or extension that subscribes to or overrides CalculateSalesDiscountLineDetailResultValue or UpdateSalesLineDetailResultValue in codeunit 8120268 should be reviewed. The calculation logic has been restructured — the multiplication by Application Value now occurs at record insert rather than during downstream recalculation. Impacted objects: Codeunit 8120268 (isaAPM_PriceCalc. - isatech).

Events

No event added or updated in this release.

Next
Previous