details:   https://code.openbravo.com/erp/devel/pi/rev/74e087b3edb2
changeset: 17474:74e087b3edb2
user:      Stefan Hühner <stefan.huehner <at> openbravo.com>
date:      Sun Jul 15 12:41:05 2012 +0200
summary:   Issue 20805: Temporarily backout 46e3a194f8b4 as it should not be 
promoted to MP13

details:   https://code.openbravo.com/erp/devel/pi/rev/8b6b5db94fcb
changeset: 17475:8b6b5db94fcb
user:      Stefan Hühner <stefan.huehner <at> openbravo.com>
date:      Sun Jul 15 12:42:19 2012 +0200
summary:   Issue 20652: Temporarily backout 60e449f25f23 as it should not be 
promoted to MP13

details:   https://code.openbravo.com/erp/devel/pi/rev/f4befe4e2802
changeset: 17476:f4befe4e2802
user:      Stefan Hühner <stefan.huehner <at> openbravo.com>
date:      Sun Jul 15 12:42:49 2012 +0200
summary:   Issue 20652: Temporarily backout a53efff1a3c8 as it should not be 
promoted to MP13

diffstat:

 src-db/database/model/functions/M_PRODUCT_BOM_CHECK.xml     |  172 ++++++++++++
 src-db/database/sourcedata/AD_MODEL_OBJECT.xml              |   12 -
 src-db/database/sourcedata/AD_PROCESS.xml                   |    2 +-
 src/org/openbravo/erpCommon/ad_process/CreateTaxReport.java |   25 +-
 src/org/openbravo/erpCommon/ad_process/VerifyBOM.java       |  100 ------
 5 files changed, 179 insertions(+), 132 deletions(-)

diffs (truncated from 390 to 300 lines):

