details:   /erp/devel/pi/rev/8f25c4e19a64
changeset: 6977:8f25c4e19a64
user:      Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo.com>
date:      Mon Apr 12 16:01:38 2010 +0530
summary:   Code re-factoring for issue #12454 and #12387:

diffstat:

 src-db/database/model/triggers/MA_PL_EMPLOYEE_TRG.xml                       |  
 4 +-
 src-db/database/model/triggers/MA_PL_IC_TRG.xml                             |  
 4 +-
 src-db/database/model/triggers/MA_PL_INVOICELINE_TRG.xml                    |  
 4 +-
 src-db/database/model/triggers/MA_PL_MACHINE_TRG.xml                        |  
 4 +-
 src-db/database/model/triggers/MA_TOOLSETUSED_TRG.xml                       |  
 4 +-
 src/org/openbravo/erpCommon/ad_reports/ReportWorkRequirementDaily.java      |  
16 +++------
 src/org/openbravo/erpCommon/ad_reports/ReportWorkRequirementDaily_data.xsql |  
12 -------
 src/org/openbravo/erpCommon/ad_reports/SubreportWorkRequirementDaily.jrxml  |  
 2 +-
 8 files changed, 16 insertions(+), 34 deletions(-)

diffs (179 lines):

diff -r 26d7079c342c -r 8f25c4e19a64 
src-db/database/model/triggers/MA_PL_EMPLOYEE_TRG.xml
--- a/src-db/database/model/triggers/MA_PL_EMPLOYEE_TRG.xml     Mon Apr 12 
14:12:19 2010 +0530
+++ b/src-db/database/model/triggers/MA_PL_EMPLOYEE_TRG.xml     Mon Apr 12 
16:01:38 2010 +0530
@@ -45,7 +45,7 @@
     OR Posted='Y') ;
   IF (v_RO > 0) THEN
     IF (DELETING OR INSERTING) THEN
-      RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+      RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
     END IF;
     IF (UPDATING) THEN
       IF (:new.AD_CLIENT_ID <> :old.AD_CLIENT_ID
@@ -55,7 +55,7 @@
          OR :new.C_SALARY_CATEGORY_ID <> :old.C_SALARY_CATEGORY_ID
          OR :new.QUANTITY <> :old.QUANTITY
         ) THEN
-        RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+        RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
       END IF;
     END IF;
   END IF;
diff -r 26d7079c342c -r 8f25c4e19a64 
src-db/database/model/triggers/MA_PL_IC_TRG.xml
--- a/src-db/database/model/triggers/MA_PL_IC_TRG.xml   Mon Apr 12 14:12:19 
2010 +0530
+++ b/src-db/database/model/triggers/MA_PL_IC_TRG.xml   Mon Apr 12 16:01:38 
2010 +0530
@@ -45,7 +45,7 @@
     OR Posted='Y') ;
   IF (v_RO > 0) THEN
     IF (DELETING OR INSERTING) THEN
-      RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+      RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
     END IF;
     IF (UPDATING) THEN
       IF (:new.AD_CLIENT_ID <> :old.AD_CLIENT_ID
@@ -54,7 +54,7 @@
          OR :new.ISACTIVE <> :old.ISACTIVE
          OR :new.MA_INDIRECT_COST_ID <> :old.MA_INDIRECT_COST_ID
         ) THEN
-        RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+        RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
       END IF;
     END IF;
   END IF;
diff -r 26d7079c342c -r 8f25c4e19a64 
src-db/database/model/triggers/MA_PL_INVOICELINE_TRG.xml
--- a/src-db/database/model/triggers/MA_PL_INVOICELINE_TRG.xml  Mon Apr 12 
14:12:19 2010 +0530
+++ b/src-db/database/model/triggers/MA_PL_INVOICELINE_TRG.xml  Mon Apr 12 
16:01:38 2010 +0530
@@ -45,7 +45,7 @@
     OR Posted='Y') ;
   IF (v_RO > 0) THEN
     IF (DELETING OR INSERTING) THEN
