One of my customers reported that when they transfer the Purchase Requisition to Purchase Order, the cost they specified in the requisition for their items is not being transferred to the purchase order.
Checking the Requisition setup I didn’t find an option to keep the cost of requisition on Purchase Order, only the below options are available:
For this particular customer, they are not using the “last vendor originating cost”, so I have created a Trigger that updates the field for each update occurs on requisition screen, below the trigger code if anybody is interested.
CREATE TRIGGER [dbo].[DI_UPDATEITEMCOST]
ON [dbo].[POP10210]
AFTER INSERT, UPDATE
AS
DECLARE @ITEMNMBR VARCHAR(500)
DECLARE @UNITCOST numeric(18,5)
DECLARE CUR CURSOR FOR SELECT ITEMNMBR, UNITCOST FROM INSERTED
OPEN CUR
FETCH NEXT FROM CUR INTO @ITEMNMBR, @UNITCOST
WHILE @@FETCH_STATUS = 0
BEGIN
UPDATE IV00103 SET Last_Originating_Cost = @UNITCOST WHERE ITEMNMBR = @ITEMNMBR AND @UNITCOST <> 0
FETCH NEXT FROM CUR INTO @ITEMNMBR, @UNITCOST
END
CLOSE CUR
DEALLOCATE CUR
GO
Regards,
--
Mohammad R. Daoud MVP - MCT
MCP, MCBMSP, MCTS, MCBMSS
+962 - 79 - 999 65 85
me@mohdaoud.com
http://www.di.jo
No comments:
Post a Comment