1. nopCommerce version: 4.40 (but likely in older versions too)
2. Expected behavior: Points should be taken from the rewardPointsHistoryEntry.Points
3. Actual behavior: Points are calculated using the current (today's) configuration
4. Steps to reproduce the problem: See code snippet below
5. Any private modifications you made to your nopCommerce: Any custom configurations/code would also be impacted, because of the "point in time" configuration problem.
protected virtual async Task ReduceRewardPointsAsync(Order order)
{
...
var totalForRewardPoints = _orderTotalCalculationService
.CalculateApplicableOrderTotalForRewardPoints(...
var points = ...
await _orderTotalCalculationService.CalculateRewardPointsAsync(...
...
//get appropriate history entry
var rewardPointsHistoryEntry = await _rewardPointService.GetRewardPointsHistoryEntryByIdAsync(...
...
//or reduce reward points if the entry already exists
await _rewardPointService.AddRewardPointsHistoryEntryAsync(..., -points ...