1 19 20 package org.openbravo.erpCommon.ad_reports; 21 22 import org.openbravo.erpCommon.utility.ToolBar; 23 24 import org.openbravo.erpCommon.utility.*; 25 import org.openbravo.erpCommon.businessUtility.WindowTabs; 26 import org.openbravo.erpCommon.businessUtility.Tree; 27 import org.openbravo.erpCommon.businessUtility.TreeData; 28 import org.openbravo.base.secureApp.HttpSecureAppServlet; 29 import org.openbravo.base.secureApp.VariablesSecureApp; 30 import org.openbravo.xmlEngine.XmlDocument; 31 import java.io.*; 32 import java.util.*; 33 import javax.servlet.*; 34 import javax.servlet.http.*; 35 36 import org.openbravo.utils.Replace; 37 import org.openbravo.erpCommon.ad_combos.OrganizationComboData; 38 39 40 import org.openbravo.erpCommon.utility.DateTimeData; 41 42 public class ReportInvoiceVendorDimensionalAnalysesJR extends HttpSecureAppServlet { 43 44 45 public void doPost (HttpServletRequest request, HttpServletResponse response) throws IOException,ServletException { 46 VariablesSecureApp vars = new VariablesSecureApp(request); 47 48 if (!Utility.hasProcessAccess(this, vars, "", "ReportInvoiceVendorDimensionalAnalysesJR")) { 49 bdError(response, "AccessTableNoView", vars.getLanguage()); 50 return; 51 } 52 53 if (vars.commandIn("DEFAULT", "DEFAULT_COMPARATIVE")){ 54 String strDateFrom = vars.getGlobalVariable("inpDateFrom", "ReportInvoiceVendorDimensionalAnalysesJR|dateFrom", ""); 55 String strDateTo = vars.getGlobalVariable("inpDateTo", "ReportInvoiceVendorDimensionalAnalysesJR|dateTo", ""); 56 String strDateFromRef = vars.getGlobalVariable("inpDateFromRef", "ReportInvoiceVendorDimensionalAnalysesJR|dateFromRef", ""); 57 String strDateToRef = vars.getGlobalVariable("inpDateToRef", "ReportInvoiceVendorDimensionalAnalysesJR|dateToRef", ""); 58 String strPartnerGroup = vars.getGlobalVariable("inpPartnerGroup", "ReportInvoiceVendorDimensionalAnalysesJR|partnerGroup", ""); 59 String strcBpartnerId = vars.getInGlobalVariable("inpcBPartnerId_IN", "ReportInvoiceVendorDimensionalAnalysesJR|partner", ""); 60 String strProductCategory = vars.getGlobalVariable("inpProductCategory", "ReportInvoiceVendorDimensionalAnalysesJR|productCategory", ""); 61 String strmProductId = vars.getInGlobalVariable("inpmProductId_IN", "ReportInvoiceVendorDimensionalAnalysesJR|product", ""); 62 String strNotShown = vars.getInGlobalVariable("inpNotShown", "ReportInvoiceVendorDimensionalAnalysesJR|notShown", ""); 63 String strShown = vars.getInGlobalVariable("inpShown", "ReportInvoiceVendorDimensionalAnalysesJR|shown", ""); 64 String strOrg = vars.getGlobalVariable("inpOrg", "ReportInvoiceVendorDimensionalAnalysesJR|Org", "0"); 65 String strOrder = vars.getGlobalVariable("inpOrder","ReportInvoiceVendorDimensionalAnalysesJR|order","Normal"); 66 String strMayor = vars.getGlobalVariable("inpMayor", "ReportInvoiceVendorDimensionalAnalysesJR|mayor", ""); 67 String strMenor = vars.getGlobalVariable("inpMenor", "ReportInvoiceVendorDimensionalAnalysesJR|menor", ""); 68 String strProducttype = vars.getGlobalVariable("inpProducttype", "ReportInvoiceVendorDimensionalAnalysesJR|producttype", ""); 69 String strComparative = ""; 70 if (vars.commandIn("DEFAULT_COMPARATIVE")) strComparative = vars.getRequestGlobalVariable("inpComparative", "ReportInvoiceVendorDimensionalAnalysesJR|comparative"); 71 else strComparative = vars.getGlobalVariable("inpComparative", "ReportInvoiceVendorDimensionalAnalysesJR|comparative", "N"); 72 printPageDataSheet(response, vars, strComparative, strDateFrom, strDateTo, strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strNotShown, strShown, strDateFromRef, strDateToRef, strOrg, strOrder, strMayor, strMenor, strProducttype); 73 }else if (vars.commandIn("EDIT_HTML", "EDIT_HTML_COMPARATIVE")) { 74 String strDateFrom = vars.getRequestGlobalVariable("inpDateFrom", "ReportInvoiceVendorDimensionalAnalysesJR|dateFrom"); 75 String strDateTo = vars.getRequestGlobalVariable("inpDateTo", "ReportInvoiceVendorDimensionalAnalysesJR|dateTo"); 76 String strDateFromRef = vars.getRequestGlobalVariable("inpDateFromRef", "ReportInvoiceVendorDimensionalAnalysesJR|dateFromRef"); 77 String strDateToRef = vars.getRequestGlobalVariable("inpDateToRef", "ReportSInvoiceVendorDimensionalAnalysesJR|dateToRef"); 78 String strPartnerGroup = vars.getRequestGlobalVariable("inpPartnerGroup", "ReportInvoiceVendorDimensionalAnalysesJR|partnerGroup"); 79 String strcBpartnerId = vars.getRequestInGlobalVariable("inpcBPartnerId_IN", "ReportInvoiceVendorDimensionalAnalysesJR|partner"); 80 String strProductCategory = vars.getRequestGlobalVariable("inpProductCategory", "ReportInvoiceVendorDimensionalAnalysesJR|productCategory"); 81 String strmProductId = vars.getRequestInGlobalVariable("inpmProductId_IN", "ReportInvoiceVendorDimensionalAnalysesJR|product"); 82 String strNotShown = vars.getInStringParameter("inpNotShown"); 83 String strShown = vars.getInStringParameter("inpShown"); 84 String strOrg = vars.getGlobalVariable("inpOrg", "ReportInvoiceVendorDimensionalAnalysesJR|Org", "0"); 85 String strOrder = vars.getRequestGlobalVariable("inpOrder","ReportInvoiceVendorDimensionalAnalysesJR|order"); 86 String strMayor = vars.getStringParameter("inpMayor", ""); 87 String strMenor = vars.getStringParameter("inpMenor", ""); 88 String strProducttype = vars.getRequestGlobalVariable("inpProducttype", "ReportInvoiceVendorDimensionalAnalysesJR|producttype"); 89 String strComparative = vars.getStringParameter("inpComparative", "N"); 90 printPageHtml(response, vars, strComparative, strDateFrom, strDateTo, strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strNotShown, strShown, strDateFromRef, strDateToRef, strOrg, strOrder, strMayor, strMenor, strProducttype, "html"); 91 }else if (vars.commandIn("EDIT_PDF", "EDIT_PDF_COMPARATIVE")) { 92 String strDateFrom = vars.getRequestGlobalVariable("inpDateFrom", "ReportInvoiceVendorDimensionalAnalysesJR|dateFrom"); 93 String strDateTo = vars.getRequestGlobalVariable("inpDateTo", "ReportInvoiceVendorDimensionalAnalysesJR|dateTo"); 94 String strDateFromRef = vars.getRequestGlobalVariable("inpDateFromRef", "ReportInvoiceVendorDimensionalAnalysesJR|dateFromRef"); 95 String strDateToRef = vars.getRequestGlobalVariable("inpDateToRef", "ReportSInvoiceVendorDimensionalAnalysesJR|dateToRef"); 96 String strPartnerGroup = vars.getRequestGlobalVariable("inpPartnerGroup", "ReportInvoiceVendorDimensionalAnalysesJR|partnerGroup"); 97 String strcBpartnerId = vars.getRequestInGlobalVariable("inpcBPartnerId_IN", "ReportInvoiceVendorDimensionalAnalysesJR|partner"); 98 String strProductCategory = vars.getRequestGlobalVariable("inpProductCategory", "ReportInvoiceVendorDimensionalAnalysesJR|productCategory"); 99 String strmProductId = vars.getRequestInGlobalVariable("inpmProductId_IN", "ReportInvoiceVendorDimensionalAnalysesJR|product"); 100 String strNotShown = vars.getInStringParameter("inpNotShown"); 101 String strShown = vars.getInStringParameter("inpShown"); 102 String strOrg = vars.getGlobalVariable("inpOrg", "ReportInvoiceVendorDimensionalAnalysesJR|Org", "0"); 103 String strOrder = vars.getRequestGlobalVariable("inpOrder","ReportInvoiceVendorDimensionalAnalysesJR|order"); 104 String strMayor = vars.getStringParameter("inpMayor", ""); 105 String strMenor = vars.getStringParameter("inpMenor", ""); 106 String strProducttype = vars.getRequestGlobalVariable("inpProducttype", "ReportInvoiceVendorDimensionalAnalysesJR|producttype"); 107 String strComparative = vars.getStringParameter("inpComparative", "N"); 108 printPageHtml(response, vars, strComparative, strDateFrom, strDateTo, strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strNotShown, strShown, strDateFromRef, strDateToRef, strOrg, strOrder, strMayor, strMenor, strProducttype, "pdf"); 109 } else pageErrorPopUp(response); 110 } 111 112 void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars, String strComparative, String strDateFrom, String strDateTo, String strPartnerGroup, String strcBpartnerId, String strProductCategory, String strmProductId, String strNotShown, String strShown, String strDateFromRef, String strDateToRef, String strOrg, String strOrder, String strMayor, String strMenor, String strProducttype) throws IOException, ServletException { 113 if (log4j.isDebugEnabled()) log4j.debug("Output: dataSheet"); 114 String discard[]={"selEliminarHeader1"}; 115 if (strComparative.equals("Y")) { 116 discard[0] = "selEliminarHeader2"; 117 } 118 XmlDocument xmlDocument=null; 119 xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesFilterJR", discard).createXmlDocument(); 120 121 ToolBar toolbar = new ToolBar(this, vars.getLanguage(), "ReportInvoiceVendorDimensionalAnalysesFilterJR", false, "", "", "",false, "ad_reports", strReplaceWith, false, true); 122 toolbar.prepareSimpleToolBarTemplate(); 123 xmlDocument.setParameter("toolbar", toolbar.toString()); 124 125 try { 126 KeyMap key = new KeyMap(this, vars, "ReportInvoiceVendorDimensionalAnalysesFilterJR.html"); 127 xmlDocument.setParameter("keyMap", key.getReportKeyMaps()); 128 } catch (Exception ex) { 129 throw new ServletException(ex); 130 } 131 try { 132 WindowTabs tabs = new WindowTabs(this, vars, "org.openbravo.erpCommon.ad_reports.ReportInvoiceVendorDimensionalAnalysesJR"); 133 xmlDocument.setParameter("parentTabContainer", tabs.parentTabs()); 134 xmlDocument.setParameter("mainTabContainer", tabs.mainTabs()); 135 xmlDocument.setParameter("childTabContainer", tabs.childTabs()); 136 xmlDocument.setParameter("theme", vars.getTheme()); 137 NavigationBar nav = new NavigationBar(this, vars.getLanguage(), "ReportInvoiceVendorDimensionalAnalysesFilterJR.html", classInfo.id, classInfo.type, strReplaceWith, tabs.breadcrumb()); 138 xmlDocument.setParameter("navigationBar", nav.toString()); 139 LeftTabsBar lBar = new LeftTabsBar(this, vars.getLanguage(), "ReportInvoiceVendorDimensionalAnalysesFilterJR.html", strReplaceWith); 140 xmlDocument.setParameter("leftTabs", lBar.manualTemplate()); 141 } catch (Exception ex) { 142 throw new ServletException(ex); 143 } 144 { 145 OBError myMessage = vars.getMessage("ReportInvoiceVendorDimensionalAnalysesJR"); 146 vars.removeMessage("ReportInvoiceVendorDimensionalAnalysesJR"); 147 if (myMessage!=null) { 148 xmlDocument.setParameter("messageType", myMessage.getType()); 149 xmlDocument.setParameter("messageTitle", myMessage.getTitle()); 150 xmlDocument.setParameter("messageMessage", myMessage.getMessage()); 151 } 152 } 153 154 xmlDocument.setParameter("calendar", vars.getLanguage().substring(0,2)); 155 xmlDocument.setParameter("language", "LNG_POR_DEFECTO=\"" + vars.getLanguage() + "\";"); 156 xmlDocument.setParameter("direction", "var baseDirection = \"" + strReplaceWith + "/\";\n"); 157 xmlDocument.setParameter("dateFrom", strDateFrom); 158 xmlDocument.setParameter("dateFromdisplayFormat", vars.getSessionValue("#AD_SqlDateFormat")); 159 xmlDocument.setParameter("dateFromsaveFormat", vars.getSessionValue("#AD_SqlDateFormat")); 160 xmlDocument.setParameter("dateTo", strDateTo); 161 xmlDocument.setParameter("dateTodisplayFormat", vars.getSessionValue("#AD_SqlDateFormat")); 162 xmlDocument.setParameter("dateTosaveFormat", vars.getSessionValue("#AD_SqlDateFormat")); 163 xmlDocument.setParameter("dateFromRef", strDateFromRef); 164 xmlDocument.setParameter("dateFromRefdisplayFormat", vars.getSessionValue("#AD_SqlDateFormat")); 165 xmlDocument.setParameter("dateFromRefsaveFormat", vars.getSessionValue("#AD_SqlDateFormat")); 166 xmlDocument.setParameter("dateToRef", strDateToRef); 167 xmlDocument.setParameter("dateToRefdisplayFormat", vars.getSessionValue("#AD_SqlDateFormat")); 168 xmlDocument.setParameter("dateToRefsaveFormat", vars.getSessionValue("#AD_SqlDateFormat")); 169 173 xmlDocument.setParameter("cBpGroupId", strPartnerGroup); 174 xmlDocument.setParameter("mProductCategoryId", strProductCategory); 175 xmlDocument.setParameter("adOrgId", strOrg); 176 xmlDocument.setParameter("normal", strOrder); 177 xmlDocument.setParameter("amountasc", strOrder); 178 xmlDocument.setParameter("amountdesc", strOrder); 179 xmlDocument.setParameter("mayor", strMayor); 180 xmlDocument.setParameter("menor", strMenor); 181 xmlDocument.setParameter("producttype", strProducttype); 182 xmlDocument.setParameter("comparative", strComparative); 183 try { 184 ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "C_BP_Group_ID", "", "", Utility.getContext(this, vars, "#User_Org", "ReportInvoiceVendorDimensionalAnalysesJR"), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceVendorDimensionalAnalysesJR"), 0); 185 Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportInvoiceVendorDimensionalAnalysesJR", strPartnerGroup); 186 xmlDocument.setData("reportC_BP_GROUPID","liststructure", comboTableData.select(false)); 187 comboTableData = null; 188 } catch (Exception ex) { 189 throw new ServletException(ex); 190 } 191 192 193 try { 194 ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "M_Product_Category_ID", "", "", Utility.getContext(this, vars, "#User_Org", "ReportInvoiceVendorDimensionalAnalysesJR"), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceVendorDimensionalAnalysesJR"), 0); 195 Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportInvoiceVendorDimensionalAnalysesJR", strProductCategory); 196 xmlDocument.setData("reportM_PRODUCT_CATEGORYID","liststructure", comboTableData.select(false)); 197 comboTableData = null; 198 } catch (Exception ex) { 199 throw new ServletException(ex); 200 } 201 202 xmlDocument.setData("reportAD_ORGID", "liststructure", OrganizationComboData.selectCombo(this, vars.getRole())); 203 xmlDocument.setData("reportCBPartnerId_IN", "liststructure", ReportInvoiceVendorDimensionalAnalysesJRData.selectBpartner(this, Utility.getContext(this, vars, "#User_Org", ""), Utility.getContext(this, vars, "#User_Client", ""), strcBpartnerId)); 204 xmlDocument.setData("reportMProductId_IN", "liststructure", ReportInvoiceVendorDimensionalAnalysesJRData.selectMproduct(this, Utility.getContext(this, vars, "#User_Org", ""), Utility.getContext(this, vars, "#User_Client", ""), strmProductId)); 205 try { 206 ComboTableData comboTableData = new ComboTableData(vars, this, "LIST", "", "M_Product_ProductType", "", Utility.getContext(this, vars, "#User_Org", "ReportInvoiceVendorDimensionalAnalysesJRData"), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceVendorDimensionalAnalysesJRData"), 0); 207 Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportInvoiceVendorDimensionalAnalysesJRData", ""); 208 xmlDocument.setData("reportProductType","liststructure", comboTableData.select(false)); 209 comboTableData = null; 210 } catch (Exception ex) { 211 throw new ServletException(ex); 212 } 213 214 215 if (vars.getLanguage().equals("en_US")) { 216 xmlDocument.setData("structure1", ReportInvoiceVendorDimensionalAnalysesJRData.selectNotShown(this, strShown)); 217 xmlDocument.setData("structure2", strShown.equals("")?new ReportInvoiceVendorDimensionalAnalysesJRData[0]:ReportInvoiceVendorDimensionalAnalysesJRData.selectShown(this, strShown)); 218 } else { 219 xmlDocument.setData("structure1", ReportInvoiceVendorDimensionalAnalysesJRData.selectNotShownTrl(this, vars.getLanguage(), strShown)); 220 xmlDocument.setData("structure2", strShown.equals("")?new ReportInvoiceVendorDimensionalAnalysesJRData[0]:ReportInvoiceVendorDimensionalAnalysesJRData.selectShownTrl(this, vars.getLanguage(), strShown)); 221 } 222 223 response.setContentType("text/html; charset=UTF-8"); 224 PrintWriter out = response.getWriter(); 225 out.println(xmlDocument.print()); 226 out.close(); 227 } 228 229 void printPageHtml(HttpServletResponse response, VariablesSecureApp vars, String strComparative, String strDateFrom, String strDateTo, String strPartnerGroup, String strcBpartnerId, String strProductCategory, String strmProductId, String strNotShown, String strShown, String strDateFromRef, String strDateToRef, String strOrg, String strOrder, String strMayor, String strMenor, String strProducttype, String strOutput) throws IOException, ServletException{ 230 if (log4j.isDebugEnabled()) log4j.debug("Output: print html"); 231 String strOrderby = ""; 232 String [] discard = {"", "", "", "", ""}; 233 String [] discard1={"selEliminarBody1", "discard", "discard", "discard", "discard", "discard", "discard", "discard", "discard", "discard", "discard", "discard", "discard", "discard", "discard", "discard", "discard", "discard", "discard", "discard", "discard"}; 234 if (strComparative.equals("Y")) discard1[0] = "selEliminarBody2"; 235 String strTitle = ""; 236 strTitle = Utility.messageBD(this, "From", vars.getLanguage()) + " "+strDateFrom+" " + Utility.messageBD(this, "To", vars.getLanguage()) + " "+strDateTo; 237 if (!strPartnerGroup.equals("")) strTitle = strTitle + ", " + Utility.messageBD(this, "ForBPartnerGroup", vars.getLanguage()) + " "+ReportInvoiceVendorDimensionalAnalysesJRData.selectBpgroup(this, strPartnerGroup); 238 if (!strProductCategory.equals("")) strTitle = strTitle+" " + Utility.messageBD(this, "And", vars.getLanguage()) + " " + Utility.messageBD(this, "ProductCategory", vars.getLanguage()) + " "+ReportInvoiceVendorDimensionalAnalysesJRData.selectProductCategory(this, strProductCategory); 239 240 241 ReportInvoiceVendorDimensionalAnalysesJRData[] data = null; 242 String [] strShownArray = {"", "", "", "", ""}; 243 if (strShown.startsWith("(")) strShown = strShown.substring(1, strShown.length()-1); 244 if (!strShown.equals("")) { 245 strShown = Replace.replace(strShown, "'", ""); 246 strShown = Replace.replace(strShown, " ", ""); 247 StringTokenizer st = new StringTokenizer(strShown, ",", false); 248 int intContador = 0; 249 while (st.hasMoreTokens()){ 250 strShownArray[intContador] = st.nextToken(); 251 intContador++; 252 } 253 254 } 255 ReportInvoiceVendorDimensionalAnalysesJRData[] dimensionLabel = null; 256 if (vars.getLanguage().equals("en_US")) { 257 dimensionLabel = ReportInvoiceVendorDimensionalAnalysesJRData.selectNotShown(this, ""); 258 } else { 259 dimensionLabel = ReportInvoiceVendorDimensionalAnalysesJRData.selectNotShownTrl(this, vars.getLanguage(), ""); 260 } 261 String [] strTextShow = {"", "", "", "", ""}; 262 String [] strLevelLabel = {"", "", "", "", ""}; 263 int intDiscard = 0; 264 int intProductLevel = 6; 265 int intAuxDiscard = -1; 266 for (int i = 0; i<5; i++){ 267 if (strShownArray[i].equals("1")) { 268 strTextShow[i] = "C_BP_GROUP.NAME"; 269 intDiscard++; 270 strLevelLabel[i] = dimensionLabel[0].name; 271 } 272 else if (strShownArray[i].equals("2")) { 273 strTextShow[i] = "AD_COLUMN_IDENTIFIER(to_char('C_Bpartner'), to_char( C_BPARTNER.C_BPARTNER_ID), to_char( 'es_ES'))"; 274 intDiscard++; 275 strLevelLabel[i] = dimensionLabel[1].name; 276 } 277 else if (strShownArray[i].equals("3")) { 278 strTextShow[i] = "M_PRODUCT_CATEGORY.NAME"; 279 intDiscard++; 280 strLevelLabel[i] = dimensionLabel[2].name; 281 } 282 else if (strShownArray[i].equals("4")) { 283 strTextShow[i] = "AD_COLUMN_IDENTIFIER(to_char('M_Product'), to_char( M_PRODUCT.M_PRODUCT_ID), to_char( 'es_ES'))"; 284 intAuxDiscard = i; 285 intDiscard++; 286 intProductLevel = i+1; 287 strLevelLabel[i] = dimensionLabel[3].name; 288 } 289 else if (strShownArray[i].equals("5")) { 290 strTextShow[i] = "M_INOUT.DOCUMENTNO"; 291 intDiscard++; 292 strLevelLabel[i] = dimensionLabel[4].name; 293 } 294 else { 295 strTextShow[i] = "''"; 296 discard[i] = "display:none;"; 297 } 298 } 299 if (intDiscard != 0 || intAuxDiscard != -1){ 300 int k=1; 301 strOrderby = " ORDER BY NIVEL"+k+","; 302 while (k<intDiscard){ 303 strOrderby = strOrderby+"NIVEL"+k+","; 304 k++; 305 } 306 if (k==1){ 307 if (strOrder.equals("Normal")){ 308 strOrderby = " ORDER BY NIVEL"+k; 309 } else if (strOrder.equals("Amountasc")){ 310 strOrderby = " ORDER BY LINENETAMT ASC"; 311 } else if (strOrder.equals("Amountdesc")){ 312 strOrderby = " ORDER BY LINENETAMT DESC"; 313 } else{ 314 strOrderby = "1"; 315 } 316 } else{ 317 if (strOrder.equals("Normal")){ 318 strOrderby += "NIVEL"+k; 319 } else if (strOrder.equals("Amountasc")){ 320 strOrderby += "LINENETAMT ASC"; 321 } else if (strOrder.equals("Amountdesc")){ 322 strOrderby += "LINENETAMT DESC"; 323 } else{ 324 strOrderby = "1"; 325 } 326 } 327 328 } else{ 329 strOrderby = " ORDER BY 1"; 330 } 331 String strHaving = ""; 332 if (!strMayor.equals("") && !strMenor.equals("")) {strHaving = " HAVING SUM(LINENETAMT) > "+strMayor+" AND SUM(LINENETAMT) < "+strMenor;} 333 else if (!strMayor.equals("") && strMenor.equals("")) {strHaving = " HAVING SUM(LINENETAMT) > "+strMayor;} 334 else if (strMayor.equals("") && !strMenor.equals("")) {strHaving = " HAVING SUM(LINENETAMT) < "+strMenor;} 335 else{ strHaving = " HAVING SUM(LINENETAMT) <> 0 OR SUM(LINENETREF) <> 0";} 336 strOrderby = strHaving + strOrderby; 337 String strReportPath = ""; 338 if (strComparative.equals("Y")){ 339 strReportPath = "@basedesign@/org/openbravo/erpCommon/ad_reports/SimpleDimensionalComparative.jrxml"; 340 data = ReportInvoiceVendorDimensionalAnalysesJRData.select(this, strTextShow[0], strTextShow[1], strTextShow[2], strTextShow[3], strTextShow[4], Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceVendorDimensionalAnalysesJR"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo,"1"), strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strProducttype, strDateFromRef, DateTimeData.nDaysAfter(this, strDateToRef,"1"), strOrderby); 341 } else { 342 strReportPath = "@basedesign@/org/openbravo/erpCommon/ad_reports/SimpleDimensionalNoComparative.jrxml"; 343 data = ReportInvoiceVendorDimensionalAnalysesJRData.selectNoComparative(this, strTextShow[0], strTextShow[1], strTextShow[2], strTextShow[3], strTextShow[4], Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceVendorDimensionalAnalysesJR"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo,"1"), strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strProducttype, strOrderby); 344 } 345 if (data.length == 0 || data == null){ 346 data = ReportInvoiceVendorDimensionalAnalysesJRData.set(); 347 } 348 349 HashMap<String , Object > parameters = new HashMap<String , Object >(); 350 parameters.put("LEVEL1_LABEL", strLevelLabel[0]); 351 parameters.put("LEVEL2_LABEL", strLevelLabel[1]); 352 parameters.put("LEVEL3_LABEL", strLevelLabel[2]); 353 parameters.put("LEVEL4_LABEL", strLevelLabel[3]); 354 parameters.put("LEVEL5_LABEL", strLevelLabel[4]); 355 parameters.put("DIMENSIONS", new Integer (intDiscard)); 356 parameters.put("REPORT_TITLE", classInfo.name); 357 parameters.put("REPORT_SUBTITLE", strTitle); 358 parameters.put("PRODUCT_LEVEL", new Integer (intProductLevel)); 359 renderJR(vars, response, strReportPath, strOutput, parameters, data, null ); 360 } 361 362 373 374 public String getServletInfo() { 375 return "Servlet ReportInvoiceVendorDimensionalAnalysesJR. This Servlet was made by Jon AlegrÃa"; 376 } } 378 379 | Popular Tags |