on 08-15-2011 9:17 PM
Buenas tardes a Todos
Estoy haciendo un transaction para restrigir unos cambios tanto en las salida de mercancia como en la entrada de mercancias del modulo de inventario.
Estoy usando los @object_type = '60' y @object_type = '59' Respectivamente, El transaction funciona pero me esta haciendo la validacion tambien en el Recibo de Produccion y en la de Articulos para Produccion, al parecer es porque las tablas son las mismas pero quisiera saber si hay alguna forma para restringirlo solo a las transacciones que yo necesito a la salida y a la entrada de mercancia.
Este es el codigo que estoy utilizando.
If @object_type = '60' AND @transaction_type IN ('A','U')
Begin
Set @DocEntry = @list_of_cols_val_tab_del
IF (SELECT COUNT(*)
FROM OIGE T0 INNER JOIN IGE1 T1 ON T0.DocEntry = T1.DocEntry
WHERE T0.[GroupNum] <>-2 AND T0.DocEntry = @DocEntry )>0
begin
Set @error = 1
Set @error_message = 'LA LISTA DE PRECIOS DEBE SER ULTIMO PRECIO DETERMINADO'
end
Espero de su ayuda de antemano muchas Gracias.
Ok Compañeros muy amable de su parte
hare las pruebas y les comento como me fue.
Muchas gracias a Todos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola, intenta con el campo DocSubType de la cabecera que sea igual a '--'
A ver si asi te filtra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Es cierto lo que dice Mary, prueba con tu codigo asi
If @object_type = '60' AND @transaction_type IN ('A','U')
Begin
Set @DocEntry = @list_of_cols_val_tab_del
IF (SELECT COUNT(*)
FROM OIGE T0 INNER JOIN IGE1 T1 ON T0.DocEntry = T1.DocEntry
WHERE T0.GroupNum -2 AND and T1.BaseType !='202' and T0.DocEntry = @DocEntry )>0
begin
Set @error = 1
Set @error_message = 'LA LISTA DE PRECIOS DEBE SER ULTIMO PRECIO DETERMINADO'
end
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.