Examples of OBError


Examples of org.openbravo.erpCommon.utility.OBError

      xmlDocument.setParameter("leftTabs", lBar.manualTemplate());
    } catch (Exception ex) {
      throw new ServletException(ex);
    }
    {
      OBError myMessage = vars.getMessage("GeneralAccountingReports");
      vars.removeMessage("GeneralAccountingReports");
      if (myMessage != null) {
        xmlDocument.setParameter("messageType", myMessage.getType());
        xmlDocument.setParameter("messageTitle", myMessage.getTitle());
        xmlDocument.setParameter("messageMessage", myMessage.getMessage());
      }
    }

    xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
    xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() + "\";");
View Full Code Here

Examples of org.openbravo.erpCommon.utility.OBError

      xmlDocument.setParameter("leftTabs", lBar.manualTemplate());
    } catch (Exception ex) {
      throw new ServletException(ex);
    }
    {
      OBError myMessage = vars.getMessage("ReportAccountingCountDimensionalAnalyses");
      vars.removeMessage("ReportAccountingCountDimensionalAnalyses");
      if (myMessage != null) {
        xmlDocument.setParameter("messageType", myMessage.getType());
        xmlDocument.setParameter("messageTitle", myMessage.getTitle());
        xmlDocument.setParameter("messageMessage", myMessage.getMessage());
      }
    }

    try {
      ComboTableData comboTableData = new ComboTableData(vars, this, "TABLE", "Account_ID",
View Full Code Here

Examples of org.openbravo.erpCommon.utility.OBError

      xmlDocument.setParameter("leftTabs", lBar.manualTemplate());
    } catch (Exception ex) {
      throw new ServletException(ex);
    }
    {
      OBError myMessage = vars.getMessage("ReportInvoiceCustomerDimensionalAnalysesJR");
      vars.removeMessage("ReportInvoiceCustomerDimensionalAnalysesJR");
      if (myMessage != null) {
        xmlDocument.setParameter("messageType", myMessage.getType());
        xmlDocument.setParameter("messageTitle", myMessage.getTitle());
        xmlDocument.setParameter("messageMessage", myMessage.getMessage());
      }
    }

    xmlDocument.setParameter("calendar", vars.getLanguage().substring(0, 2));
    xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() + "\";");
View Full Code Here

Examples of org.openbravo.erpCommon.utility.OBError

    strOrderby = strHaving + strOrderby;

    // Checks if there is a conversion rate for each of the transactions of
    // the report
    String strConvRateErrorMsg = "";
    OBError myMessage = null;
    myMessage = new OBError();
    String strBaseCurrencyId = Utility.stringBaseCurrencyId(this, vars.getClient());
    if (strComparative.equals("Y")) {
      try {
        data = ReportInvoiceCustomerDimensionalAnalysesJRData.select(this, strCurrencyId,
            strBaseCurrencyId, strTextShow[0], strTextShow[1], strTextShow[2], strTextShow[3],
            strTextShow[4], strTextShow[5], strTextShow[6], strTextShow[7], strTextShow[8],
            strTextShow[9], Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()),
                strOrg), Utility.getContext(this, vars, "#User_Client",
                "ReportInvoiceCustomerDimensionalAnalysesJR"), strDateFrom, DateTimeData
                .nDaysAfter(this, strDateTo, "1"), strPartnerGroup, strcBpartnerId,
            strProductCategory, strmProductId, strsalesrepId, strPartnerSalesrepId, strcProjectId,
            strProducttype, strDateFromRef, DateTimeData.nDaysAfter(this, strDateToRef, "1"),
            strOrderby);
      } catch (ServletException ex) {
        myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
      }
    } else {
      try {
        data = ReportInvoiceCustomerDimensionalAnalysesJRData.selectNoComparative(this,
            strCurrencyId, strBaseCurrencyId, strTextShow[0], strTextShow[1], strTextShow[2],
            strTextShow[3], strTextShow[4], strTextShow[5], strTextShow[6], strTextShow[7],
            strTextShow[8], strTextShow[9], Tree.getMembers(this, TreeData.getTreeOrg(this, vars
                .getClient()), strOrg), Utility.getContext(this, vars, "#User_Client",
                "ReportInvoiceCustomerDimensionalAnalysesJR"), strDateFrom, DateTimeData
                .nDaysAfter(this, strDateTo, "1"), strPartnerGroup, strcBpartnerId,
            strProductCategory, strmProductId, strsalesrepId, strPartnerSalesrepId, strcProjectId,
            strProducttype, strOrderby);
      } catch (ServletException ex) {
        myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
      }
    }
    strConvRateErrorMsg = myMessage.getMessage();
    // If a conversion rate is missing for a certain transaction, an error
    // message window pops-up.
    if (!strConvRateErrorMsg.equals("") && strConvRateErrorMsg != null) {
      advisePopUp(request, response, "ERROR", Utility.messageBD(this, "NoConversionRateHeader",
          vars.getLanguage()), strConvRateErrorMsg);
View Full Code Here

Examples of org.openbravo.erpCommon.utility.OBError

      xmlDocument.setParameter("leftTabs", lBar.manualTemplate());
    } catch (Exception ex) {
      throw new ServletException(ex);
    }
    {
      OBError myMessage = vars.getMessage("ReportCashFlow");
      vars.removeMessage("ReportCashFlow");
      if (myMessage != null) {
        xmlDocument.setParameter("messageType", myMessage.getType());
        xmlDocument.setParameter("messageTitle", myMessage.getTitle());
        xmlDocument.setParameter("messageMessage", myMessage.getMessage());
      }
    }

    response.setContentType("text/html; charset=UTF-8");
    PrintWriter out = response.getWriter();
