fix: product discounts are based on amount

This commit is contained in:
skeris 2023-12-13 04:51:38 +03:00
parent 0bce2ff74a
commit cbb9e180bf

@ -74,7 +74,7 @@ export const setCustomTariffsUserValue = (
const amount = state.userValuesMap[serviceKey]?.[privilege._id] ?? 0
priceWithoutDiscounts += privilege.price * amount
const discount = findPrivilegeDiscount(privilege.privilegeId, privilege.price * amount, discounts)
const discount = findPrivilegeDiscount(privilege.privilegeId, amount, discounts)
priceAfterDiscounts += privilege.price * amount * findDiscountFactor(discount)
})