-      RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+      RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
     END IF;
     IF (UPDATING) THEN
       IF (:new.AD_CLIENT_ID <> :old.AD_CLIENT_ID
@@ -56,7 +56,7 @@
          OR :new.C_INVOICELINE_ID IS NULL
          OR :new.COST <> :old.COST
         ) THEN
-        RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+        RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
       END IF;
     END IF;
   END IF;
diff -r 26d7079c342c -r 8f25c4e19a64 
src-db/database/model/triggers/MA_PL_MACHINE_TRG.xml
--- a/src-db/database/model/triggers/MA_PL_MACHINE_TRG.xml      Mon Apr 12 
14:12:19 2010 +0530
+++ b/src-db/database/model/triggers/MA_PL_MACHINE_TRG.xml      Mon Apr 12 
16:01:38 2010 +0530
@@ -45,7 +45,7 @@
     OR Posted='Y') ;
   IF (v_RO > 0) THEN
     IF (DELETING OR INSERTING) THEN
-      RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+      RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
     END IF;
     IF (UPDATING) THEN
       IF (:new.AD_CLIENT_ID <> :old.AD_CLIENT_ID
@@ -55,7 +55,7 @@
          OR :new.MA_MACHINE_ID <> :old.MA_MACHINE_ID
          OR :new.USE <> :old.USE
         ) THEN
-        RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+        RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
       END IF;
     END IF;
   END IF;
diff -r 26d7079c342c -r 8f25c4e19a64 
src-db/database/model/triggers/MA_TOOLSETUSED_TRG.xml
--- a/src-db/database/model/triggers/MA_TOOLSETUSED_TRG.xml     Mon Apr 12 
14:12:19 2010 +0530
+++ b/src-db/database/model/triggers/MA_TOOLSETUSED_TRG.xml     Mon Apr 12 
16:01:38 2010 +0530
@@ -45,7 +45,7 @@
     OR Posted='Y') ;
   IF (v_RO > 0) THEN
     IF (DELETING OR INSERTING) THEN
-      RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+      RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
     END IF;
     IF (UPDATING) THEN
       IF (:new.AD_CLIENT_ID <> :old.AD_CLIENT_ID
@@ -55,7 +55,7 @@
          OR :new.MA_TOOLSET_ID <> :old.MA_TOOLSET_ID
          OR :new.USED <> :old.USED
         ) THEN
-        RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+        RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
       END IF;
     END IF;
   END IF;
diff -r 26d7079c342c -r 8f25c4e19a64 
src/org/openbravo/erpCommon/ad_reports/ReportWorkRequirementDaily.java
--- a/src/org/openbravo/erpCommon/ad_reports/ReportWorkRequirementDaily.java    
Mon Apr 12 14:12:19 2010 +0530
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportWorkRequirementDaily.java    
Mon Apr 12 16:01:38 2010 +0530
@@ -27,10 +27,7 @@
 import javax.servlet.http.HttpServletResponse;
 
 import net.sf.jasperreports.engine.JRException;
-import net.sf.jasperreports.engine.JasperCompileManager;
 import net.sf.jasperreports.engine.JasperReport;
-import net.sf.jasperreports.engine.design.JasperDesign;
-import net.sf.jasperreports.engine.xml.JRXmlLoader;
 
 import org.openbravo.base.secureApp.HttpSecureAppServlet;
 import org.openbravo.base.secureApp.VariablesSecureApp;
@@ -93,9 +90,6 @@
         "#AccessibleOrgTree", "ReportWorkRequirementDaily"), strStartDateFrom, 
