Examples of MProduct


Examples of org.compiere.model.MProduct

      if (p_M_Product_Category_ID != 0)
        pstmt.setInt (5, p_M_Product_Category_ID);
      ResultSet rs = pstmt.executeQuery ();
      while (rs.next ())
      {
        if (createNew (new MProduct (getCtx(), rs, null), as))
          counter++;
      }
      rs.close ();
      pstmt.close ();
      pstmt = null;
View Full Code Here

Examples of org.compiere.model.MProduct

        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());       
      }
    }
View Full Code Here

Examples of org.compiere.model.MProduct

    if (m_orderLine != null)
    {
      m_orderLine.saveEx();
    }
    m_orderLine = null;
    MProduct product = MProduct.get(getCtx(), rLine.getM_Product_ID());

    //  Get Business Partner
    int C_BPartner_ID = rLine.getC_BPartner_ID();
    if (C_BPartner_ID != 0)
    {
      ;
    }
    else if (rLine.getC_Charge_ID() != 0)
    {
      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
      // TODO: refactor
      MProductPO[] ppos = MProductPO.getOfProduct(getCtx(), product.getM_Product_ID(), null);
      for (int i = 0; i < ppos.length; i++)
      {
        if (ppos[i].isCurrentVendor() && ppos[i].getC_BPartner_ID() != 0)
        {
          C_BPartner_ID = ppos[i].getC_BPartner_ID();
          break;
        }
      }
      if (C_BPartner_ID == 0 && ppos.length > 0)
      {
        C_BPartner_ID = ppos[0].getC_BPartner_ID();
      }
      if (C_BPartner_ID == 0)
      {
        throw new NoVendorForProductException(product.getName());
      }
    }
   
    if (!isGenerateForVendor(C_BPartner_ID))
    {
View Full Code Here

Examples of org.compiere.model.MProduct

      return m_isItem.booleanValue();

    m_isItem = Boolean.FALSE;
    if (getM_Product_ID() != 0)
    {
      MProduct product = MProduct.get(Env.getCtx(), getM_Product_ID());
      if (product.get_ID() == getM_Product_ID() && product.isItem())
        m_isItem = Boolean.TRUE;
    }
    return m_isItem.booleanValue();
  //  isItem
View Full Code Here

Examples of org.compiere.model.MProduct

   *  Get Revenue Recognition
   *  @return C_RevenueRecognition_ID or 0
   */
  public int getC_RevenueRecognition_ID()
  {
    MProduct product = getProduct();
    if (product != null)
      return product.getC_RevenueRecognition_ID();
    return 0;
  }   //  getC_RevenueRecognition_ID
View Full Code Here

Examples of org.compiere.model.MProduct

      Integer ii = (Integer)p_po.get_Value(index);
      if (ii != null)
        return ii.intValue();
    }
    //  Storage UOM
    MProduct product = getProduct();
    if (product != null)
      return product.getC_UOM_ID();
    //
    return 0;
  }   //  getC_UOM
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.