issue #19550: Fix problem calculating discount.