This is an expensive inducement to obtain payment from a customer and needs to be treated with caution. It is only viable when your net margin is high and you have the staff to control unauthorised deductions. If only bad payers are offered cash discounts, all your good payers will want the same benefit.
Terms of '2% 10 days, net 30 days' should produce fast payment because a customer would be silly to ignore the effective lower net price. Your annualised cost is huge (36% pa for the example above) and more expensive than waiting an extra 2 months for payment. Also, it is difficult to recover deductions from payments made too late to qualify.