An alternate solution would be to use terms on customer record under Financial tab. A new term can be created via Setup > Accounting > Accounting Lists > Term:
- On % Discount, specify the discount percentage.
- On customer record, Financial tab, select that term.
- When an invoice is created, click on Accept Payment, the discount amount will show up under Disc. Avail. field.