Fixed issue 22231.Fixes in get_stock applying warehouse rules.
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Wed, 07 Nov 2012 18:34:23 +0100
changeset 18688 9181cfa32cd7
parent 18687 a4ef43733202
child 18689 a17b382229ce
Fixed issue 22231.Fixes in get_stock applying warehouse rules.
src-db/database/model/functions/MA_PRODUCTIONRUN_STANDARD.xml
src-db/database/model/functions/M_GET_STOCK.xml
src-db/database/model/functions/M_INOUT_CREATE.xml
src-db/database/model/functions/M_UNIQUELOCATOR_RULE.xml
src-db/database/model/tables/M_STOCK_PROPOSED.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/model/functions/MA_PRODUCTIONRUN_STANDARD.xml	Mon Sep 10 17:29:34 2012 +0200
+++ b/src-db/database/model/functions/MA_PRODUCTIONRUN_STANDARD.xml	Wed Nov 07 18:34:23 2012 +0100
@@ -335,6 +335,9 @@
               IF (v_pinstance_result = 0) THEN
                 -- Error on m_get_stock
                 RAISE_APPLICATION_ERROR(-20000, v_pinstance_msg);
+              ELSIF (v_pinstance_result = 2) THEN
+                v_result := 2;
+                v_message := v_message || v_pinstance_msg;
               END IF;
             END; -- End Call M_GET_STOCK
             OPEN CUR_STOCK(v_AD_Pinstance_ID);
--- a/src-db/database/model/functions/M_GET_STOCK.xml	Mon Sep 10 17:29:34 2012 +0200
+++ b/src-db/database/model/functions/M_GET_STOCK.xml	Wed Nov 07 18:34:23 2012 +0100
@@ -152,11 +152,13 @@
     INSERT INTO m_stock_proposed (
         m_stock_proposed_id, ad_client_id, ad_org_id, isactive, 
         created , createdby, updated, updatedby,
-        ad_pinstance_id, priority, m_storage_detail_id, quantity, qtyorder
+        ad_pinstance_id, priority, m_storage_detail_id, quantity, qtyorder,
+        isfinal
     ) VALUES (
         get_uuid(), v_ClientID, v_OrgID, 'Y',
         now(), v_AD_User_ID, now(), v_AD_User_ID,
-        pinstance_id, v_Count, Cur_Stock.M_STORAGE_DETAIL_ID, Cur_Stock.Qty, Cur_Stock.qtyorder
+        pinstance_id, v_Count, Cur_Stock.M_STORAGE_DETAIL_ID, Cur_Stock.Qty, Cur_Stock.qtyorder,
+        'Y'
     );
     v_Count:=v_Count+1;
   END LOOP;
@@ -184,11 +186,13 @@
     INSERT INTO m_stock_proposed (
         m_stock_proposed_id, ad_client_id, ad_org_id, isactive, 
         created , createdby, updated, updatedby,
-        ad_pinstance_id, priority, m_storage_detail_id, quantity, qtyorder
+        ad_pinstance_id, priority, m_storage_detail_id, quantity, qtyorder,
+        isfinal
     ) VALUES (
         get_uuid(), v_ClientID, v_OrgID, 'Y',
         now(), v_AD_User_ID, now(), v_AD_User_ID,
-        pinstance_id, v_Count, Cur_Stock.M_STORAGE_DETAIL_ID, Cur_Stock.Qty, Cur_Stock.QtyOrder
+        pinstance_id, v_Count, Cur_Stock.M_STORAGE_DETAIL_ID, Cur_Stock.Qty, Cur_Stock.QtyOrder,
+        'Y'
     );
     v_Count:=v_Count+1;
   END LOOP;
@@ -224,39 +228,86 @@
     END;
   END IF;
   
-  -- Apply stock rules
+  -- Apply stock rules only if a quantity is given
+  IF (v_Quantity IS NULL) THEN
+    RETURN;
+  END IF;
   DECLARE
     v_sql VARCHAR2(2000);
     v_applyrule CHAR(1);
