How is creating a credit note ‘with refund’ is meant to be used?

I have the impression that when ‘with refund’ is used, the original invoice is cancelled but the accounting move related to that invoice is not cancelled. Then a credit note is created and the accounting moves of the credit note and of the original invoice are reconciled.

Why is the original invoice cancelled but not the accounting move related to it? I would not be searching for accounting documents of cancelled invoices because I would expect that if the invoice is cancelled, also the accounting document is cancelled. Maybe Tryton has a different concept that I don’t get yet. Can you please explain?

Yes, I think the way it works is slightly different to how you expect it to work.

Here is the relevant parts of the documentation:

Also, I think a key thing to understand is that account moves only have Draft and Posted states, so cannot be cancelled directly (this process is done by creating an additional account move that negates their effect on the accounts).

If you don’t use the “with refund” option the system just creates the credit notes for you.

I’m pretty sure that if you do use the “with refund” option (which only works for posted invoices) then the system also posts the credit notes. It then uses the credit notes account move as the invoice’s cancelling move, and then puts the original invoices in a cancelled state (if possible).

Thank you @dave for the explanation.

However, the behaviour explained as ‘Cancelling an invoice removes its effect on your accounts by either removing its Account Move, or negating it with a cancelling move.’ is not consistent with what the ‘with refund’ options does.

According to the documentation (and also what I would expect) cancelling an invoice should create a cancelling account move. That does not happen if ‘with refund’ is used but the account move of the credit note will be re-used as cancellation for the original invoice.

In my opinion that results in an inconsistency between invoices and account moves since at the end we get a posted credit note with no effect on accounting, and I would expect that an posted credit note means the customer is credited.

Also you can see it like this:

  • in accounting we get two posted account moves which negate each other
  • in invoices we have only one (the other one is cancelled) so we have it one-sided

If I understand it correctly, using the ‘with refund’ option also means that it won’t be possible to report revenue based on posted invoices or is there a way to properly select invoices based on their states?

It is consistent. You just not have to ignore invoice cancelled if they have a move.

@ced For reporting I would ignore cancelled invoices anyway but the credit note is not cancelled so the customer would have negative revenue in the invoice report due to the one credit note standing alone.

No this is not true. The payable/receivable is not computed based on the invoice state but on the accounting. So this operation is null for the payable/receivable.

@ced The payable/receivable is correct because of the two posted moves, sure. That is out of question. But the total of invoice documents is incorrect, if we exclude the cancelled invoices, is that true?

For sure Tryton will compute it exactly, but total of invoice has no meaning. It may or may not correspond to your own definition.

@ced I don’t really understand what you mean by your last reply.

However, since for us the sum of all invoices except the cancelled ones should have a correct value, we will pay attention not to use the ‘with refund’ functionality.

There are many reason why the sum of invoices have no meaning for example when different currencies are used.

I do not think it is good to have such usage convention. At the first usage all your assumption will be broken.
If you need such sum then you must include the cancelled invoice with a cancelled move.

@ced I understand that due to this logic we cannot report simply on invoices alone but has to check in accounting if an invoice was cancelled alone (and exclude that one) or the invoice was cancelled by a credit note (that original invoice should be included).

Maybe your requirement is indeed the EC Sales list.