You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[FIX] sale_product_pack: adjust discount formula for detailed packs
The discount formula for detailed packs has been updated to address inconsistencies when pricelists explicitly display discounts.
The new formula ensures accurate representation of the combined discount by correctly factoring in both the parent pack and component discounts.
Example:
Parent pack discount: 5%
Component A discount: 10%
Component B discount: 20%
The issue occurred when pricelists explicitly displayed discounts. For example, when the pricelist showed the discount percentage but did not properly calculate the combined effect of the pack discount and the component discounts, the displayed total was inconsistent.
With the new formula:
Component A effective discount:
100.0 - ((100.0 - 5.0) * (100.0 - 10.0) / 100.0) = 14.5%
Component B effective discount:
100.0 - ((100.0 - 5.0) * (100.0 - 20.0) / 100.0) = 24.0%
This ensures that when pricelists explicitly show discounts, the displayed percentage matches the calculated prices.
0 commit comments