Ejemplo n.º 1
0
        static void fillMap()
        {
            if (mapSellPrice == null)
            {
                mapSellPrice = new Dictionary <String, SellPrice>();
            }

            SellPrice price1 = new SellPrice();

            price1.BuyPrice     = 95000;
            price1.Date         = new DateTime(2017, 10, 02);
            price1.Id           = "1";
            price1.Remarks      = "baru beli";
            price1.SellingPrice = 127500;
            price1.Sale         = false;
            price1.Product      = productService.getProduct("1");

            SellPrice price2 = new SellPrice();

            price2.BuyPrice     = 85000;
            price2.Date         = new DateTime(2017, 10, 31);
            price2.Id           = "2";
            price2.Remarks      = "Sale";
            price2.SellingPrice = 100000;
            price2.Sale         = true;
            price2.Product      = productService.getProduct("1");

            mapSellPrice.Add("1", price1);
            mapSellPrice.Add("2", price2);
        }
Ejemplo n.º 2
0
 public void ShouldBe(OrderLine other)
 {
     Id.ShouldBe(other.Id);
     OrderId.ShouldBe(other.OrderId);
     Quantity.ShouldBe(other.Quantity);
     SellPrice.ShouldBe(other.SellPrice);
 }
Ejemplo n.º 3
0
Archivo: Ocr.cs Proyecto: alxwrd/pacs
        public override string ToString()
        {
            string buyP  = BuyPrice >= 0 ? BuyPrice.ToString() : "";
            string buyQ  = BuyQty >= 0 ? BuyQty.ToString() : "";
            string sellP = SellPrice >= 0 ? SellPrice.ToString() : "";
            string sellQ = SellQty >= 0 ? SellQty.ToString() : "";

            return(Name + ", " + Shop + ", " + buyP + ", " + buyQ + ", " + sellP + ", " + sellQ);
        }
Ejemplo n.º 4
0
Archivo: Tower.cs Proyecto: bluwy/QTD
        /// <summary>
        /// Update tower's relevant components depending on the level
        /// </summary>
        protected virtual void UpdateStats()
        {
            GetComponent <CircleCollider2D>().radius = AttackRange;
            _rangeCircle.transform.localScale        = new Vector3(AttackRange, AttackRange, AttackRange);
            _sellText.text = SellPrice.ToString();
            _upgradeButton.gameObject.SetActive(!IsMaxLevel);

            if (!IsMaxLevel)
            {
                _upgradeText.text = UpgradeCost.ToString();
            }
        }
