sometimes my supplier is my customer, how do i invoice to my supplier
Add your Supplier as a Customer. Then create sales transactions against that new Customer.
Contra is something systems such as SAP do. Where in both customer and supplier is combined and you only pay or request payment for the balance of the 2 accounts combined.
It’s probably too early for Erpnext as the functionally isn’t one that’s too critical.
that’s of course not ideal in terms of accounting and being clear about financial situation between you and your supplier/customer (which are 2 logical separate entities when you set things up like that).
Odoo i.e. gives you the possibility to mark a contact as a Supplier AND as a customer (or only one of those 2 or none [maybe the same thing @iadr3805 has mentioned for the SAP world]) which I think is something to consider implementing into ERPNext as well. I think especially when you look at internet marketing and selling strategies (where everybody is a affiliate of everybody so the hard distinction between customer/supplier does exists less and less) being used by more and more companies (even ‘classic economy’ ones)
Another workaround could be to issue a credit note to your supplier for the things you sell to them. Not sure how other components of the system might be not working well with such (delivery note i.e.)