Inventory "virtual items" (combination of multiple)

Inventory "virtual items" (combination of multiple)

To explain with a simple example:

I prepare and sell sandwiches.

I have inventory for: Bread, cheese and ham. I buy ingredients on large quantities and feed each inventory.

So I purchase (this is already possible to register as inventory)
  • 10 bags of bread
  • 500 grams of cheese
  • 500 grams of ham

But then I have no way to keep my inventories accurately as I sell, because I don't sell them in the same way I buy them.

I sell a " Sandwich" which has a price, and which is made up of (as I would setup on the system):
  • 0.2 bags of bread
  • 40 grams of cheese
  • 30 grams of ham

So, after the sale of 1 "Sandwich" my inventories would be like:
  • 9.8 bags of bread
  • 460 grams of cheese
  • 470 grams of ham

So the "virtual item" would be the Sandwich, which is built up of X quantities of multiple inventory items.

Is the idea clear? Doable?