/// <summary>
        /// Get Limit Price if exists
        /// </summary>
        /// <returns>limit</returns>
        public Decimal GetLimitPrice()
        {
            Decimal limitPrice = GetPlannedPrice();

            if (GetM_Product_ID() == 0)
            {
                return(limitPrice);
            }
            if (GetProject() == null)
            {
                return(limitPrice);
            }
            bool            isSOTrx = true;
            MProduct        prd     = new MProduct(GetCtx(), GetM_Product_ID(), null);
            MProductPricing pp      = new MProductPricing(GetAD_Client_ID(), GetAD_Org_ID(),
                                                          GetM_Product_ID(), _parent.GetC_BPartner_ID(), GetPlannedQty(), isSOTrx);

            pp.SetM_PriceList_ID(_parent.GetM_PriceList_ID());
            pp.SetM_PriceList_Version_ID(_parent.GetM_PriceList_Version_ID());

            // Get Price according to Attribute set instance if selected on Project line
            if (Get_ColumnIndex("M_AttributeSetInstance_ID") >= 0)
            {
                pp.SetM_AttributeSetInstance_ID(GetM_AttributeSetInstance_ID());
            }

            pp.SetC_UOM_ID(prd.GetC_UOM_ID());
            if (pp.CalculatePrice())
            {
                limitPrice = pp.GetPriceLimit();
            }
            return(limitPrice);
        }
        /// <summary>
        /// Get Purchase Price if exists
        /// </summary>
        /// <returns>limit</returns>
        public Decimal GetPurchasePrice()
        {
            //VA077_PurchasePrice
            Decimal purchasePrice = 0;

            if (GetM_Product_ID() == 0)
            {
                return(purchasePrice);
            }
            bool            isSOTrx = false;
            MProduct        prd     = new MProduct(GetCtx(), GetM_Product_ID(), null);
            MProductPricing pp      = new MProductPricing(GetAD_Client_ID(), GetAD_Org_ID(),
                                                          GetM_Product_ID(), _parent.GetC_BPartner_ID(), GetPlannedQty(), isSOTrx);

            pp.SetM_PriceList_ID(Util.GetValueOfInt(_parent.Get_Value("PO_PriceList_ID")));

            DateTime?validFrom = null;      // _parent.GetDateContract();

            if (validFrom == null)
            {
                validFrom = DateTime.Now.Date;
            }

            int M_PriceList_Version_ID = Util.GetValueOfInt(DB.ExecuteScalar(@"SELECT M_PriceList_Version_ID FROM M_PriceList_Version WHERE IsActive = 'Y' 
                        AND M_PriceList_ID = " + Util.GetValueOfInt(_parent.Get_Value("PO_PriceList_ID")) + @" AND ValidFrom <= "
                                                                             + DB.TO_DATE(validFrom, true) + " ORDER BY ValidFrom DESC"));

            pp.SetM_PriceList_Version_ID(M_PriceList_Version_ID);

            // Get Price according to Attribute set instance if selected on Project line
            if (Get_ColumnIndex("M_AttributeSetInstance_ID") >= 0)
            {
                pp.SetM_AttributeSetInstance_ID(GetM_AttributeSetInstance_ID());
            }

            // Get Price according to UOM if selected on Project line
            if (Get_ColumnIndex("C_UOM_ID") >= 0)
            {
                pp.SetC_UOM_ID(Util.GetValueOfInt(Get_Value("C_UOM_ID")));
            }
            else
            {
                pp.SetC_UOM_ID(prd.GetC_UOM_ID());
            }
            if (pp.CalculatePrice())
            {
                purchasePrice = pp.GetPriceStd();
            }
            return(purchasePrice);
        }