src-db/database/model/functions/M_INOUT_POST.xml
changeset 20944 3348ce170fc7
parent 20053 d6a7bf46c54f
child 20951 e7d4140659d1
--- a/src-db/database/model/functions/M_INOUT_POST.xml	Tue Jun 25 13:08:10 2013 +0200
+++ b/src-db/database/model/functions/M_INOUT_POST.xml	Tue Jun 25 18:20:57 2013 +0200
@@ -262,6 +262,15 @@
         RAISE_APPLICATION_ERROR(-20000, '@ReturnInOutNegativeQty@');
       END IF;
     END IF;
+      SELECT count(*), max(p.name)
+        INTO v_count, v_productname
+      FROM m_inoutline il JOIN m_product p ON il.m_product_id = p.m_product_id
+      WHERE il.m_inout_id = v_record_id
+        AND COALESCE(p.isgeneric, 'N') = 'Y';
+      IF (v_count > 0) THEN
+        RAISE_APPLICATION_ERROR(-20000, '@CannotUseGenericProduct@ ' || v_productName);
+      END IF;
+      
         -- Process Shipments
       SELECT COUNT(*) INTO v_Aux
       FROM M_InOutLine