on 06-23-2014 3:21 PM
Buenos Dias:
Solicito su ayuda, ya que deseo restringir a ciertos socios de negocios en que se le pueda realizar una oferta de venta si en caso una de sus propiedades (29 en este caso) este activo.
if @object_type = '23' and (@TRANSACTION_TYPE = 'A' or @TRANSACTION_TYPE = 'U')
begin
If exists(select t0.CardCode from OQUT T0 INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode
where t0.CardCode =@list_of_cols_val_tab_del and t1.QryGroup29 ='Y')
begin
select @error = 1, @error_message = 'CLIENTE RESTRINGIDO POR LABORATORIO'
end
end
Espero me puedan ayudar.
Gracias
Hola Luis,
En el ejemplo que planteas (if @object_type = '23'....) , el contenido de la variable @list_of_cols_val_tab_del almacena el Docentry de la Oferta , no el código del socio de negocio.
Prueba con:
select t0.CardCode from OQUT T0 INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode
where t0.docentry =@list_of_cols_val_tab_del and t1.QryGroup29 ='Y
Un saludo, Borja.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Estimado Luis Retuerto, yo tengo un caso similar al tuyo... pues necesito hacer bloqueo (proced.de autorizad.) a un cliente en especial para que cuando alguien ingrese una orden de venta, solo el usuario autorizado pueda autorizar las ordenes de venta que puedan estar subiendo a este cliente... te pido de favor si me compartes tu transaction notification para ver si me podría ayudar con lo que necesito o si alguien tiene ya el procedimiento de autorización con este caso en particular, mucho les agradecer me compartan su información.
Muchas Gracias por su atención, que tengan buen día... Saludos.
Con este query me salio de maravilla.
if @object_type = '23' and (@TRANSACTION_TYPE = 'A' or @TRANSACTION_TYPE = 'U')
begin
declare @Labo as varchar(100)
SELECT @Labo= COALESCE(@Labo + ', ', '') + t4.U_Dicar_Labo from OQUT T0 INNER JOIN
QUT1 T1 on t0.DocEntry = T1.DocEntry INNER JOIN
OCRD T2 ON T0.CardCode = T2.CardCode INNER JOIN
OITM T4 ON T1.ItemCode = T4.ItemCode
where
t0.docentry = @list_of_cols_val_tab_del
and (t2.QryGroup29 ='Y')
AND T4.U_Dicar_Labo ='ROEMMERS'
IF @Labo is not null
begin
SET @error = 1
SET @error_message = N'CLIENTE RESTRINGIDO EN LABORATORIO' + ' ' + @Labo
end
end
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
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.