コード例 #1
0
 /**
  *  Set Price
  */
 public void SetPrice()
 {
     try
     {
         if (GetC_Charge_ID() != 0)
         {
             MCharge charge = MCharge.Get(GetCtx(), GetC_Charge_ID());
             SetPriceActual(charge.GetChargeAmt());
         }
         if (GetM_Product_ID() == 0)
         {
             return;
         }
         if (_M_PriceList_ID == 0)
         {
             _M_PriceList_ID = GetParent().GetM_PriceList_ID();
         }
         if (_M_PriceList_ID == 0)
         {
             log.Log(Level.SEVERE, "PriceList unknown!");
             return;
         }
         SetPrice(_M_PriceList_ID);
     }
     catch (Exception e)
     {
         log.Severe("SetPrice" + e.Message);
     }
 }
コード例 #2
0
        }   //  getAccount

        /**
         *  Get MCharge from Cache
         *	@param ctx context
         *	@param C_Charge_ID id
         *	@return MCharge
         */
        public static MCharge Get(Ctx ctx, int C_Charge_ID)
        {
            int     key      = C_Charge_ID;
            MCharge retValue = _cache[key];

            if (retValue != null)
            {
                return(retValue);
            }
            retValue = new MCharge(ctx, C_Charge_ID, null);
            if (retValue.Get_ID() != 0)
            {
                _cache.Add(key, retValue);
            }
            return(retValue);
        }       //	get
コード例 #3
0
        /**
         *  Set Charge - Callout
         *	@param oldC_Charge_ID old value
         *	@param newC_Charge_ID new value
         *	@param windowNo window
         *	@throws Exception
         */
        //@UICallout
        public void SetC_Charge_ID(String oldC_Charge_ID,
                                   String newC_Charge_ID, int windowNo)
        {
            if (newC_Charge_ID == null || newC_Charge_ID.Length == 0)
            {
                return;
            }
            int C_Charge_ID = int.Parse(newC_Charge_ID);

            base.SetC_Charge_ID(C_Charge_ID);

            MCharge charge = MCharge.Get(GetCtx(), C_Charge_ID);

            SetPriceEntered(charge.GetChargeAmt());
            SetTax(windowNo, "C_Charge_ID");
        }       //	setC_Charge_ID