Apply Credit Memo Button. 

The Apply Credit Memo button is used to apply a credit memo (negative open invoice) or a portion of it to the invoice that is currently selected in the program.  The invoice that the credit is being applied to must be in the same currency as the credit memo, it must be status A (active), and it must be open for a positive amount.  When a valid invoice is selected and the Apply Credit Memo button is pressed, the system displays the credit memos for the vendor that are open and in the same currency as the selected invoice.  The program then allows you to specify the amount of the credit to be applied (which cannot be greater than the lesser of the invoice or the credit memo amount).  Once you specify the amount to be applied, the system adjusts the balances of the affected invoices, it writes a journal entry to record the transaction, and it fills in the check number of any completely closed invoices with 88888888 to indicate that the invoice was closed by applying a credit.

More:

Pay Invoice(s) Button