on 05-23-2013 9:29 PM
Hola
a Todos soy nueva en esto....
Necesito crear un Transaction Notification que restrinja la creación de un pago cuando sea solamente a cuenta y solo cuando la cuentas seleccionadas sean de gastos tipo 6 o de Financiacion cajon 7 y en este caso no se podra crear el pago si no han colocado información en los campos udf U_RCUPAGO y U_DVPA.
Hola Samara, Intenta este:
if @Object_type = '46' and (@transaction_type = 'A' ) -- Pagos Efectuados
begin
Declare @doctype as nvarchar
Declare @tucuenta as nvarchar
Declare @tucampo1 as nvarchar
Declare @tucampo2 as nvarchar
set @doctype = (Select T0.DocType from ovpm T0 where T0.Docentry = @list_of_cols_val_tab_del)
Set @tucuenta = (Select T1.AcctCode from Ovpm T0 inner JOIN VPM4 T1 ON T0.DocEntry = T1.DocNum where T0.DocEntry = @list_of_cols_val_tab_del)
Set @tucampo1 = (Select T0.U_RCUPAGO From Ovpm T0 where T0.DocEntry = @list_of_cols_val_tab_del)
Set @tucampo2 = (Select T0.U_DVPA from Ovpm T0 where T0.DocEntry = @list_of_cols_val_tab_del)
if (@tucuenta Like '6%' OR @tucuenta Like '7%' ) and (@tucampo1 IS null OR @tucampo2 is null)
begin
Set @error = 1
Set @error_message = 'Ingresa informacion en el campo XXX'
end
end
Saludos.
Alessandro.
Message was edited by: Alessandro Lopez Santinelli
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gracias Alessandro..
Excelente me funciono, yo estuve probando otro que realice pero veo la encencial en el notification al realizar la consulta siempre se debe hacer referencia al documento....veo que no estaba tan perdida...
if
(@object_type = '46') and (@transaction_type = 'A') --PAGOS AL MOMENTO DE AFECTAR CUENTAS
begin
declare
@campousuario as nvarchar
declare
@cuenta as nvarchar
set
@campousuario = (select isnull(T0.U_RUCPAGO,0) from OVPM T0 where T0.DocEntry = @list_of_cols_val_tab_del)
set
@cuenta = (select a.AcctCode from rct4 a where a.DocNum = @list_of_cols_val_tab_del and a.AcctCode like '%6' or a.AcctCode like '%7' )
IF
(@campousuario = '0' and @cuenta like '%6' or @cuenta like '%7')
begin
select
@error = 1
set
@error_message = 'debe registrar el ruc'
end
end
User | Count |
---|---|
99 | |
9 | |
8 | |
5 | |
4 | |
3 | |
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.