on 2018 May 04 2:53 PM
Hello Everyone
I have a stored Procedure (code below) which helps in blocking the invoice if the unit price is not fulfilled.But there are some Template BOMs (Table OITT) in the system which needs to be exempt from this rule.I am not able to add exception here to this code.
Can someone please help me in getting it done.
IF (@object_type = N'13' AND @transaction_type in (N'A', N'U') )
BEGIN
IF EXISTS (SELECT T1.DocEntry FROM OINV T0 inner join INV1 T1 on T0.DocEntry = T1.DocEntry INNER JOIN
WHERE (T1.PriceBefDi IS NULL OR T1.PriceBefDi = 0 and ) AND T0.DocEntry = @list_of_cols_val_tab_del)
BEGIN
Set @error =1
set @error_message = 'Unit Price cannot be blank'
END
END
Thanks & Best Regards
Anushka
Hi,
Try this in test DB first,
IF (@object_type = N'13' AND @transaction_type in (N'A', N'U') )
BEGIN IF EXISTS
(SELECT T0.DocEntry FROM OINV T0 inner join INV1 T1 on T0.DocEntry = T1.DocEntry WHERE T1.[TreeType] <> 'T' AND (T1.PriceBefDi IS NULL OR T1.PriceBefDi = 0 ) AND T0.DocEntry = @list_of_cols_val_tab_del)
BEGIN
Set @error =1
set @error_message = 'Unit Price cannot be blank'
END
END
Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
6 | |
6 | |
6 | |
5 | |
5 | |
3 | |
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.