Fixes Issue 12743: bracket and format issue has been fixed
authorSathiyan Sivaprakasam <sathiyan.sivaprakasam@openbravo.com>
Fri, 23 Apr 2010 17:46:46 +0530
changeset 7135 8dc35f2ddcca
parent 7134 174274efc18c
child 7136 72a9865d5f18
Fixes Issue 12743: bracket and format issue has been fixed
src/org/openbravo/erpCommon/ad_reports/ReportAnnualCertification.html
src/org/openbravo/erpCommon/ad_reports/ReportAnnualCertification.java
--- a/src/org/openbravo/erpCommon/ad_reports/ReportAnnualCertification.html	Fri Apr 23 13:51:11 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportAnnualCertification.html	Fri Apr 23 17:46:46 2010 +0530
@@ -260,7 +260,7 @@
 			 <tr>
               <td class="TitleCell"><span class="LabelText">Organization</span></td>
               <td class="Combo_ContentCell"> 
-                <select  name="inpOrg" id="inpOrg" class="Combo Combo_OneCell_width" required="false">
+                <select  name="inpOrg" id="inpOrg" class="Combo Combo_TwoCells_width" required="false">
                   <option value=""> <div id="reportAD_ORGID"></div></option>
                 </select></td>
               <td class="ContentCell"></td>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportAnnualCertification.java	Fri Apr 23 13:51:11 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportAnnualCertification.java	Fri Apr 23 17:46:46 2010 +0530
@@ -301,36 +301,37 @@
       advisePopUp(request, response, "WARNING", Utility.messageBD(this, "NoDataFound", vars
           .getLanguage()));
     }
-
-    String sClientID = vars.getUserClient();
-    String sOrganID = "";
-    if (strOrg.equals("")) {
-      for (int i = 0; i < data.length; i++) {
-        sOrganID = sOrganID + "'" + data[i].orgid;
-        if (!(i == data.length - 1)) {
-          sOrganID = sOrganID + "',";
-        } else {
-          sOrganID = sOrganID + "'";
-        }
-      }
-
-    } else {
-      sOrganID = "'" + strOrg + "'";
-    }
-    OrganizationData[] dataOrganization = OrganizationData.select(this, vars.getLanguage(),
-        sClientID, sOrganID);
-
     String strOutput = vars.commandIn("PDF") ? "pdf" : "xls";
     String strReportName = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportAnnualCertification.jrxml";
-    // put address of organization and employer into same data
-    for (int i = 0; i < data.length; i++) {
-      if (dataOrganization != null && dataOrganization.length > 0) {
-        for (int j = 0; j < dataOrganization.length; j++) {
-          if (data[i].orgid.equals(dataOrganization[j].adOrgId)) {
-            data[i].mittente = dataOrganization[j].adClientIdr;
-            data[i].erogante = dataOrganization[j].adClientIdr;
-            data[i].addressorganization = dataOrganization[j].cLocationIdr;
-            break;
+    OrganizationData[] dataOrganization = null;
+    // populate organization data if report data is available.
+    if (data != null && data.length > 0) {
+      String sClientID = vars.getUserClient();
+      String sOrganID = "";
+      if (strOrg.equals("")) {
+        for (int i = 0; i < data.length; i++) {
+          sOrganID = sOrganID + "'" + data[i].orgid;
+          if (!(i == data.length - 1)) {
+            sOrganID = sOrganID + "',";
+          } else {
+            sOrganID = sOrganID + "'";
+          }
+        }
+
+      } else {
+        sOrganID = "'" + strOrg + "'";
+      }
+      dataOrganization = OrganizationData.select(this, vars.getLanguage(), sClientID, sOrganID);
+      // put address of organization and employer into same data
+      for (int i = 0; i < data.length; i++) {
+        if (dataOrganization != null && dataOrganization.length > 0) {
+          for (int j = 0; j < dataOrganization.length; j++) {
+            if (data[i].orgid.equals(dataOrganization[j].adOrgId)) {
+              data[i].mittente = dataOrganization[j].adClientIdr;
+              data[i].erogante = dataOrganization[j].adClientIdr;
+              data[i].addressorganization = dataOrganization[j].cLocationIdr;
+              break;
+            }
           }
         }
       }