on 01-16-2015 2:55 PM
Buenos días en el momento de crear un pedido cliente necesito que me salga una alerta informando que falta en indicador de impuesto en las linea del pedido realice el siguiente SP pero no me esta funcionando gracias por su colaboración
if @object_type in ('17') and @transaction_type in ('A', 'U')
begin
if (select count(*)
FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
WHERE (ISNULL(T1.[TaxCode],'') = '')
AND @list_of_cols_val_tab_del = T0.DocEntry
--and (T1.TaxCode>0)
And (T1.TaxCode like 'I%'))>0
begin
set @error = 10
set @error_message = '** SP ** Hace falta IMPUESTO'
end
end
A VER QUE TE PARECE ESTE
VALIDACION PARA QUE NO SE PUEDAN CREAR PEDIDOS SIN IMPUESTOS -----------------------------------------------------------------
if @object_type='17' and
(case when 'N' in (select case when isnull(t1.TaxCode,'N')='' then 'N' else isnull(t1.TaxCode,'N')end from RDR1 t1 where DocEntry=@list_of_cols_val_tab_del)then 'N' else 'Y' end) ='N'
begin
SELECT @error = - 9003
SELECT @error_message = N'Existen filas sin impuestos'
end
SALU 2
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Este funciona perfecto y sigue tu lógica de programación. Suerte.
IF @object_type = '17' AND @transaction_type in ('A', 'U')
BEGIN
IF (select count(T0.DocNum) FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.DocEntry = @list_of_cols_val_tab_del AND IsNull(T1.[TaxCode],'') = '') > 0
BEGIN
set @error = 9
set @error_message = '** SP ** Hace falta IMPUESTO'
END
END
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.