Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8372

Re: Unit Price Validation

$
0
0

Hi,

 

Try:

 

 

 

IF (@object_type = N'13' AND @transaction_type in (N'A', N'U') )

BEGIN

    IF EXISTS(select a.DocEntry from INV1 a

where (a.PriceBefDi >= (SELECT q.[Price] FROM ITM1 q WHERE q.[PriceList] = 2 and q.ItemCode = a.ItemCode )

    OR a.PriceBefDi <= (SELECT s.[Price] FROM ITM1 s WHERE s.[PriceList] = 1 and s.ItemCode = a.ItemCode))

    and a.DocEntry = @list_of_cols_val_tab_del)

    Begin

    Set @error =1

    set @error_message = 'Please check the price! Item is going either under cost or over cost....'

    End

END

 

Thanks,

Gordon


Viewing all articles
Browse latest Browse all 8372

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>