diff -r 387b5495a0a6 -r f4befe4e2802 
src-db/database/model/functions/M_PRODUCT_BOM_CHECK.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/functions/M_PRODUCT_BOM_CHECK.xml   Sun Jul 15 
12:42:49 2012 +0200
@@ -0,0 +1,172 @@
+<?xml version="1.0"?>
+  <database name="FUNCTION M_PRODUCT_BOM_CHECK">
+    <function name="M_PRODUCT_BOM_CHECK" type="NULL">
+      <parameter name="pinstance_id" type="VARCHAR" mode="in">
+        <default/>
+      </parameter>
+      
<body><![CDATA[/*************************************************************************
+  * The contents of this file are subject to the Compiere Public
+  * License 1.1 ("License"); You may not use this file except in
+  * compliance with the License. You may obtain a copy of the License in
+  * the legal folder of your Openbravo installation.
+  * Software distributed under the License is distributed on an
+  * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+  * implied. See the License for the specific language governing rights
+  * and limitations under the License.
+  * The Original Code is  Compiere  ERP &  Business Solution
+  * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
+  * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke,
+  * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
+  * All Rights Reserved.
+  * Contributor(s): Openbravo SLU
+  * Contributions are Copyright (C) 2001-2012 Openbravo, S.L.U.
+  *
+  * Specifically, this derivative work is based upon the following Compiere
+  * file and version.
+  *************************************************************************
+  * $Id: M_Product_BOM_Check.sql,v 1.2 2002/05/22 02:48:28 jjanke Exp $
+  ***
+  * Title: Check BOM Structure (free of cycles)
+  * Description:
+  *  Tree cannot contain BOMs which are already referenced
+  ************************************************************************/
+  -- Logistice
+  v_ResultStr VARCHAR2(2000):='';
+  v_Message VARCHAR2(2000):='';
+  v_Record_ID VARCHAR2(32);
+  v_temp VARCHAR2(32);
+  -- Parameter
+  TYPE RECORD IS REF CURSOR;
+    Cur_Parameter RECORD;
+    -- Variables
+    v_Verified CHAR(1):='Y';
+    v_IsBOM CHAR(1) ;
+    v_CountNo NUMBER;
+    FINISH_PROCESS BOOLEAN:=false;
+  BEGIN
+    --  Update AD_PInstance
+    DBMS_OUTPUT.PUT_LINE('Updating PInstance - Processing ' || PInstance_ID) ;
+    v_ResultStr:='PInstanceNotFound';
+    AD_UPDATE_PINSTANCE(PInstance_ID, NULL, 'Y', NULL, NULL) ;
+  BEGIN --BODY
+    -- Get Parameters
+    v_ResultStr:='ReadingParameters';
+    FOR Cur_Parameter IN
+      (SELECT i.Record_ID,
+        p.ParameterName,
+        p.P_String,
+        p.P_Number,
+        p.P_Date
+      FROM AD_PInstance i
+      LEFT JOIN AD_PInstance_Para p
+        ON i.AD_PInstance_ID=p.AD_PInstance_ID
+      WHERE i.AD_PInstance_ID=PInstance_ID
+      ORDER BY p.SeqNo
+      )
+    LOOP
+      v_Record_ID:=Cur_Parameter.Record_ID;
+    END LOOP; -- Get Parameter
+    DBMS_OUTPUT.PUT_LINE('  Record_ID=' || v_Record_ID) ;
+    v_temp:=C_CREATE_TEMPORARY_TABLES();
+    -- Record ID is M_Product_ID of product to be tested
+    SELECT IsBOM  INTO v_IsBOM  FROM M_Product  WHERE M_Product_ID=v_Record_ID;
+    -- No BOM - should not happen, but no problem
+    IF(v_IsBOM='N') THEN
+      FINISH_PROCESS:=true;
+      -- Did not find product
+    ELSIF(v_IsBOM<>'Y') THEN
+      RETURN;
+    END IF;
+    IF(NOT FINISH_PROCESS) THEN
+      -- Checking BOM Structure
+      v_ResultStr:='InsertingRoot';
+      -- Table to put all BOMs - duplicate will cause exception
+      DELETE FROM C_TEMP_Selection2 WHERE Query_ID='0';
+      INSERT INTO C_TEMP_Selection2(Query_ID, C_TEMP_Selection_ID) VALUES('0', 
v_Record_ID) ;
+      -- Table of root modes
+      DELETE FROM C_TEMP_Selection;
+      INSERT INTO C_TEMP_Selection(C_TEMP_Selection_ID) VALUES(v_Record_ID) ;
+      LOOP
+        -- How many do we have:1
+        SELECT COUNT(*) INTO v_CountNo  FROM C_TEMP_Selection;
+        -- Nothing to do
+        EXIT WHEN(v_CountNo=0) ;
+        -- Insert BOM Nodes into "All" table
+        BEGIN
+          INSERT
+          INTO C_TEMP_Selection2
+            (
+              Query_ID,
+              C_TEMP_Selection_ID
+            )
+          SELECT '0',
+            p.M_Product_ID
+          FROM M_Product p
+          WHERE v_IsBOM='Y'
+            AND EXISTS
+            (SELECT *
+            FROM M_Product_BOM b
+            WHERE p.M_Product_ID=b.M_ProductBOM_ID
+              AND b.isactive='Y'
+              AND b.M_Product_ID IN
+              (SELECT C_TEMP_Selection_ID FROM C_TEMP_Selection)
+            )
+            ;
+        EXCEPTION 
+         WHEN others THEN
+            RAISE_APPLICATION_ERROR(-20000,'@LOOP_IN_BOM@');
+        END;
+
+        -- Insert BOM Nodes into temporary table
+        DELETE FROM C_TEMP_Selection2 WHERE Query_ID='1';
+        INSERT
+        INTO C_TEMP_Selection2
+          (
+            Query_ID,
+            C_TEMP_Selection_ID
+          )
+        SELECT '1',
+          p.M_Product_ID
+        FROM M_Product p
+        WHERE v_IsBOM='Y'
+          AND EXISTS
+          (SELECT *
+          FROM M_Product_BOM b
+          WHERE p.M_Product_ID=b.M_ProductBOM_ID
+            AND b.isactive='Y'
+            AND b.M_Product_ID IN
+            (SELECT C_TEMP_Selection_ID FROM C_TEMP_Selection)
+          )
+          ;
+        -- Copy into root table
+        DELETE FROM C_TEMP_Selection;
+        INSERT
+        INTO C_TEMP_Selection
+          (
+            C_TEMP_Selection_ID
+          )
+        SELECT C_TEMP_Selection_ID  FROM C_TEMP_Selection2  WHERE Query_ID='1';
+      END LOOP;
+    END IF; --FINISH_PROCESS
+    --<<FINISH_PROCESS>>
+    --  Update AD_PInstance
+    UPDATE M_Product  SET IsVerified='Y'  WHERE M_Product_ID=v_Record_ID;
+    --  Update AD_PInstance
+    DBMS_OUTPUT.PUT_LINE('Updating PInstance - Finished ' || v_Message) ;
+    AD_UPDATE_PINSTANCE(PInstance_ID, NULL, 'N', 1, v_Message) ;
+    RETURN;
+  END; --BODY
+EXCEPTION
+WHEN OTHERS THEN
+  v_ResultStr:= '@ERROR=' || SQLERRM;
+  DBMS_OUTPUT.PUT_LINE(v_ResultStr) ;
+  AD_UPDATE_PINSTANCE(PInstance_ID, NULL, 'N', 0, v_ResultStr) ;
+  --
+  UPDATE M_Product  SET IsVerified='N'  WHERE M_Product_ID=v_Record_ID;
+  -- Commented by cromero 19102006 COMMIT;
+  --
+  RETURN;
+END M_PRODUCT_BOM_CHECK
+]]></body>
+    </function>
+  </database>
diff -r 387b5495a0a6 -r f4befe4e2802 
src-db/database/sourcedata/AD_MODEL_OBJECT.xml
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT.xml    Fri Jul 13 14:22:44 
2012 +0200
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT.xml    Sun Jul 15 12:42:49 
2012 +0200
@@ -3906,18 +3906,6 @@
 <!--9EDAD41A950B4A2A9CFB20151E1D4FA1-->  
<OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
 <!--9EDAD41A950B4A2A9CFB20151E1D4FA1--></AD_MODEL_OBJECT>
 
-<!--A0DC35D75E03464E98927A7AFA384705--><AD_MODEL_OBJECT>
-<!--A0DC35D75E03464E98927A7AFA384705-->  
<AD_MODEL_OBJECT_ID><![CDATA[A0DC35D75E03464E98927A7AFA384705]]></AD_MODEL_OBJECT_ID>
-<!--A0DC35D75E03464E98927A7AFA384705-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--A0DC35D75E03464E98927A7AFA384705-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--A0DC35D75E03464E98927A7AFA384705-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--A0DC35D75E03464E98927A7AFA384705-->  <ACTION><![CDATA[P]]></ACTION>
-<!--A0DC35D75E03464E98927A7AFA384705-->  
<CLASSNAME><![CDATA[org.openbravo.erpCommon.ad_process.VerifyBOM]]></CLASSNAME>
-<!--A0DC35D75E03464E98927A7AFA384705-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
-<!--A0DC35D75E03464E98927A7AFA384705-->  
<AD_PROCESS_ID><![CDATA[136]]></AD_PROCESS_ID>
-<!--A0DC35D75E03464E98927A7AFA384705-->  
<OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
-<!--A0DC35D75E03464E98927A7AFA384705--></AD_MODEL_OBJECT>
-
 <!--A843E8A63F05427B8A204810E7E7511B--><AD_MODEL_OBJECT>
 <!--A843E8A63F05427B8A204810E7E7511B-->  
<AD_MODEL_OBJECT_ID><![CDATA[A843E8A63F05427B8A204810E7E7511B]]></AD_MODEL_OBJECT_ID>
 <!--A843E8A63F05427B8A204810E7E7511B-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r 387b5495a0a6 -r f4befe4e2802 src-db/database/sourcedata/AD_PROCESS.xml
--- a/src-db/database/sourcedata/AD_PROCESS.xml Fri Jul 13 14:22:44 2012 +0200
+++ b/src-db/database/sourcedata/AD_PROCESS.xml Sun Jul 15 12:42:49 2012 +0200
@@ -670,11 +670,11 @@
 <!--136-->  <HELP><![CDATA[The Verify BOM Structure checks the elements and 
steps which comprise a Bill of Materials.]]></HELP>
 <!--136-->  <ACCESSLEVEL><![CDATA[3]]></ACCESSLEVEL>
 <!--136-->  <ISUSERSTARTABLE><![CDATA[N]]></ISUSERSTARTABLE>
+<!--136-->  <PROCEDURENAME><![CDATA[M_Product_BOM_Check]]></PROCEDURENAME>
 <!--136-->  <ISREPORT><![CDATA[N]]></ISREPORT>
 <!--136-->  <ISDIRECTPRINT><![CDATA[N]]></ISDIRECTPRINT>
 <!--136-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
 <!--136-->  <ISJASPER><![CDATA[N]]></ISJASPER>
