Hello community, I am creating a budget app. I already have a table with loaded items, each item has a cost that turns out to be the sum of the prices of the inputs that compose it multiplied by the quantity in which it intervenes.
Suppose:
For a pizza I need
1Kg of flour
0.3Kg of Cheese
0.5kg of water
I can know the price of pizza with the price and quantities of the inputs involved.
But it turns out that a customer orders 7 pizzas. What I would like is to obtain a reverse list of these inputs.
For example, if I tell the app that I want 7 pizzas and then the app tells me:
You need 7Kg of flour, 2.1Kg of cheese and 3.5Kg of water.
Does anyone have a sample app? Or at least someone knows how to do that. I know it can be quite complicated.
I'm working on the solution, if I find something before I'll share it.
Greetings. Good afternoon
Its hard to guess at what you are asking without seeing the tables and rows. However I would assume you could do some math equations? As in if the user selects a pizza it takes the information of the pizza for example the cheese and flour and the cost is for example $2 for cheese then you would have a column that would take the quantity for your example 3 pizzas and multiply the $2 x3.
Best guess without being able to see any information
Ok Jose! I'll send you tables later so you can help me better! Greetings, have a good day!
User | Count |
---|---|
35 | |
31 | |
30 | |
19 | |
18 |