So I got banned from #magento on freenode for asking details about this to understand the underlying process flow. :D
I get the problem that:
- a product is ordered
- an invoice is send
- a payment is triggered by a payment provider via wire transfer
- a notice comes that the product can't be delivered
- I check if the invoice was paid
- if it wasn't I cancel the order
- now money from the customer arrives
Now I'm stuck as I can click to refund the order but the total amount is zero as I cancelled the order already. This can happen all the time, and seems to be the case if you google for it, because i.e. the wire transfer just takes some time, the customer mixes up the payments and tells you he hasn't paid yet or something alike. You can't wait to cancel for weeks just to be sure the customer doesn't pay, can you?
What workflow does magento have here? You can't cancel the cancellation, you can't refund the order, you can't tell it that it was "overpaid" so to speak. It seems you can't do anything here. The only thing I came up with was to mingle through the database and revert the cancellation so I could refund again. I found a lot of code snippets online to do so, which in my opinion hints at something.
I really like to understand the thinking / process here.