For a Vendor/supplier purchase enter purchase as a bill. Then enter a vendor credit for the entire credit. Apply the credit to clear the bill and you are left with a credit balance for future use.
For a customer enter an invoice and then receive payment to create a credit or create a full customer credit and apply to invoice