+    v_finalqty NUMBER;
+    v_totalqty NUMBER;
+    v_availableqty NUMBER;
+    v_qtyaux NUMBER:=v_quantity;
+    v_AuxResult NUMBER;
+    v_AuxMessage VARCHAR2(2000):='';
+    v_productname M_PRODUCT.NAME%TYPE;
   BEGIN
+    SELECT SUM(quantity) INTO v_availableqty
+    FROM m_stock_proposed
+    WHERE ad_pinstance_id = pinstance_id;
+
     FOR cur_warehouse IN (
-        SELECT l.m_warehouse_id, wr.procedurename, wr.m_warehouse_rule_id
+        SELECT l.m_warehouse_id, wr.procedurename, wr.m_warehouse_rule_id, MAX(sp.priority) AS priority, w.name
         FROM m_stock_proposed sp
             JOIN m_storage_detail sd ON sp.m_storage_detail_id = sd.m_storage_detail_id
             JOIN m_locator l ON sd.m_locator_id = l.m_locator_id
             JOIN m_warehouse w ON l.m_warehouse_id = w.m_warehouse_id
-            JOIN m_warehouse_rule wr ON wr.m_warehouse_rule_id = COALESCE(v_warehouse_rule_id, w.m_warehouse_rule_id)
+            LEFT JOIN m_warehouse_rule wr ON wr.m_warehouse_rule_id = COALESCE(v_warehouse_rule_id, w.m_warehouse_rule_id)
         WHERE ad_pinstance_id = pinstance_id
-        GROUP BY l.m_warehouse_id, wr.m_warehouse_rule_id, wr.procedurename
+        GROUP BY l.m_warehouse_id, wr.m_warehouse_rule_id, wr.procedurename, w.name
         ORDER BY MIN(sp.priority)
     ) LOOP
