How do I set a discount?

At the moment, discounts cannot be applied to invoices or items automatically. What you can do instead is add a line to the invoice with a negative amount (equivalent to the total discount).