Examples of AdempiereSystemError


Examples of org.compiere.util.AdempiereSystemError

    final Iterator<SimpleTreeNode> iter = categories.iterator();
    while (iter.hasNext()) {
      SimpleTreeNode node = (SimpleTreeNode) iter.next();
      if (node.getParentId() == productCategoryId) {
        if (node.getNodeId() == loopIndicatorId) {
          throw new AdempiereSystemError("The product category tree contains a loop on categoryId: " + loopIndicatorId);
        }
        ret = ret + getSubCategoriesString(node.getNodeId(), categories, loopIndicatorId) + ",";
      }
    }
    log.fine(ret);
View Full Code Here

Examples of org.compiere.util.AdempiereSystemError

    final Iterator iter = categories.iterator();
    while (iter.hasNext()) {
      SimpleTreeNode node = (SimpleTreeNode) iter.next();
      if (node.getParentId() == productCategoryId) {
        if (node.getNodeId() == loopIndicatorId) {
          throw new AdempiereSystemError("The product category tree contains a loop on categoryId: " + loopIndicatorId);
        }
        ret = ret + getSubCategoriesString(node.getNodeId(), categories, loopIndicatorId) + ",";
      }
    }
    log.fine(ret);
View Full Code Here

Examples of org.compiere.util.AdempiereSystemError

    //  Average Invoice
    if (to.equals(TO_AverageInvoice))
    {
      MCostElement ce = getCostElement(TO_AverageInvoice);
      if (ce == null)
        throw new AdempiereSystemError("CostElement not found: " + TO_AverageInvoice);
      MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID());
      if (xCost != null)
        retValue = xCost.getCurrentCostPrice();
    }
    //  Average Invoice History
    else if (to.equals(TO_AverageInvoiceHistory))
    {
      MCostElement ce = getCostElement(TO_AverageInvoice);
      if (ce == null)
        throw new AdempiereSystemError("CostElement not found: " + TO_AverageInvoice);
      MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID());
      if (xCost != null)
        retValue = xCost.getHistoryAverage();
    }
   
    //  Average PO
    else if (to.equals(TO_AveragePO))
    {
      MCostElement ce = getCostElement(TO_AveragePO);
      if (ce == null)
        throw new AdempiereSystemError("CostElement not found: " + TO_AveragePO);
      MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID());
      if (xCost != null)
        retValue = xCost.getCurrentCostPrice();
    }
    //  Average PO History
    else if (to.equals(TO_AveragePOHistory))
    {
      MCostElement ce = getCostElement(TO_AveragePO);
      if (ce == null)
        throw new AdempiereSystemError("CostElement not found: " + TO_AveragePO);
      MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID());
      if (xCost != null)
        retValue = xCost.getHistoryAverage();
    }
   
    //  FiFo
    else if (to.equals(TO_FiFo))
    {
      MCostElement ce = getCostElement(TO_FiFo);
      if (ce == null)
        throw new AdempiereSystemError("CostElement not found: " + TO_FiFo);
      MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID());
      if (xCost != null)
        retValue = xCost.getCurrentCostPrice();
    }

    //  Future Std Costs
    else if (to.equals(TO_FutureStandardCost))
      retValue = cost.getFutureCostPrice();
   
    //  Last Inv Price
    else if (to.equals(TO_LastInvoicePrice))
    {
      MCostElement ce = getCostElement(TO_LastInvoicePrice);
      if (ce != null)
      {
        MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID());
        if (xCost != null)
          retValue = xCost.getCurrentCostPrice();
      }
      if (retValue == null)
      {
        MProduct product = MProduct.get(getCtx(), cost.getM_Product_ID());
        MAcctSchema as = MAcctSchema.get(getCtx(), cost.getC_AcctSchema_ID());
        retValue = MCost.getLastInvoicePrice(product,
          cost.getM_AttributeSetInstance_ID(), cost.getAD_Org_ID(), as.getC_Currency_ID());       
      }
    }
   
    //  Last PO Price
    else if (to.equals(TO_LastPOPrice))
    {
      MCostElement ce = getCostElement(TO_LastPOPrice);
      if (ce != null)
      {
        MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID());
        if (xCost != null)
          retValue = xCost.getCurrentCostPrice();
      }
      if (retValue == null)
      {
        MProduct product = MProduct.get(getCtx(), cost.getM_Product_ID());
        MAcctSchema as = MAcctSchema.get(getCtx(), cost.getC_AcctSchema_ID());
        retValue = MCost.getLastPOPrice(product,
          cost.getM_AttributeSetInstance_ID(), cost.getAD_Org_ID(), as.getC_Currency_ID());       
      }
    }
 
    //  FiFo
    else if (to.equals(TO_LiFo))
    {
      MCostElement ce = getCostElement(TO_LiFo);
      if (ce == null)
        throw new AdempiereSystemError("CostElement not found: " + TO_LiFo);
      MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID());
      if (xCost != null)
        retValue = xCost.getCurrentCostPrice();
    }
   
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.