src-db/database/model/functions/M_RESERVATION_POST.xml
changeset 20940 3348ce170fc7
parent 19376 5c5796eee69b
child 20942 73deee3c38d5
--- a/src-db/database/model/functions/M_RESERVATION_POST.xml	Tue Jun 25 13:08:10 2013 +0200
+++ b/src-db/database/model/functions/M_RESERVATION_POST.xml	Tue Jun 25 18:20:57 2013 +0200
@@ -46,6 +46,7 @@
   v_count           NUMBER;
   v_quantity        NUMBER;
   v_reservedqty     NUMBER;
+  v_productname     m_product.name%TYPE;
 
 TYPE RECORD IS REF CURSOR;
   Cur_Parameter RECORD;
@@ -86,6 +87,14 @@
   FROM m_reservation
   WHERE m_reservation_id = v_reservation_id;
   
+  SELECT count(*), max(p.name) INTO v_count, v_productname
+  FROM m_product p 
+  WHERE p.m_product_id = v_product_id
+    AND COALESCE(p.isgeneric, 'N') = 'Y';
+  IF (v_count > 0) THEN
+    RAISE_APPLICATION_ERROR(-20000, '@CannotUseGenericProduct@ ' || v_productName);
+  END IF;
+  
   IF (v_resaction = 'PR') THEN
   /*
     Reservation Complete Process