How to refund a customer after generating a credit memo

I think I am missing something very basic. But we invoiced a customer and they paid via credit card. We generated a payment entry and reconciled it with the invoice.

Now the customer has returned the goods and we issued a credit card refund to them.

I have generated a credit memo from the original sales invoice and returned the product to stock.

I do not want to apply the credit memo to a future sale to this customer. Instead I want to simply refund the money to them.

I’m not finding a simple way in ERPNext to accomplish this.

If I try to generate a payment entry to pay the customer the negative balance in their account I receive the error: “Cannot Pay to Customer without any negative outstanding invoice”

Isn’t the credit memo a negative outstanding invoice?

Am I missing something or is the concept of refunding a customer for a returned purchase missing from ERPNext?

What I’m looking for is a concise explanation of how to achieve my desired result of having the customers account set to 0 balance, my bank account balance correct, the customer not showing up on the AR report, the credit note shouldn’t show up as open on any future invoices for this customer, and the invoice/credit notes should be reconciled with their respective payment and refunds.

And please don’t point me towards any documentation, I’ve read it all and nothing answers my question. Please list actual steps to take. Thank you.

We have our use case where we receive advances via payment entry and sometime have to return the advances partially.

We pass a journal entry and then do reconciliation of payment entry against the journal entry.

I’m having a hard time understanding what the journal entry parties are? I don’t have a payment entry to reconcile against because the system won’t allow me to make a journal entry to pay the customer because they don’t have an outstanding negative invoice.

What am I missing.
I am not an accountant or a bookkeeper I am a programmer so I need specifics laid out, not just broad strokes please.

What I’m looking for is a step by step explanation of how handle the simplest case. Let’s say a customer who’s never purchased from us before and will never purchase again, buys 1 product for 1 dollar.
They pay for the product.

They then decide to return the product. What entries can I make into ERPNext to return the 1 product to inventory and reverse the sales and customer entries, and record the refund of 1 dollar from my bank account to the customer?

My preference would be for the system to have my original sales invoice connected to the original payment entry reflecting the 1 dollar sale, and also connected to the credit memo and a payment entry reflecting the 1 dollar refund.

If that preference is not possible I am also happy to handle this with journal entries or whatever.

Also I think the credit memo should be able to be reconciled with the refund payment similarly to how a sales invoice is reconciled with a payment entry, but perhaps I’m not understanding something.

Please advise

Sorry I figured out what I was missing. I needed to generate my reversing payment entry for the refund from the original sales invoice. I don’t think the documentation is clear about that at all. Perhaps if I can find some time I’ll submit a PR on the documentation to clarify this process.