-<!--136-->  <ISEXTERNALSERVICE><![CDATA[N]]></ISEXTERNALSERVICE>
 <!--136-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--136-->  <UIPATTERN><![CDATA[S]]></UIPATTERN>
 <!--136-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
diff -r 387b5495a0a6 -r f4befe4e2802 
src/org/openbravo/erpCommon/ad_process/CreateTaxReport.java
--- a/src/org/openbravo/erpCommon/ad_process/CreateTaxReport.java       Fri Jul 
13 14:22:44 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/CreateTaxReport.java       Sun Jul 
15 12:42:49 2012 +0200
@@ -11,7 +11,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-2012 Openbravo SLU
+ * All portions are Copyright (C) 2001-2010 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -67,7 +67,7 @@
       String strDateFrom = vars.getGlobalVariable("inpDateFrom", 
"CreateTaxReport|dateFrom", "");
       String strDateTo = vars.getGlobalVariable("inpDateTo", 
"CreateTaxReport|dateTo", "");
       String strOrg = vars.getGlobalVariable("inpadOrgId", 
"CreateTaxReport|orgId", "0");
-      printPagePopUp(request, response, vars, strTaxReportId, strDateFrom, 
strDateTo, strOrg);
+      printPagePopUp(response, vars, strTaxReportId, strDateFrom, strDateTo, 
strOrg);
     } else
       pageErrorPopUp(response);
   }
@@ -169,9 +169,9 @@
     out.close();
   }
 
-  private void printPagePopUp(HttpServletRequest request, HttpServletResponse 
response,
-      VariablesSecureApp vars, String strTaxReportId, String strDateFrom, 
String strDateTo,
-      String strOrg) throws IOException, ServletException {
+  private void printPagePopUp(HttpServletResponse response, VariablesSecureApp 
vars,
+      String strTaxReportId, String strDateFrom, String strDateTo, String 
strOrg)
+      throws IOException, ServletException {
     if (log4j.isDebugEnabled())
       log4j.debug("Output: pop up CreateTaxReport");
     XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
@@ -190,12 +190,6 @@
     xmlDocument.setParameter("directory", "var baseDirectory = \"" + 
strReplaceWith + "/\";\n");
     xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() 
+ "\";");
     xmlDocument.setParameter("theme", vars.getTheme());
-    if (dataTree.length == 0) {
-      advisePopUp(request, response, "WARNING",
-          Utility.messageBD(this, "ProcessStatus-W", vars.getLanguage()),
-          Utility.messageBD(this, "NoDataFound", vars.getLanguage()));
-      return;
-    }
     xmlDocument.setParameter("title", dataTree[0].name);
     xmlDocument.setData("structure", dataTree);
     response.setContentType("text/html; charset=UTF-8");
@@ -283,12 +277,8 @@
   private CreateTaxReportData[] convertVector(Vector<Object> vectorArray) 
throws ServletException {
     CreateTaxReportData[] data = new CreateTaxReportData[vectorArray.size()];
     BigDecimal count = BigDecimal.ZERO;
-    Vector<Object> vectorArrayDisplay = new Vector<Object>();
     for (int i = 0; i < vectorArray.size(); i++) {
       data[i] = (CreateTaxReportData) vectorArray.elementAt(i);
-      if (data[i].isshown.equals("Y")) {
-        vectorArrayDisplay.addElement(data[i]);
-      }
     }
     if (log4j.isDebugEnabled())
       log4j.debug("***************************data.length: " + data.length);
@@ -321,10 +311,7 @@
         count = BigDecimal.ZERO;
       }
     }
-
-    CreateTaxReportData[] dataShown = new 
CreateTaxReportData[vectorArrayDisplay.size()];
-    vectorArrayDisplay.copyInto(dataShown);
-    return dataShown;
+    return data;
   }
 
   public String getServletInfo() {
diff -r 387b5495a0a6 -r f4befe4e2802 
src/org/openbravo/erpCommon/ad_process/VerifyBOM.java
--- a/src/org/openbravo/erpCommon/ad_process/VerifyBOM.java     Fri Jul 13 
14:22:44 2012 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/*
- *************************************************************************
- * The contents of this file are subject to the Openbravo  Public  License
- * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
- * Version 1.1  with a permitted attribution clause; you may not  use this
- * file except in compliance with the License. You  may  obtain  a copy of
- * the License at http://www.openbravo.com/legal/license.html 
- * Software distributed under the License  is  distributed  on  an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific  language  governing  rights  and  limitations

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to