Add an one click cancelation action to sales

In companies with many automatically recorded sales (webshops) it often happens that a customer withdraws from the contract despite payment and order.
In this case, it would be good if the person who receives the information at that moment can cancel the sale with only one action.

This action should cancel/delete invoices that have not been posted and cancel/delete shipments that have not been delivered.

If the invoice is paid, I would also automatically create a credit note.

How best to proceed with delivered items I don’t know - but certainly you could then create a return, but should not automatically credit the invoice.

What do you think?

I mean a complete withdraw. All other cases should be handled as is.

This has been discussed many times. The process is too complex with too much choices that it is not practical.

We use the “Process Sale after” configuration to give a grace period to cancel the sale.

Hi Jan,

I thought we alredy discussed this on the forum but I can not find any post :sweat_smile:

We have always been complained about that is very dificult to cancel a sale once it has been alredy proceesed, indeed we have some custom module that adds a button to cancel the sale and also ingore the exceptions in a single click.

The main problem I see is that there are a lot of possiblities and cases to manage. Indeed you already have some doubts:

This makes me think there is no solution for all cases or it will be more complex that the current exception management.

I thought this would be difficult - and I also looked for a discussion and did not find one.
I’ll have to take another look to use the grace time - in our case, the invoices are paid immediately and the delivery is reported to the warehouse straight away.
It’s really just in case the customer immediately changes his mind. I will probably do this in a custom module.

Probably you want to use the sale_payment module to just track the payment and relate it to the sale. From there you can generate the invoice later when the shipment is done.

With sale_payment and grace time, you can not cancel the sale as long as the payment has not been reimbursed. We do that for a webshop automatically when the customer cancel its order but it is possible because we support only some kind of payment (ex: using the Stripe Refund). But there may be some possible work to create a generic workflow.

Thanks for the input, sometimes you just need to talk about something to get clearer :slight_smile:
I already use sale_payment and it works great.

Somehow grace time doesn’t fit into our workflow, as the goods are usually packed and shipped immediately after order if they are in stock. An invoice, which must already have been created, goes in the package.

Another reason for cancellations are products that are not in stock and have to be procured first. Long delivery times are then normal and products can sometimes not be delivered after all. This variant can no longer be solved with grace time.

I will think more deeply about the facts.

It really depend on what you allow for your customers. Most of the webshop does not allow any change after the payment but some provides a grace period to cancel your order (and of course nothing is done before this period). Usually the grace time is few hours.
I do not think their are any legal requirement to accept cancellation after the order. Of course there are the possible return which has a legal period but I do not think it can be applied before receiving the products.

For such case there are the amendment module, I would put the quantity to zero for the missing product. And if it was already invoiced this should create a credit note.
Now how you manage this credit note is to decide. You could credit a deposit account for future sale, you can make a refund of the same amount on the existing payment (if the provider support it) etc.

I only mentioned the normal case because that is of course what we are aiming for. There is no grace time at all and the invoice must be created immediately - even before packing.

The simplest solution, after thinking out loud about it here, is to simply create the invoice and shipments only when everything is available and otherwise set the invoice method to “invoice on delivery” - no need to cancel many documents - so simple. :man_facepalming:
Simple Wizard to cancel the sale, cancel the shipment and generating a repayment.