Data structure Inventory management FIFO

Hi, 

I'm building an app to do Inventory Management with the First In First Out method. 
I'm not sure of the data structure is best to use. Right now I have this structure :

Table Article ; Table Inventory In ; Table Inventory Out ; Table Current Inventory
(With date, Quantity, and Price)

The point is to get the right Price Value in the Table Inventory Out, using the First In First Out method.

For example: 

VictorB_1-1675758928066.png

Problem A) I'm looking for the blues cells
Problem B) In the case the row Quantity Out is using more than one row of the table Inventory In, I'm not sure what's best to do. 

 

My thoughts are :

Problem A) using a List of ID from the table Inventory In with a SORT() by date and then updating the list with value from the Table Inventory Out. 

Problem B) Made an action with a bot to create a new row in Table Inventory Out if the quantity Out is using many rows of the table Inventory In.

 

Am I on the right way ?
And do you have any proposals to realize my thoughts in AppSheet ?

Any suggestions and or references would be greatly appreciated. 

 

0 7 1,116
7 REPLIES 7