strStartDateTo,
         strmaProcessPlan);
     for (int i = 0; i < data.length; i++) {
-      // ReportWorkRequirementDailyData[] product = 
ReportWorkRequirementDailyData.producedproduct(
-      // this, data[i].wrpid);
-      // data[i].prodproduct = product[0].name;
       String strqty = ReportWorkRequirementDailyData.inprocess(this, 
data[i].wrid,
           data[i].productid);
       data[i].inprocess = strqty;
@@ -108,12 +102,12 @@
     String strBaseDesign = getBaseDesignPath(strLanguage);
     JasperReport jasperReportProducts;
     try {
-      JasperDesign jasperDesignProducts = JRXmlLoader.load(strBaseDesign
-          + 
"/org/openbravo/erpCommon/ad_reports/SubreportWorkRequirementDaily.jrxml");
-      jasperReportProducts = 
JasperCompileManager.compileReport(jasperDesignProducts);
+      jasperReportProducts = Utility.getTranslatedJasperReport(this, 
strBaseDesign
+          + 
"/org/openbravo/erpCommon/ad_reports/SubreportWorkRequirementDaily.jrxml", vars
+          .getLanguage(), strBaseDesign);
     } catch (JRException e) {
-      e.printStackTrace();
-      throw new ServletException(e.getMessage());
+      log4j.error("Could not load/compile jrxml-file", e);
+      throw new ServletException(e);
     }
 
     String strReportName = 
"@basedesign@/org/openbravo/erpCommon/ad_reports/ReportWorkRequirementDailyEdit.jrxml";
diff -r 26d7079c342c -r 8f25c4e19a64 
src/org/openbravo/erpCommon/ad_reports/ReportWorkRequirementDaily_data.xsql
--- 
a/src/org/openbravo/erpCommon/ad_reports/ReportWorkRequirementDaily_data.xsql   
    Mon Apr 12 14:12:19 2010 +0530
+++ 
b/src/org/openbravo/erpCommon/ad_reports/ReportWorkRequirementDaily_data.xsql   
    Mon Apr 12 16:01:38 2010 +0530
@@ -84,16 +84,4 @@
         <Parameter name="wrid"/>
         <Parameter name="wrppproduct"/>
   </SqlMethod>
-  <SqlMethod name="producedproduct" type="preparedStatement" return="multiple" 
default="">
-      <SqlMethodComment></SqlMethodComment>
-      <Sql>
-        <![CDATA[
-          SELECT p.name
-          FROM M_Product p, MA_WRPhaseProduct w
-          WHERE w.MA_WRPHASE_ID = ?
-          AND p.M_Product_ID = w.M_Product_ID
-          AND w.PRODUCTIONTYPE = '+'
-        ]]></Sql>
-        <Parameter name="wrpid"/>
-  </SqlMethod>
 </SqlClass>
diff -r 26d7079c342c -r 8f25c4e19a64 
src/org/openbravo/erpCommon/ad_reports/SubreportWorkRequirementDaily.jrxml
--- 
a/src/org/openbravo/erpCommon/ad_reports/SubreportWorkRequirementDaily.jrxml    
    Mon Apr 12 14:12:19 2010 +0530
+++ 
b/src/org/openbravo/erpCommon/ad_reports/SubreportWorkRequirementDaily.jrxml    
    Mon Apr 12 16:01:38 2010 +0530
@@ -31,7 +31,7 @@
     <parameter name="LOCALE" isForPrompting="false" class="java.util.Locale"/>
     <queryString><![CDATA[SELECT M_PRODUCT.NAME AS PRODUCT_NAME, 
MA_WRPHASEPRODUCT.MOVEMENTQTY
 FROM M_PRODUCT, MA_WRPHASEPRODUCT
-WHERE MA_WRPHASEPRODUCT.MA_WRPHASE_ID IN ('$P!{WRPID}')
+WHERE MA_WRPHASEPRODUCT.MA_WRPHASE_ID = '$P!{WRPID}'
 AND M_PRODUCT.M_PRODUCT_ID = MA_WRPHASEPRODUCT.M_PRODUCT_ID
 AND MA_WRPHASEPRODUCT.PRODUCTIONTYPE = '+']]></queryString>
 

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to