Hi, I’m having a problem getting an app ready. I have an inventory, in which each piece keeps a record of its stock, the problem is that those pieces are not sold separately but by packs, and adding more problem each pack requires a different amount of pieces. So, how can I make sure that according to the pack that the user chooses they see the corresponding quantities and that if the sale is confirmed, that those same quantities are subtracted from the stock?
Sounds like you just need to have a table that maps the type of pack to the number of pieces in that pack.
Then in the destination table, create a relation using the pack ID to retrieve the number of pieces with a lookup.
Finally, use a rollup to sum the total of pieces, and subtract them from your original inventory.
2 Likes