To create a credit note in ERPAG, the sales order must be invoiced. Once you generate an invoice, the button for the credit note will appear. It doesn't matter whether the document is unpaid or it's partly paid. However, if the invoice is paid in total, you won't be able to create a credit note.