Hi there,
Hope you are all doing well.
I have made an inventory app from a sample app. I have products with variables. Here is what I need to do:
- I have a table for receiving inventory. I want to enter the quantity of the parent product and all the variables of that products to have the same qty except for the variables with different units.
For example:
I have a product which has four variables: (Eggplant)
- Large, 1 Kg
- Med, 1 Kg
- Large, 500 g
- Med, 500 g
I want to add the quantity to the parent product, and the quantities of its variables to be computed automatically as follow: (For example when adding 100 to parent)
- Large, 1 Kg โฆ 100
- Med, 1 Kgโฆ 100
- Large, 500 gโฆ200
- Med, 500 gโฆ200
and when pull a quantity from the inventory for any variable to subtract from all quantities.
So, if I pulled a 50 of a variable is 1 Kg, the result would be as that:
- Large, 1 Kg โฆ 50
- Med, 1 Kgโฆ 50
- Large, 500 gโฆ100
- Med, 500 gโฆ100
And if I pulled a 50 of a variable is 500g, the result would be as that:
- Large, 1 Kg โฆ 75
- Med, 1 Kgโฆ 75
- Large, 500 gโฆ150
- Med, 500 gโฆ150