View Full Code Here

Examples of org.openbravo.erpCommon.utility.OBError

      printPage(response, vars, strBPartner, strOrg, strShipperpath, strPayment, strNewOrg, strTax);
    } else if (vars.commandIn("SAVE")) {
      String strNewOrg = vars.getRequiredStringParameter("inpadOrgIdNew");
      String strTax = vars.getStringParameter("inpcTaxId");
      String strOrder = vars.getRequiredInParameter("inpcOrderId", IsIDFilter.instance);
      OBError myMessage = processSave(vars, strOrder, strNewOrg, strTax);
      vars.setMessage("ChangeOrderOrg", myMessage);
      response.sendRedirect(strDireccion + request.getServletPath());
    } else
      pageErrorPopUp(response);
  }
View Full Code Here

Examples of org.openbravo.erpCommon.utility.OBError

      pageErrorPopUp(response);
  }

  private OBError processSave(VariablesSecureApp vars, String strOrder, String strNewOrg,
      String strTax) {
    OBError myMessage = null;

    if (log4j.isDebugEnabled())
      log4j.debug("Save: ChangeOrderOrg ");

    if (strOrder.equals(""))
      return Utility.translateError(this, vars, vars.getLanguage(), "ProcessRunError");

    Connection conn = null;
    try {
      conn = this.getTransactionConnection();
      if (strOrder.startsWith("("))
        strOrder = strOrder.substring(1, strOrder.length() - 1);
      if (!strOrder.equals("")) {
        strOrder = Replace.replace(strOrder, "'", "");
        StringTokenizer st = new StringTokenizer(strOrder, ",", false);
        while (st.hasMoreTokens()) {
          String strOrderId = st.nextToken();
          String StrDocBaseType = ChangeOrderOrgData.selectDocbasetype(this, strOrderId);
          String StrDocSubTypeSo = ChangeOrderOrgData.selectDocsubtypeso(this, strOrderId);
          String StrDocTypeID = ChangeOrderOrgData.selectDoctypeneworg(this, StrDocBaseType,
              StrDocSubTypeSo, strNewOrg);
          String StrExistsShipment = ChangeOrderOrgData.selectExistsShipment(this, strOrderId);
          if (ChangeOrderOrgData.checkRestrictions(conn, this, strOrderId)) {
            releaseRollbackConnection(conn);
            log4j.warn("The order is incorrect");
            myMessage = new OBError();
            myMessage.setType("Error");
            myMessage.setMessage(Utility.messageBD(this, "ProcessRunError", vars.getLanguage()));
            return myMessage;
          }
          boolean shouldDelete = ChangeOrderOrgData.shouldDeleteCashLine(conn, this, strOrderId);
          ChangeOrderOrgData.resetOrder(conn, this, strOrderId);
          try {
            ChangeOrderOrgData.updateDocAction(conn, this, vars.getUser(), strOrderId);
          } catch (ServletException ex) {
            myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
            releaseRollbackConnection(conn);
            return myMessage;
          }
          String pinstance = SequenceIdData.getUUID();
          try {
            ChangeOrderOrgData.insertPInstance(conn, this, pinstance, "104", strOrderId, vars
                .getUser(), vars.getClient(), vars.getOrg());
          } catch (ServletException ex) {
            myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
            releaseRollbackConnection(conn);
            return myMessage;
          }
          ChangeOrderOrgData.processOrder(conn, this, pinstance);
          try {
            ChangeOrderOrgData.updateLines(conn, this, strTax, vars.getUser(), strNewOrg,
                strOrderId);
            ChangeOrderOrgData.update(conn, this, vars.getUser(), strNewOrg, StrDocTypeID,
                StrDocTypeID, strOrderId);
          } catch (ServletException ex) {
            myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
            releaseRollbackConnection(conn);
            return myMessage;
          }
          if (!StrExistsShipment.equals("0")) {
            int i = 0;
            ChangeOrderOrgData[] shipmentsData = ChangeOrderOrgData
                .selectShipment(this, strOrderId);
            for (i = 0; i < shipmentsData.length; i++) {
              ChangeOrderOrgData.updateProcessed(conn, this, vars.getUser(),
                  shipmentsData[i].mInoutId);
              String StrDocTypeIDShipment = ChangeOrderOrgData
                  .cDocttypeshipment(this, StrDocTypeID);
              String DocumentnoShipment = Utility.getDocumentNo(this, vars, "169", "M_Inout",
                  StrDocTypeIDShipment, StrDocTypeIDShipment, false, true);
              try {
                ChangeOrderOrgData.updateShipment(conn, this, vars.getUser(), DocumentnoShipment,
                    StrDocTypeIDShipment, strNewOrg, shipmentsData[i].mInoutId);
                ChangeOrderOrgData.updateShipmentlines(conn, this, vars.getUser(), strNewOrg,
                    shipmentsData[i].mInoutId);
                ChangeOrderOrgData.updateMtransaction(conn, this, strNewOrg, vars.getUser(),
                    shipmentsData[i].mInoutId);
              } catch (ServletException ex) {
                myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
                releaseRollbackConnection(conn);
                return myMessage;
              }
            }
          }
          /* Pending change org for the invoices related */
          pinstance = SequenceIdData.getUUID();
          try {
            ChangeOrderOrgData.insertPInstance(conn, this, pinstance, "104", strOrderId, vars
                .getUser(), vars.getClient(), vars.getOrg());
          } catch (ServletException ex) {
            myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
            releaseRollbackConnection(conn);
            return myMessage;
          }
          ChangeOrderOrgData.processOrder(conn, this, pinstance);
          try {
            if (shouldDelete)
              ChangeOrderOrgData.deleteCashLine(conn, this, strOrderId);
          } catch (ServletException ex) {
            myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
            releaseRollbackConnection(conn);
            return myMessage;
          }
        }
      }

      releaseCommitConnection(conn);
      myMessage = new OBError();
      myMessage.setType("Success");
      myMessage.setTitle("");
      myMessage.setMessage(Utility.messageBD(this, "Success", vars.getLanguage()));
    } catch (Exception e) {
      try {
        releaseRollbackConnection(conn);
      } catch (Exception ignored) {
      }
View Full Code Here

Examples of org.openbravo.erpCommon.utility.OBError

      xmlDocument.setParameter("leftTabs", lBar.manualTemplate());
    } catch (Exception ex) {
      throw new ServletException(ex);
    }
    {
      OBError myMessage = vars.getMessage("ChangeOrderOrg");
      vars.removeMessage("ChangeOrderOrg");
      if (myMessage != null) {
        xmlDocument.setParameter("messageType", myMessage.getType());
        xmlDocument.setParameter("messageTitle", myMessage.getTitle());
        xmlDocument.setParameter("messageMessage", myMessage.getMessage());
      }
    }

    xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() + "\";");
    xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
