Internal use of stock as expense for another busines

I have company 1: use erpnext POS to sell items to customers
I have company 2: Sometimes buys items (like a customer) from company 1 and use those items as expenses for running the business

Is there a way to automated this in erpnext, and if yes how?

*I used to do it manually as company 2 buys from company one and pays in cash and then enter as an expense…

I see there is a check mark as “is internal use”, what does that mean and how and will it affect the acc ledger?*