Skip to Content

Precio de venta >= Precio de lista

Buen día para todos.

Por favor me podrían colaborar con un Query, el cual valide donde el precio de venta sea mayor al precio de lista,

Mil gracias!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Nov 11, 2015 at 03:47 PM

    Es un bloqueo o un informe lo que estás solicitando?

    Atte.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hola Felipe, el precio de venta esta en el dato maestro del item

      En cuanto al bloqueo de la columna Precio, en este momento lo tengo así, pero pasa lo siguiente, tengo una SP donde me aplica una regla para el campo descuento que no sea mayor al 20%.

      Entonces cuando el valor total es menor al 20% el porcentaje de descuento sale como negativo.

      Ej. Aplicando descuento

      Ej. Aplicando Total (ML)


      Esta es mi Query de Porcentaje:


      IF @OBJECT_TYPE IN ('13') AND @TRANSACTION_TYPE IN ('A', 'U') /*Factura*/

      BEGIN

      DECLARE @TIPOF CHAR(1);

      SET @TIPOF = (SELECT DISTINCT A.DocType FROM OINV AS A INNER JOIN INV1 AS B ON A.DocEntry = B.DocEntry WHERE @list_of_cols_val_tab_del = A.DocEntry );

      DECLARE @TOTALF DECIMAL(19,6);

      DECLARE @TOTALBF DECIMAL(19,6);

      DECLARE @DESCF DECIMAL(19,6);

      IF @TIPOF='I' BEGIN

      SET @TOTALBF=(SELECT SUM(B.PriceBefDi*B.Quantity) FROM OINV AS A INNER JOIN INV1 AS B ON A.DocEntry = B.DocEntry WHERE @list_of_cols_val_tab_del = A.DocEntry) ;SET @TOTALF=(SELECT SUM(B.LineTotal) FROM OINV AS A INNER JOIN INV1 AS B ON A.DocEntry = B.DocEntry WHERE @list_of_cols_val_tab_del = A.DocEntry)

      END

      ELSE

      BEGIN

      SET @TOTALBF=(SELECT SUM(B.LineTotal) FROM OINV AS A INNER JOIN INV1 AS B ON A.DocEntry = B.DocEntry WHERE @list_of_cols_val_tab_del = A.DocEntry) ;SET @TOTALF=(SELECT SUM(B.LineTotal) FROM OINV AS A INNER JOIN INV1 AS B ON A.DocEntry = B.DocEntry WHERE @list_of_cols_val_tab_del = A.DocEntry)

      END

      SET @DESC1 = (1-(@TOTALF/@TOTALBF))*100;

      IF @DESC1 > 10 AND (SELECT COUNT(*) FROM OINV T0 WHERE @list_of_cols_val_tab_del = T0.DocEntry AND T0.U_HBTI_Autoriza1='NO')>0

      BEGIN

      SET @error= 20

      SET @error_message = '** La Factura tiene un descuento mayor al 20%, debe autorizarse'

      END

      END

      Saludos,

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.