Sales orders can only be deleted if no items have been shipped from the invoice. If any items have been shipped, the corresponding invoice/sale must be removed before the invoice can be deleted. In this case, the invoice should be closed. See Closing a Credit Memo. Closing a invoice will remove all remaining 'quantity on invoice' quantities from inventory.
When an credit memo is edited, the journal entry is removed from the database and the quantity on hand values are readjusted. This action will affect the income statement and balance sheet since a credit memo represents an actual sale (monetary transaction).
Entering a credit memo
Editing a credit memo
Closing a credit memo