Skip to Content

Validate price in sales order

Oct 09, 2017 at 06:03 AM


avatar image

Hi, i need to validate price in sales order with price list and special prices

this is my code:
IF @object_type = '17' and @transaction_type IN ('A','U') BEGIN Set @DocEntry = @list_of_cols_val_tab_del IF (SELECT COUNT(ItemCode) FROM RDR1 WHERE RDR1.DocEntry=@DocEntry AND left(ItemCode,3) LIKE 'KIT') = 0 BEGIN IF EXISTS (SELECT T1.[ItemCode] FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry=T1.DocEntry INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode INNER JOIN OPLN T3 ON T3.ListNum = T2.ListNum INNER JOIN ITM1 T4 ON T4.ItemCode = T1.ItemCode WHERE T0.docentry = @DocEntry AND (T1.[price] <> T4.Price) and T2.ListNum = t4.PriceList BEGIN SET @error = 1 SET @error_message = 'EXISTE DIFERENCIA DE PRECIO EN LOS ARTICULOS Y LA LP' END END END

Only validate the price list but in some cases, some items have special prices and don´t work

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers