Why Can't I Pay a Customer?

Hi There,

In our client’s use case, they provide their customers with referral/introducers’ fee when a potential customer they referred made the purchase.

When we attempt to create a payment entry to a customer, we encounter the error :
“Cannot Pay to Customer without any negative outstanding invoice”

This is a very strange restriction and we do not find it logical. Why must a customer paid in advance in order to receive payment from us?

The same restriction does not apply to Employees.

Does anyone have similiar problem? Would like to hear if there are anyone have similiar experiences and how would you workaround this?

I have not looked into this part of ERPNext ever, so I am just guessing

when just take the logic of the error message “Cannot Pay to Customer without any negative outstanding invoice” I’d say you have to find a way to create such a ‘negative invoice’ through the referral they are making.

Also there is a term “Sales Partner”, so maybe you have to utilize this. By default there does not seem to be a way to link a “Sales Partner” directly to a Customer though, neither it seems selecting a sales partner on a given Sales Order (which mentions a Commission % the Sales Partner is getting) create a liability in any way.

My guess … the base components of such a scenario are laid out in ERPNext already, but do not do anything in the accounting yet. But I’d be more then happy to be proven wrong.

After some chat on Telegram, we figured that it is absolutely no sense that we can’t pay a Customer.

We decided to modify the Payment Entry core code and remove the restrictions ourselves.

After we removed the check, it becomes possible to pay a customer now.

That didn’t end well, for some reason Paying A Customer the payment entry hard coded the account head to be debtor only… instead of creditor.

Create an expense called “Customer Discount” and add it to your customer payment along with Cash and Credit Cards