Discounts have to be added first on the discounts page, before it can be applied on an invoice.