Hi Expert,
I need your help for this request,
I try to block adding a Service type Good receipt PO if the total Line is greater than the Open Amount for this line in the Purchase Order. I can make it work with the Quantity in the Item type but that doesn't work for the value in the Service type.
Here it's my code in my SP_TransactionNotification:
===========================================================================================================
IFEXISTS(SELECT a.BaseEntry FROM PDN1 a, POR1 b WHERE a.DocEntry=@list_of_cols_val_tab_del
AND a.BaseEntry=b.DocEntry AND a.BaseLine=b.LineNum
AND(a.linetotal >=b.OpenSum))
BEGIN
SET @error_message='Cannot be greater than Open Amount'
RETURN (1)
END
=============================================================================================================
Last thing if more than 1 GRPO is created base on the same PO we need to be sure the total of each line of all the GRPO are not exceeding the PO value.
Hope I'm clear enough.
Thanks
Eric