Fixes Issue 26851:Order Document with inactive BusinessPartner can't be booked
authorAtul Gaware <atul.gaware@openbravo.com>
Thu, 31 Jul 2014 17:03:13 +0530
changeset 24147 69e3ea6e8f8f
parent 24146 6fb861c99195
child 24148 2f9dac31e199
Fixes Issue 26851:Order Document with inactive BusinessPartner can't be booked
src-db/database/model/functions/C_ORDER_POST1.xml
src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/model/functions/C_ORDER_POST1.xml	Wed Jul 16 01:44:04 2014 +0530
+++ b/src-db/database/model/functions/C_ORDER_POST1.xml	Thu Jul 31 17:03:13 2014 +0530
@@ -125,6 +125,7 @@
 
   v_iscashvat C_Order.IsCashVat%TYPE;
   v_recalculateDiscounts VARCHAR(1):='Y';
+  v_isactive VARCHAR2(1):='N';
 
   BEGIN
     IF (p_PInstance_ID IS NOT NULL) THEN
@@ -178,6 +179,15 @@
       END IF;
     END LOOP;
   END IF;
+
+  /* Check active business partner*/
+  SELECT isactive INTO v_isactive
+  FROM C_Bpartner
+  WHERE C_Bpartner_ID = v_C_Bpartner_ID;
+
+  IF(v_isactive = 'N') THEN
+    RAISE_APPLICATION_ERROR(-20000, '@InActiveBusinessPartner@');
+  END IF;
   
     /**
     * Read Order
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Wed Jul 16 01:44:04 2014 +0530
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Thu Jul 31 17:03:13 2014 +0530
@@ -22688,6 +22688,18 @@
 <!--B14C8449EE734A759BBCFD72C6767360-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--B14C8449EE734A759BBCFD72C6767360--></AD_MESSAGE>
 
+<!--B179C1CD5B08474888A6B01234B02987--><AD_MESSAGE>
+<!--B179C1CD5B08474888A6B01234B02987-->  <AD_MESSAGE_ID><![CDATA[B179C1CD5B08474888A6B01234B02987]]></AD_MESSAGE_ID>
+<!--B179C1CD5B08474888A6B01234B02987-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B179C1CD5B08474888A6B01234B02987-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B179C1CD5B08474888A6B01234B02987-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B179C1CD5B08474888A6B01234B02987-->  <VALUE><![CDATA[InActiveBusinessPartner]]></VALUE>
+<!--B179C1CD5B08474888A6B01234B02987-->  <MSGTEXT><![CDATA[Business Partner used in transaction is inactive.]]></MSGTEXT>
+<!--B179C1CD5B08474888A6B01234B02987-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--B179C1CD5B08474888A6B01234B02987-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--B179C1CD5B08474888A6B01234B02987-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--B179C1CD5B08474888A6B01234B02987--></AD_MESSAGE>
+
 <!--B1A49D5F755A4497AB6FF3D4214CEF80--><AD_MESSAGE>
 <!--B1A49D5F755A4497AB6FF3D4214CEF80-->  <AD_MESSAGE_ID><![CDATA[B1A49D5F755A4497AB6FF3D4214CEF80]]></AD_MESSAGE_ID>
 <!--B1A49D5F755A4497AB6FF3D4214CEF80-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>