on 11-05-2013 6:11 PM
Tengan todos un buen dia,solicito soporte por favor para crear la siguiente restricción a nivel de transaction notification y es la siguiente:
Que al hacer una entrada de mercancías por compra, si la cantidad que se está ingresando es mayor a 10% de la orden, no deje grabar.
Ejemplo:
PIDO EN UNA ORDEN 100 UNIDADES DE ENVASE DE VIDRIO
LA FACTURA VIENE POR 110. ENTONCES SI PUEDO HACER EL INGRESO.
LA FACTURA VIENE POR 111. ENTONCES NO PUEDO HACER EL INGRESO.
Gracias de antemano por su apoyo a resolver este requerimiento, que agradecere grandemente
Hola Armando, puedes intentar así:
IF @object_type = '20' AND @transaction_type IN ('A','U')
Begin
Declare @suma_OC numeric (10)
Declare @suma_EM numeric (10)
Declare @baseentry int
Declare @porcentaje decimal (10,4)
Set @baseentry= (Select Distinct baseentry from PDN1 where DocEntry=@list_of_cols_val_tab_del)
Set @suma_OC = (Select Distinct SUM(Quantity) From POR1 Where DocEntry=@baseentry)
Set @suma_EM = (Select Distinct SUM(Quantity) From PDN1 Where DocEntry =@list_of_cols_val_tab_del)
Set @porcentaje ='.10'
IF @suma_EM>(@suma_OC*@porcentaje+@suma_OC)
BEGIN
Set @error = -00025
Set @error_message = 'Cantidad Supera al 10% de la Orden'
END
END
Saludos.
Alessandro.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gracias Alessandro por la gentileza que te tomaste por responder, fijate que lo puse en TN y no me funciono no hace nada
Tal vez no me explique bien, tengo que bloquear una entrada de compras que viene de un pedido por ejemplo si alguien quiere modificar la cantidad que viene del pedido digamos 100 items el usuario puede modificar hasta 110 pero 111 que no deje grabar ojala que me pudieras ayudar , y nuevamente gracias, te adjunto una imagen ilustradora jeje solo es permitido modificar un 0.1
Una pregunta, solo por no dejar; y si la factura la hacen directa es decir, sin basarse en O.c.'s ? , no te hacen entregas parciales tampoco?
Saludos !
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.