-      IF (AD_GET_RDBMS() = 'ORACLE') THEN
-        v_Sql := 'CALL ' || cur_warehouse.procedurename || '('''||pinstance_id||''', '''||cur_warehouse.m_warehouse_id||''')';
-      ELSE
-        v_Sql := 'SELECT ' || cur_warehouse.procedurename || '('''||pinstance_id||''', '''||cur_warehouse.m_warehouse_id||''') FROM DUAL';
+      IF (cur_warehouse.procedurename IS NOT NULL) THEN
+        AD_UPDATE_PINSTANCE(PInstance_ID, NULL, 'N', 1, '', p_calledfromapp) ;
+        IF (AD_GET_RDBMS() = 'ORACLE') THEN
+          v_Sql := 'CALL ' || cur_warehouse.procedurename || '('''||pinstance_id||''', '''||cur_warehouse.m_warehouse_id||''')';
+        ELSE
+          v_Sql := 'SELECT ' || cur_warehouse.procedurename || '('''||pinstance_id||''', '''||cur_warehouse.m_warehouse_id||''') FROM DUAL';
+        END IF;
+        BEGIN
+          EXECUTE IMMEDIATE v_Sql;
+        EXCEPTION WHEN OTHERS THEN
+          DBMS_OUTPUT.PUT_LINE('ERROR EXECUTING STOCK RULE PROCEDURE');
+        END;
+        SELECT result, errormsg INTO v_auxresult, v_auxmessage
+        FROM ad_pinstance
+        WHERE ad_pinstance_id = pinstance_id;
+        v_message := v_message || ' ' || cur_warehouse.name || ': ' || COALESCE(v_auxmessage, '@Success@');
       END IF;
-      BEGIN
-        EXECUTE IMMEDIATE v_Sql;
-      EXCEPTION WHEN OTHERS THEN
-        DBMS_OUTPUT.PUT_LINE('ERROR EXECUTING STOCK RULE PROCEDURE');
-      END;
-      SELECT result, errormsg INTO v_result, v_message
-      FROM ad_pinstance
-      WHERE ad_pinstance_id = pinstance_id;
-      IF (v_result = 0) THEN
-        RAISE_APPLICATION_ERROR(-20000, v_message);
+      -- Check if there is enough final quantity.
+      SELECT COALESCE(SUM(quantity), 0) INTO v_finalqty
+      FROM m_stock_proposed
+      WHERE ad_pinstance_id = pinstance_id
+        AND priority <= cur_warehouse.priority
+        AND isfinal = 'Y';
+      v_qtyaux := v_qtyaux - v_finalqty;
+      IF (v_qtyaux <= 0) THEN
+        DELETE FROM m_stock_proposed
+        WHERE ad_pinstance_id = pinstance_id
+          AND (priority > cur_warehouse.priority
+              OR isfinal = 'N');
+        EXIT;
       END IF;
+      
     END LOOP;
+    SELECT SUM(CASE isfinal WHEN 'Y' THEN quantity ELSE 0 END), SUM(quantity)
+      INTO v_finalqty, v_totalqty
+    FROM m_stock_proposed
+    WHERE ad_pinstance_id = pinstance_id;
+    IF (v_totalqty < v_quantity AND v_availableqty >= v_quantity) THEN
+      IF (v_message IS NULL OR v_message = '') THEN
+        SELECT name INTO v_productname
+        FROM m_product
+        WHERE m_product_id = v_productid;
+        v_message := '@NotEnoughStockedDueWHRule@';
+      END IF;
+      RAISE_APPLICATION_ERROR(-20000, v_message);
+    END IF;
+    IF (v_totalqty > v_finalqty) THEN
+      -- IF these quantities are different there is some proposed stock with the isFinal flag = 'N'
+      v_result := 2;
+    END IF;
   END;
 
   --  Update AD_PInstance
--- a/src-db/database/model/functions/M_INOUT_CREATE.xml	Mon Sep 10 17:29:34 2012 +0200
+++ b/src-db/database/model/functions/M_INOUT_CREATE.xml	Wed Nov 07 18:34:23 2012 +0100
@@ -439,6 +439,9 @@
                   IF (v_pinstance_result = 0) THEN
                     -- Error on m_get_stock
                     RAISE_APPLICATION_ERROR(-20000, v_pinstance_msg);
+                  ELSIF (v_pinstance_result = 2) THEN
+                    v_result := 2;
+                    v_message := v_message || v_pinstance_msg;
                   END IF;
                 END; -- End Call M_GET_STOCK
                 
--- a/src-db/database/model/functions/M_UNIQUELOCATOR_RULE.xml	Mon Sep 10 17:29:34 2012 +0200
+++ b/src-db/database/model/functions/M_UNIQUELOCATOR_RULE.xml	Wed Nov 07 18:34:23 2012 +0100
@@ -80,10 +80,15 @@
                                     AND sd.m_locator_id <> COALESCE(v_selectedlocatorid, '-1')
                                     AND l.m_warehouse_id = p_warehouse_id);
   ELSE
-    SELECT name INTO v_productname
-    FROM m_product
-    WHERE m_product_id = v_productid;
-    v_Message := '@Product@: ' || v_productname ||'. @NotEnoughLocatorUniqueStock@';
+    UPDATE m_stock_proposed
+    SET isfinal = 'N'
+    WHERE m_stock_proposed_id IN (SELECT m_stock_proposed_id
+                                  FROM m_stock_proposed ms
+                                      JOIN m_storage_detail sd ON ms.m_storage_detail_id = sd.m_storage_detail_id
+                                      JOIN m_locator l ON sd.m_locator_id = l.m_locator_id
+                                  WHERE ms.ad_pinstance_id = pinstance_id
+                                    AND l.m_warehouse_id = p_warehouse_id);
+    v_Message := '@NotEnoughLocatorUniqueStock@';
     AD_UPDATE_PINSTANCE(PInstance_ID, NULL, 'N', 2, v_Message, 'N');
     RETURN;
   END IF;
--- a/src-db/database/model/tables/M_STOCK_PROPOSED.xml	Mon Sep 10 17:29:34 2012 +0200
+++ b/src-db/database/model/tables/M_STOCK_PROPOSED.xml	Wed Nov 07 18:34:23 2012 +0100
@@ -53,6 +53,10 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="ISFINAL" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_CLIENT" name="AD_CLIENT_MSTOCKPROPOSED">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
@@ -68,6 +72,7 @@
       <index name="M_STOCK_PROPOSED_PINSTANCE_ID" unique="false">
         <index-column name="AD_PINSTANCE_ID"/>
       </index>
+      <check name="M_STOCK_PROPOSED_ISFINAL_CHK"><![CDATA[ISFINAL IN ('Y', 'N')]]></check>
       <check name="M_STOCKPROPOSED_ISACTIVE_CHK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
     </table>
   </database>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Mon Sep 10 17:29:34 2012 +0200
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Wed Nov 07 18:34:23 2012 +0100
@@ -293196,6 +293196,40 @@
 <!--CD4DD2DDEE274626B5DAD83C88DB9236-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--CD4DD2DDEE274626B5DAD83C88DB9236--></AD_COLUMN>
 
+<!--CDE4B52D8B583968E040007F01000910--><AD_COLUMN>
+<!--CDE4B52D8B583968E040007F01000910-->  <AD_COLUMN_ID><![CDATA[CDE4B52D8B583968E040007F01000910]]></AD_COLUMN_ID>
+<!--CDE4B52D8B583968E040007F01000910-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CDE4B52D8B583968E040007F01000910-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CDE4B52D8B583968E040007F01000910-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CDE4B52D8B583968E040007F01000910-->  <NAME><![CDATA[Final]]></NAME>
+<!--CDE4B52D8B583968E040007F01000910-->  <HELP><![CDATA[Identifies a final record]]></HELP>
+<!--CDE4B52D8B583968E040007F01000910-->  <COLUMNNAME><![CDATA[IsFinal]]></COLUMNNAME>
+<!--CDE4B52D8B583968E040007F01000910-->  <AD_TABLE_ID><![CDATA[FF80818132C964E30132C968F45B0008]]></AD_TABLE_ID>
+<!--CDE4B52D8B583968E040007F01000910-->  <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID>
+<!--CDE4B52D8B583968E040007F01000910-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--CDE4B52D8B583968E040007F01000910-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--CDE4B52D8B583968E040007F01000910-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--CDE4B52D8B583968E040007F01000910-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--CDE4B52D8B583968E040007F01000910-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--CDE4B52D8B583968E040007F01000910-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--CDE4B52D8B583968E040007F01000910-->  <SEQNO><![CDATA[140]]></SEQNO>
+<!--CDE4B52D8B583968E040007F01000910-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--CDE4B52D8B583968E040007F01000910-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--CDE4B52D8B583968E040007F01000910-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--CDE4B52D8B583968E040007F01000910-->  <AD_ELEMENT_ID><![CDATA[CDE4B52D8B593968E040007F01000910]]></AD_ELEMENT_ID>
+<!--CDE4B52D8B583968E040007F01000910-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--CDE4B52D8B583968E040007F01000910-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--CDE4B52D8B583968E040007F01000910-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--CDE4B52D8B583968E040007F01000910-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--CDE4B52D8B583968E040007F01000910-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--CDE4B52D8B583968E040007F01000910-->  <POSITION><![CDATA[14]]></POSITION>
+<!--CDE4B52D8B583968E040007F01000910-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--CDE4B52D8B583968E040007F01000910-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--CDE4B52D8B583968E040007F01000910-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--CDE4B52D8B583968E040007F01000910-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--CDE4B52D8B583968E040007F01000910-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--CDE4B52D8B583968E040007F01000910--></AD_COLUMN>
+
 <!--CEC2AA7C93F4423A97CE96BDD1C4B49F--><AD_COLUMN>
 <!--CEC2AA7C93F4423A97CE96BDD1C4B49F-->  <AD_COLUMN_ID><![CDATA[CEC2AA7C93F4423A97CE96BDD1C4B49F]]></AD_COLUMN_ID>
 <!--CEC2AA7C93F4423A97CE96BDD1C4B49F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -294632,7 +294666,7 @@
 <!--E1A5DA80AD1E4658ACA1429046243346-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--E1A5DA80AD1E4658ACA1429046243346-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--E1A5DA80AD1E4658ACA1429046243346-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--E1A5DA80AD1E4658ACA1429046243346-->  <POSITION><![CDATA[14]]></POSITION>
+<!--E1A5DA80AD1E4658ACA1429046243346-->  <POSITION><![CDATA[13]]></POSITION>
 <!--E1A5DA80AD1E4658ACA1429046243346-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--E1A5DA80AD1E4658ACA1429046243346-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--E1A5DA80AD1E4658ACA1429046243346-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Mon Sep 10 17:29:34 2012 +0200
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Wed Nov 07 18:34:23 2012 +0100
@@ -28817,6 +28817,19 @@
 <!--CD57A1DBADD440EC9551AE6BC51E8643-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--CD57A1DBADD440EC9551AE6BC51E8643--></AD_ELEMENT>
 
+<!--CDE4B52D8B593968E040007F01000910--><AD_ELEMENT>
+<!--CDE4B52D8B593968E040007F01000910-->  <AD_ELEMENT_ID><![CDATA[CDE4B52D8B593968E040007F01000910]]></AD_ELEMENT_ID>
+<!--CDE4B52D8B593968E040007F01000910-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CDE4B52D8B593968E040007F01000910-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CDE4B52D8B593968E040007F01000910-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CDE4B52D8B593968E040007F01000910-->  <COLUMNNAME><![CDATA[IsFinal]]></COLUMNNAME>
+<!--CDE4B52D8B593968E040007F01000910-->  <NAME><![CDATA[Final]]></NAME>
+<!--CDE4B52D8B593968E040007F01000910-->  <PRINTNAME><![CDATA[Final]]></PRINTNAME>
+<!--CDE4B52D8B593968E040007F01000910-->  <HELP><![CDATA[Identifies a final record]]></HELP>
+<!--CDE4B52D8B593968E040007F01000910-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--CDE4B52D8B593968E040007F01000910-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--CDE4B52D8B593968E040007F01000910--></AD_ELEMENT>
+
 <!--CEFF12045E10490496BA6CE8AC1AD27A--><AD_ELEMENT>
 <!--CEFF12045E10490496BA6CE8AC1AD27A-->  <AD_ELEMENT_ID><![CDATA[CEFF12045E10490496BA6CE8AC1AD27A]]></AD_ELEMENT_ID>
 <!--CEFF12045E10490496BA6CE8AC1AD27A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Mon Sep 10 17:29:34 2012 +0200
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Wed Nov 07 18:34:23 2012 +0100
@@ -21057,6 +21057,17 @@
 <!--FB074AB5BE884C2FAEE6159575A47F09-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--FB074AB5BE884C2FAEE6159575A47F09--></AD_MESSAGE>
 
+<!--FB565D1577214DA8AE2C9AEAF12B94F9--><AD_MESSAGE>
+<!--FB565D1577214DA8AE2C9AEAF12B94F9-->  <AD_MESSAGE_ID><![CDATA[FB565D1577214DA8AE2C9AEAF12B94F9]]></AD_MESSAGE_ID>
+<!--FB565D1577214DA8AE2C9AEAF12B94F9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FB565D1577214DA8AE2C9AEAF12B94F9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FB565D1577214DA8AE2C9AEAF12B94F9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FB565D1577214DA8AE2C9AEAF12B94F9-->  <VALUE><![CDATA[NotEnoughStockedDueWHRule]]></VALUE>
+<!--FB565D1577214DA8AE2C9AEAF12B94F9-->  <MSGTEXT><![CDATA[After applying the warehouse rules there is not enough stocked quantity available.]]></MSGTEXT>
+<!--FB565D1577214DA8AE2C9AEAF12B94F9-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--FB565D1577214DA8AE2C9AEAF12B94F9-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FB565D1577214DA8AE2C9AEAF12B94F9--></AD_MESSAGE>
+
 <!--FBD240BC51C8471F85D65EFB40E079B6--><AD_MESSAGE>
 <!--FBD240BC51C8471F85D65EFB40E079B6-->  <AD_MESSAGE_ID><![CDATA[FBD240BC51C8471F85D65EFB40E079B6]]></AD_MESSAGE_ID>
 <!--FBD240BC51C8471F85D65EFB40E079B6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>