Expired voucher codes in Order calculator stack

mikko.ropanen
mikko.ropanen Spryker Solution Partner Posts: 27 ✨ - Novice

The order calculator stack is run when doing e.g. returns https://github.com/spryker-shop/suite/blob/master/src/Pyz/Zed/Calculation/CalculationDependencyProvider.php#L251

In the DiscountCalculationPlugin, this method is run: \Spryker\Zed\Discount\Business\Calculator\Discount::retrieveActiveCartAndVoucherDiscounts

Here it's only retrieving vouchers that are currently active. So, if the order was placed with a then-active voucher code that has since expired, the calculation will ignore it and calculate the order discounts wrong.

How is this supposed to work?