Examples of AdempiereUserError


Examples of org.compiere.util.AdempiereUserError

   */
  protected String doIt() throws java.lang.Exception
  {
    //  Need to have Template
    if (p_EMailPDF && p_R_MailText_ID == 0)
      throw new AdempiereUserError ("@NotFound@: @R_MailText_ID@");
    log.info ("C_BPartner_ID=" + m_C_BPartner_ID
      + ", C_Invoice_ID=" + m_C_Invoice_ID
      + ", EmailPDF=" + p_EMailPDF + ",R_MailText_ID=" + p_R_MailText_ID
      + ", DateInvoiced=" + m_dateInvoiced_From + "-" + m_dateInvoiced_To
      + ", DocumentNo=" + m_DocumentNo_From + "-" + m_DocumentNo_To);
   
    MMailText mText = null;
    if (p_R_MailText_ID != 0)
    {
      mText = new MMailText(getCtx(), p_R_MailText_ID, get_TrxName());
      if (mText.get_ID() != p_R_MailText_ID)
        throw new AdempiereUserError ("@NotFound@: @R_MailText_ID@ - " + p_R_MailText_ID);
    }

    //  Too broad selection
    if (m_C_BPartner_ID == 0 && m_C_Invoice_ID == 0 && m_dateInvoiced_From == null && m_dateInvoiced_To == null
      && m_DocumentNo_From == null && m_DocumentNo_To == null)
      throw new AdempiereUserError ("@RestrictSelection@");

    MClient client = MClient.get(getCtx());
   
    //  Get Info
    StringBuffer sql = new StringBuffer (
View Full Code Here

Examples of org.compiere.util.AdempiereUserError

      doc = (Doc) cnstr.newInstance(ass, rs, trxName);
    }
    catch (Exception e)
    {
      s_log.log(Level.SEVERE, "Doc Class invalid: " + className + " (" + e.toString() + ")");
      throw new AdempiereUserError("Doc Class invalid: " + className + " (" + e.toString() + ")");
    }

    if (doc == null)
      s_log.log(Level.SEVERE, "Unknown AD_Table_ID=" + AD_Table_ID);
    return doc;
View Full Code Here

Examples of org.compiere.util.AdempiereUserError

   
    // Error Checking.  An error results in an exception thrown which is caught
    // by SrvProcess which then rolls back any changes to the database made as
    // part of the get_TrxName() transaction.
    if (bom.is_new())
      throw new AdempiereUserError("@Error@ Bill Of Materials does not exist for "+
                                   product.getName());
    if (product.getVolume() == null || product.getVolume().doubleValue() <= 0)
      throw new AdempiereUserError("@Error@ Volume value for product "+product.getName()+
                                   " is zero or less.");
    if (!product.isVerified())
      throw new AdempiereUserError("@Error@ Product "+product.getName()+" is not verified");

    // Create the Inventory record
    MInventory inv = new MInventory(getCtx(), 0, get_TrxName());
    inv.setM_Warehouse_ID(loc.getM_Warehouse_ID());
    inv.setClientOrg(getAD_Client_ID(), Env.getAD_Org_ID(getCtx()));
View Full Code Here

Examples of org.compiere.util.AdempiereUserError

    BigDecimal vol;
    int asiID;
   
    // Make sure SG in the Attribute Set Instance has a value.  Abort if not.
    if (sg == null || sg.equals(BigDecimal.valueOf(0)))
      throw new AdempiereUserError("@Error@ SG value not set for Attribute Set Instance "+
                                   asi.getDescription());
   
    // Generate inventory lines from the BOM lines
    for (MPPProductBOMLine bomLine : bomLines)
    {
View Full Code Here

Examples of org.compiere.util.AdempiereUserError

    String msg = string;
    ValueNamePair pp = CLogger.retrieveError();
    if (pp != null)
      msg = pp.getName() + " - ";
    msg += sql;
    throw new AdempiereUserError(msg);
  }
View Full Code Here

Examples of org.compiere.util.AdempiereUserError

      return "-";
    }
    //  PLV required
    if (p_M_PriceList_Version_ID == 0
      && (p_SetFutureCostTo.equals(TO_PriceListLimit) || p_SetStandardCostTo.equals(TO_PriceListLimit)))
      throw new AdempiereUserError ("@FillMandatory@  @M_PriceList_Version_ID@");
   
    //  Validate Source
    if (!isValid(p_SetFutureCostTo))
      throw new AdempiereUserError ("@NotFound@ @M_CostElement_ID@ (Future) " + p_SetFutureCostTo);
    if (!isValid(p_SetStandardCostTo))
      throw new AdempiereUserError ("@NotFound@ @M_CostElement_ID@ (Standard) " + p_SetStandardCostTo);

    //  Prepare
    MClient client = MClient.get(getCtx());
    m_ce = MCostElement.getMaterialCostElement(client, MAcctSchema.COSTINGMETHOD_StandardCosting);
    if (m_ce.get_ID() == 0)
      throw new AdempiereUserError ("@NotFound@ @M_CostElement_ID@ (StdCost)");
    log.config(m_ce.toString());
    m_ass = MAcctSchema.getClientAcctSchema(getCtx(), client.getAD_Client_ID());
    for (int i = 0; i < m_ass.length; i++)
      createNew(m_ass[i]);
    commit();
View Full Code Here

Examples of org.compiere.util.AdempiereUserError

    {
      log.info("M_Requisition_ID=" + p_M_Requisition_ID);
      MRequisition req = new MRequisition(getCtx(), p_M_Requisition_ID, get_TrxName());
      if (!MRequisition.DOCSTATUS_Completed.equals(req.getDocStatus()))
      {
        throw new AdempiereUserError("@DocStatus@ = " + req.getDocStatus());
      }
      MRequisitionLine[] lines = req.getLines();
      for (int i = 0; i < lines.length; i++)
      {
        if (lines[i].getC_OrderLine_ID() == 0)
View Full Code Here

Examples of org.compiere.util.AdempiereUserError

    {
      MCharge charge = MCharge.get(getCtx(), rLine.getC_Charge_ID());
      C_BPartner_ID = charge.getC_BPartner_ID();
      if (C_BPartner_ID == 0)
      {
        throw new AdempiereUserError("No Vendor for Charge " + charge.getName());
      }
    }
    else
    {
      // Find Strategic Vendor for Product
View Full Code Here

Examples of org.compiere.util.AdempiereUserError

  @Override
  protected String doIt() throws Exception {
    try {
      return connectServerSC();
    } catch (SocketTimeoutException e) {
      throw new AdempiereUserError("Finish timeout", e);
    } catch (Exception e) {
      throw new AdempiereUserError("Error connecting to server", e);
    }
  }
View Full Code Here

Examples of org.compiere.util.AdempiereUserError

  @Override
  protected String doIt() throws Exception {
    try {
      return connectServer();
    } catch (SocketTimeoutException e) {
      throw new AdempiereUserError("Finish timeout", e);
    } catch (Exception e) {
      throw new AdempiereUserError("Error getting value", e);
    }
  }
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.