Hello, @cmtrl1995.
You can set up two separate QuickBooks company file for each company. Doing so, you'll have two separate books and you'll be able to track the income for each company separately.
Once you have two separate company files, you can add Company B as a customer in the first QuickBooks company file. Then, add the Company A as a customer in the second QuickBooks company file. You can check this article for more detailed steps: Add and edit multiple customers, vendors, and items.
Now, you can create a separate invoice or sales receipt for each company. Just make sure to include in the only the specific items that were sold.
Also, you can consult with an accountant so you'll be assisted in ensuring your books are accurate.
You can always swing by here if you have other questions. I'm always here to help you with tracking your income and expense transactions.