on 05-23-2009 2:49 AM
Hola a todos
Alguien me pudiera ayudar con lo siguiente:
En la empresa generan el Pedido del Cliente en Dólares, pero en ocasiones el personal de almacén en el Documento de Entrega Cambia a Pesos y lo mismo pasa en la Factura
¿Cómo puedo Generar bloquer el campo de Moneda del documento destino y que se respete siempre el del documento origen?
En caso que no se pueda bloquer el campo ¿cómo puedo generar una alerta o una autorización?
Gracias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
puedes generar un modelo de autorizacion basada en una query.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
checate este ejemplo. lo hice poniendo solo que los superusuarios si puedan modificar. saludos.
USE [pruebas]
GO
/****** Object: StoredProcedure [dbo].[SBO_SP_TransactionNotification] Script Date: 05/25/2009 16:08:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[SBO_SP_TransactionNotification]
@object_type nvarchar(20), -- SBO Object Type
@transaction_type nchar(1), -- [A]dd, <u>pdate, [D]elete, [C]ancel, C[L]ose
@num_of_cols_in_key int,
@list_of_key_cols_tab_del nvarchar(255),
@list_of_cols_val_tab_del nvarchar(255)
AS
begin
-- Return values
declare @error int -- Result (0 for no error)
declare @error_message nvarchar (200) -- Error string to be displayed
select @error = 0
select @error_message = N'Ok'
--------------------------------------------------------------------------------------------------------------------------------
--ADD YOUR CODE HERE
IF @transaction_type in ('U') AND @object_type = '17'
BEGIN
if exists (Select Docnum from [dbo].[Ordr] T0
where (t0.groupnum<>'2' and t0.groupnum<>'-1' and t0.groupnum<>'9')
and T0.docEntry=@list_of_cols_val_tab_del
and (select t1.superuser
from ousr t1
where t1.internal_k=t0.usersign)='n')
begin
SELECT @error = 1, @error_message = 'No puedes modificar esta orden Ocupas autorizacion!'
end
END
--------------------------------------------------------------------------------------------------------------------------------
-- Select the return values
select @error, @error_message
end
esto dentro del sbo_sp_transactionnotification..,
checate por que a mi me costo un poco llegar a esto pero en el foro en ingles hay muchos ejemplos mejores. saludos.
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.