I had an issue where I wanted to make a payment to customer and or receive a payment from supplier. Because there are cases where a customer is also our supplier (we are a trading company).
What we missed is, we cannot make sales invoice to supplier because we cannot sell him anything. And we cannot make purchase invoice to the customer because in the purchase invoice we cannot see the customer, just supplier.
So there is no use of making a payment to our customer (temporary our supplier) if we cannot relate an invoice to him.
This cannot be done out of the box in ERPNext. What you can do is to create a custom field in both supplier and customer doctypes to commonly identify them. This will help you in generating reports and thats about it. Or you can create another doctype and map the supplier and customer documents to it. This is what the MDM folks were doing to identify and map a unique customer across their sales channels.
How about we add a customer named as “ABCXYZ” as a customer and as a supplier. But on the back-end a script which will join the two ledgers or the customer/supplier with the same name. Because we do not want to maintain two different ledgers.