on 03-25-2010 10:32 PM
Experts,
I have a client who sells commodities. They need their Pricelists to be updated with each Purchase, because of fluctuating Prices.
If I can get the following Formatted Search to work, I believe that Iu2019ll have a solution:
I created a UDF on the Item Master Inventory tab rows, which I called OITW.U_Test
I need to populate this UDF with the following calculation: (OITW.OnHand * OITW.AvgPrice) + (T1.OnOrder * (Sum of all the quantities on open POu2019s)) / (OITW.OnHand + T1.OnOrder)
Here is the logic behind it: This UDF must show a modified Moving Average. Because POu2019s does not update the AvgPrice (only the Goods Receipt PO) this is cause for concern for this client who might have Sales Orders for Items that is not in stock yet, and posted as a lower AvgPrice.
Here is what I have done so far:
Select T0.ItemCode, T1.OnHand, T1.AvgPrice, T1.OnOrder,
T1.OnHand*T1.AvgPrice as 'InStock Value',
T1.OnOrder* ?????? as 'PO Value'
From OITM T0 INNER JOIN OITW T1 ON T0.ItemCode = T1.ItemCode
INNER JOIN POR1 T2 ON T0.ItemCode = T2.ItemCode
Any help will be appreciated.
Marli
Marli,
I doubt your idea could work properly. First of all, how will your update this UDF?
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gordon,
I tested this and you are right, to use a FS will not work because of the refresh issue.
I'm now working on a Stored Procedure that will update this UDF when a PO is Added or Updated. My experience with Stored Procedures is limited to True or False statements. (If this is true, do not add the Document, if it is false add the document)
My question is: Can I populate the UDF, with a Value according to my query, with a Stored Procedure?
Thanks for your help.
Marli
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.