fix payment application to term discounts, #14524