Ejemplo n.º 5
0
        public SellPriceMaintenance(ProductEntity product)
        {
            InitializeComponent();
            iniCommonPage();
            SellPrice            = new SellPrice();
            SellPrice.Product    = product;
            SellPrice.Date       = DateTime.Now;
            SellPrice.Sale       = false;
            radioTrue.IsChecked  = SellPrice.Sale;
            radioFalse.IsChecked = !SellPrice.Sale;

            dtExpired.SelectedDate = SellPrice.Date;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Ajoute les données de l'entités dans un dictionnaire pour assurer la correspondance entre attributs et colonnes
        /// </summary>
        /// <returns> Le dictionnaire </returns>
        public Dictionary <string, string> Fetch()
        {
            Dictionary <string, string> res = new Dictionary <string, string>
            {
                { "nom", Name },
                { "designation", Designation },
                { "prix_achat", PurchasePrice.ToString(CultureInfo.CurrentCulture) },
                { "prix_vente", SellPrice.ToString(CultureInfo.CurrentCulture) },
                { "tva", TVA.ToString(CultureInfo.CurrentCulture) },
                { "code_ean", EANCode }
            };

            return(res);
        }
        void ReleaseDesignerOutlets()
        {
            if (btnBuy != null)
            {
                btnBuy.Dispose();
                btnBuy = null;
            }

            if (btnSell != null)
            {
                btnSell.Dispose();
                btnSell = null;
            }

            if (BuyPrice != null)
            {
                BuyPrice.Dispose();
                BuyPrice = null;
            }

            if (ChangeValueView != null)
            {
                ChangeValueView.Dispose();
                ChangeValueView = null;
            }

            if (NameValue != null)
            {
                NameValue.Dispose();
                NameValue = null;
            }

            if (ResultValue != null)
            {
                ResultValue.Dispose();
                ResultValue = null;
            }

            if (SellPrice != null)
            {
                SellPrice.Dispose();
                SellPrice = null;
            }

            if (UserValue != null)
            {
                UserValue.Dispose();
                UserValue = null;
            }
        }
Ejemplo n.º 8
0
    public override string ToString()
    {
        string s = "";

        s += ID;
        s += ItemType;
        s += Quality;
        s += Description;
        s += Capacity.ToString();
        s += BuyPrice.ToString();
        s += SellPrice.ToString();
        s += HP.ToString();
        s += MP.ToString();
        return(s);
    }
Ejemplo n.º 9
0
 public void ShouldNotBe(OrderLine other, bool sameIds)
 {
     if (sameIds)
     {
         Id.ShouldBe(other.Id);
         OrderId.ShouldBe(other.OrderId);
     }
     else
     {
         Id.ShouldNotBe(other.Id);
         OrderId.ShouldNotBe(other.OrderId);
     }
     Quantity.ShouldNotBe(other.Quantity);
     SellPrice.ShouldNotBe(other.SellPrice);
 }
Ejemplo n.º 10
0
 public override void Write(BgoProtocolWriter w)
 {
     base.Write(w);
     w.Write((byte)Category);
     w.Write((byte)ItemType);
     w.Write(Tier);
     w.Write((byte)Faction);
     w.Write((ushort)SortingNames.Length);
     foreach (string str in SortingNames)
     {
         w.Write(str);
     }
     w.Write((ushort)SortingWeight);
     BuyPrice.Write(w);
     UpgradePrice.Write(w);
     SellPrice.Write(w);
     w.Write(CanBeSold);
 }
Ejemplo n.º 11
0
        private void UpdatePotentialGain()
        {
            if (SellPrice?.Any() == false)
            {
                return;
            }
            const decimal invested      = 0.01M; // BTC
            decimal       investedCoins = invested / BuyPriceMax;
            decimal       sellFraction  = investedCoins / SellPrice.Length;
            decimal       expectedGain  = 0;

            foreach (var price in SellPrice)
            {
                expectedGain += price * sellFraction;
            }

            decimal diff = expectedGain - invested;

            PotentialGain = (float)(diff / invested);
        }
Ejemplo n.º 12
0
 public void saveSellPrice(SellPrice sellPrice)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 13
0
        public void Execute(IRuleExecutionContext context)
        {
            var commerceContext = context.Fact <CommerceContext>();
            var cart            = commerceContext?.GetObject <Cart>();
            var totals          = commerceContext?.GetObject <CartTotals>();

            if (cart == null || !cart.Lines.Any() || totals == null || !totals.Lines.Any())
            {
                return;
            }

            var quantityX           = QuantityX.Yield(context);
            var sellPrice           = SellPrice.Yield(context);
            var maximumApplications = MaximumApplications.Yield(context);

            if (quantityX <= 0 || sellPrice <= 0 || maximumApplications < 0)
            {
                return;
            }

            var lines = cart.Lines.Where(l => l.Quantity >= quantityX).ToList();

            if (!lines.Any())
            {
                return;
            }

            var propertiesModel = commerceContext.GetObject <PropertiesModel>();
            var discount        = commerceContext.GetPolicy <KnownCartAdjustmentTypesPolicy>().Discount;

            foreach (var line in lines)
            {
                if (!totals.Lines.ContainsKey(line.Id) || !line.HasPolicy <PurchaseOptionMoneyPolicy>())
                {
                    return;
                }

                var timesQualified = Math.Floor(line.Quantity / quantityX);
                if (maximumApplications > 0 && maximumApplications < timesQualified)
                {
                    timesQualified = maximumApplications;
                }
                var policy        = line.GetPolicy <PurchaseOptionMoneyPolicy>();
                var discountValue = (policy.SellPrice.Amount * quantityX - sellPrice) * timesQualified;

                if (commerceContext.GetPolicy <GlobalPricingPolicy>().ShouldRoundPriceCalc)
                {
                    discountValue = decimal.Round(
                        discountValue,
                        commerceContext.GetPolicy <GlobalPricingPolicy>().RoundDigits,
                        commerceContext.GetPolicy <GlobalPricingPolicy>().MidPointRoundUp ?
                        MidpointRounding.AwayFromZero :
                        MidpointRounding.ToEven);
                }

                discountValue *= decimal.MinusOne;
                line.Adjustments.Add(new CartLineLevelAwardedAdjustment()
                {
                    Name           = (propertiesModel?.GetPropertyValue("PromotionText") as string ?? discount),
                    DisplayName    = (propertiesModel?.GetPropertyValue("PromotionCartText") as string ?? discount),
                    Adjustment     = new Money(commerceContext.CurrentCurrency(), discountValue),
                    AdjustmentType = discount,
                    IsTaxable      = false,
                    AwardingBlock  = nameof(CartAnyItemQuantityXSellPriceAction)
                });
                totals.Lines[line.Id].SubTotal.Amount += discountValue;
                line.GetComponent <MessagesComponent>().AddMessage(
                    commerceContext.GetPolicy <KnownMessageCodePolicy>().Promotions,
                    $"PromotionApplied: {propertiesModel?.GetPropertyValue("PromotionId") ?? nameof(CartAnyItemQuantityXSellPriceAction)}");
            }
        }