I need a way to know the value of my stock. Let $(x_1, \dots, x_n)$ be the quantity of the products $1$ to $n$ I have in stock, such that, for example, if I have $8$ units of the product $2$, $x_2 = 8$.
Let $j_{i,k}$ be the $k$ prices at which the product $i$ can possibly be bought. Let $m_i$ be a movement of the stock quantity of product $i$. It's worth mentionning that $m_i$ can be both positive and negative.
The question is : how can I know the value $v_i$ of the stock of each product $i$ in order to be able to eventually know the total value of the stock $V$ given the fact that I don't know at which price the $x_i$s were bought.
The big constraint here is that there is no way to track the products individually : once they are bought, they are put with the rest of the stock thus loosing the cost information.
Do you have any idea on how to approach that ? I don't even know how to tag this question.
Thank you