I'm stuck somewhere. I have a table for Inventory (which contains the available amount of each food component)
What I want to do: If I select a certain food (say salad) I want to be able to deduct the components (amount) of 'salad' from the inventory table.
Salad is made up of 20mil of water, 50 of oil and 100gm of onion (just an example)
When I give someone a Salad, I want to be able to deduct 20mil of water, 50 of oil and 100gm of onion from the inventory table. (So that I know how much of each item in my inventory is left)
The code is to allow these recipes of Salad to be changed/deleted/some others added into it. (Flexibility). I've found this difficult since in order to allow this flexibility, I can't just write that deduction in code as something that won't change forever.(More recipes can be added in the future)
Does anyone has an idea on how to do this?
I use MySQL with VB.NET