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 Invoice. Closing a invoice will remove all remaining 'quantity on invoice' quantities from inventory.
When a Invoice is deleted, the journal entry is removed from the database and the quantity on invoice values are readjusted. This action will not affect the income statement or balance sheet since a invoice represents an allocation of inventory and not an actual sale (monetary transaction).
Entering an invoice
Closing an invoice