Commit e652fdb7 authored by Atul Gaware's avatar Atul Gaware
Browse files

Fixes BUG-0045477: Attribute required check in M_TRANSACTION_TRG

trigger should allow when stock is zero

**"There are some products without attributes" Exception is only
raised when the stock is Positive or the transaction is a Receipt.
parent 6003c40d
......@@ -18,7 +18,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SLU
* All portions are Copyright (C) 2001-2018 Openbravo SLU
* All portions are Copyright (C) 2001-2020 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************/
......@@ -103,11 +103,11 @@ BEGIN
JOIN m_inoutline iol ON (iol.m_inout_id = io.m_inout_id)
WHERE iol.m_inoutline_id = :NEW.m_inoutline_id;
IF (v_issotrx = 'N' OR v_qtyOnHand >= 0) THEN
IF (v_issotrx = 'N' OR v_qtyOnHand > 0) THEN
RAISE_APPLICATION_ERROR(-20000, '@20112@' || ' - ' || v_Name) ;
END IF;
ELSE
IF ( v_qtyOnHand >= 0) THEN
IF ( v_qtyOnHand > 0) THEN
RAISE_APPLICATION_ERROR(-20000, '@20112@' || ' - ' || v_Name) ;
END IF;
END IF;
......@@ -178,11 +178,11 @@ BEGIN
JOIN m_inoutline iol ON (iol.m_inout_id = io.m_inout_id)
WHERE iol.m_inoutline_id = :NEW.m_inoutline_id;
IF (v_issotrx = 'N' OR v_qtyOnHand >= 0) THEN
IF (v_issotrx = 'N' OR v_qtyOnHand > 0) THEN
RAISE_APPLICATION_ERROR(-20000, '@20112@' || ' - ' || v_Name) ;
END IF;
ELSE
IF ( v_qtyOnHand >= 0) THEN
IF ( v_qtyOnHand > 0) THEN
RAISE_APPLICATION_ERROR(-20000, '@20112@' || ' - ' || v_Name) ;
END IF;
END IF;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment