on 03-28-2011 2:25 PM
Este es el codigo que estoy usando y no funciona
If (@object_type = '13') and (@transaction_type = 'A')
Begin
declare @Cuenta as nvarchar(12)
Set @Cuenta = (Select isnull(T0.AcctCode,0) From INV1 T0 where T0.AcctCode = @list_of_cols_val_tab_del
and T0.isIns = 'Y')
If @Cuenta = '27059501'
Begin
Set @error = 1
Set @error_message = 'error de cuenta'
End
End
quedo atento a sus comentarios
saludos cordiales
VALM
IF (@object_type= '13') and (@transaction_type='U' or @transaction_type='A')
begin
declare @cuenta char(8)
declare @Cliente char(12)
declare @Reserva char (1)
set @Reserva = (select T0.isIns from OINV T0
where T0.Docentry = @list_of_cols_val_tab_del)
set @Cliente = (select T0.CardCode from OINV T0
where T0.Docentry = @list_of_cols_val_tab_del)
-
--declare @acctcodex varchar(20)
declare Detalle cursor for
select acctcode from INV1 a where a.DocEntry = @list_of_cols_val_tab_del
open Detalle
fetch next from Detalle into @cuenta
while @@fetch_status = 0
begin
if (@cuenta = '27059501') and (@Cliente = 'C9000174478') and (@Reserva = 'Y')
begin
SET @error = 1
SET @error_message = 'Fact. Reserv. Mayorista Favor Utilizar la sig. Cuenta de Mayor: 41359502 - Venta por Factura Reserva'
end
fetch next from Detalle into @cuenta --- > no falta nada aqui
end
-
Close Detalle
Deallocate Detalle
end
Por si alguien le sirve Asi recorremos todas las lineas y validamos
Gracias a San Simon de Lima XD por el ciclo
saludos cordiales
VALM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.