View Full Code Here

Examples of org.openbravo.erpCommon.utility.OBError

              strCal1, strCalc2, strOrderBy, "", pgLimit);
        }
      } catch (ServletException e) {
        log4j.error("Error in print page data: " + e);
        e.printStackTrace();
        OBError myError = Utility.translateError(this, vars, vars.getLanguage(), e.getMessage());
        if (!myError.isConnectionAvailable()) {
          bdErrorAjax(response, "Error", "Connection Error", "No database connection");
          return;
        } else {
          type = myError.getType();
          title = myError.getTitle();
          if (!myError.getMessage().startsWith("<![CDATA["))
            description = "<![CDATA[" + myError.getMessage() + "]]>";
          else
            description = myError.getMessage();
        }
      } catch (Exception e) {
        if (log4j.isDebugEnabled())
          log4j.debug("Error obtaining rows data");
        type = "Error";
View Full Code Here

Examples of org.openbravo.erpCommon.utility.OBError

      String strWindowPath = Utility.getTabURL(this, strTab, "R");
      if (strWindowPath.equals(""))
        strWindowPath = strDefaultServlet;

      OBError myMessage = processButton(vars, strKey, strProjectType, strDateFrom, strWindow);
      vars.setMessage(strTab, myMessage);
      printPageClosePopUp(response, vars, strWindowPath);
    } else
      pageErrorPopUp(response);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.