Hi I have an inventory information like this:
1. Stock in table: will have Stock In date - Model - Product ID
- where the product ID is unique to each product under the same SKU
2. Stock out table: will have Sales date - Model - Number of product sold, so let’s say on day 1 I can sold 5 units of product A
It’s a first in first out problem, I want to assign the sales out date to each of my Product ID. For example, if in day 1, I have stocked in 5 items = 5 ID of model A, and O’ve sold 3 model A items, then 3/5 Product ID of model A will be assigned the sales date as day 1. If next day I only sell 1 product then the 4th item stocked in day 1 will have sales date of day 2
If I sell no item then no Product ID get assigned any sales date
please help me thank you so much