fix payment application with term discounts, #5318