Forum Discussion

geemian93's avatar
geemian93
Frequent Visitor
3 years ago

Calculation of age Days based on FIFO Inventory method

Dear Experts, amitchandak  Greg_Deckler 

I am looking for the help to calculate aging days based on the FIFO method of inventory from the two tables (Both tables have relationship based on Material No.),

 

First Table (Stock) include the closing stock of a particular item:

DateMaterial No.Quantity PC
30-Apr-23    10001    72,000.00

 

Second Table (PurchaseTable) contains the purchase history of this item:

Material No.Date of Purchase Quantity PC 
1000131-Mar-14       25,000.00
1000115-May-15       22,000.00
1000123-Sep-18       15,000.00
1000103-Oct-20       15,000.00
1000108-Jun-22       11,000.00
1000130-Sep-22         9,000.00
1000131-Mar-23         8,000.00
1000115-Apr-23       13,000.00

 

I wanted to apply the logic that only calculate age days from today date (11-May-23)
minus the last purchase quantity from the closing quantity (i.e. 72,000 - 13,000 pc) and so on untill the closing stock is completely consumed then leave the rest of the purchase histroy age days to zero.

 

Desired Results should be like this:

Material No.Date of Purchase Quantity PC Age in DaysStock Balance
1000131-Mar-14       25,000.00       0       (46,000.00)
1000115-May-15       22,000.00       0       (21,000.00)
1000123-Sep-18       15,000.00     1691           1,000.00
1000103-Oct-20       15,000.00     950         16,000.00
1000108-Jun-22       11,000.00     337         31,000.00
1000130-Sep-22         9,000.00     223         42,000.00
1000131-Mar-23         8,000.00      41         51,000.00
1000115-Apr-23       13,000.00      26         59,000.00

3 Replies

    • geemian93's avatar
      geemian93
      Frequent Visitor

      Greg_Deckler  Thanks for your response.

       

      I had a look into the proposed article, however it accumulates the item quantity with earliest possible delivery date.

      The problem that I am facing is actually simpler since I just wanted to assign age (in days from current or specific date) deducting the most recent purchased quantity from the closing quantity of particular item until the closing quantity reaches "Zero" then leave rest of the purchase history line items age days to "0".

       

      Apprecite if you can spare some time to look into this.

       

      Regards

      Waseem