I need to make a sale and inventory management system. I'm stuck on the purchasing price and stock for the product.
Let's say you bought 10 t-shirt for $10 per t-shirt and selling them at $20 per t-shirt.
You sold 8 t-shirt quickly and decided to buy 10 more. Now, the price is $12 per t-shirt.
Now , you've total 12 t-shirt in stock, where 2 t-shirts purchasing price is $10 and 10 t-shirts purchasing price is $12.
How can I make a product table which will keep track of the purchasing price at different times for the product and also the total stock ?