Set cancel state on refunded invoice
There are a scenario which is not very good. If a sale is set to ship on invoice paid and that the posted invoice is refund with a credit note. In this case, the invoice is marked as paid and so the sale will create the shipment instead of being in invoice exception.
So I think we could set the state of the invoice when refunded to cancel. For the accounting it does not change anything as the moves are still the same. Also the canceled invoice can not be deleted as it has a number.