private void CheckPricingLoaders(ContentReference contentReference, CustomerPricing customerPricing) { PricingLoader RwLoader = new PricingLoader(contentLoader.Service, _priceDetailService, referenceConverter.Service, catalogSystem.Service); ItemCollection <PriceDetail> prices = RwLoader.GetPrices(contentReference, MarketId.Default, customerPricing); // Overload is marked "Obsolete" - "Use the constructor with currentMarketService instead." ReadOnlyPricingLoader RoLoader = new ReadOnlyPricingLoader( // first overload obsoleted in 9 contentLoader.Service , _priceService , referenceConverter.Service , catalogSystem.Service , currentMarket.Service // added //, Mediachase.Commerce.Security.SecurityContext.Current // added , CustomerContext.Current // added //, FrameworkContext.Current); // added ); // new style //ReadOnlyPricingLoader RoLoader2 = new ReadOnlyPricingLoader( // contentLoader.Service // , _priceService // , referenceConverter.Service // , catalogSystem.Service // , currentMarket.Service // , Mediachase.Commerce.Security.SecurityContext.Current // , Mediachase.Commerce.Customers.CustomerContext.Current // , FrameworkContext.Current); }
private void CheckPricingLoaders(ContentReference contentReference, CustomerPricing customerPricing) { // The one to use when using "custom" price-types PricingLoader RwLoader = new PricingLoader( contentLoader.Service, _priceDetailService, // Note: PriceDetailService referenceConverter.Service, catalogSystem.Service); // Note: the customerPricing arg. handles custom price-types ItemCollection <PriceDetail> prices = RwLoader.GetPrices (contentReference, MarketId.Default, customerPricing); // This one may not be the best choice, it's from 7.5/R3 // For non-complex scenarios it may be sufficient, or if the inconsistent behaviour is benneficial // Several overloads are marked... // "Obsolete" - "Use the constructor with currentMarketService instead." ReadOnlyPricingLoader RoLoader = new ReadOnlyPricingLoader( // first overload obsoleted in 9 contentLoader.Service, _priceService, // Note: PriceService referenceConverter.Service, catalogSystem.Service, currentMarket.Service, // added //, Mediachase.Commerce.Security.SecurityContext.Current // Obsoleted CustomerContext.Current // added //, FrameworkContext.Current // Obsoleted ); // added ItemCollection <Price> custPrices = RoLoader.GetCustomerPrices(contentReference); }
private void InitializeData() { this.InputSalesPinVerifyColor = "Red"; this.InputSalesPinVerify = "Unverified"; this.InputCustomerPinVerifyColor = "Red"; this.InputCustomerPinVerify = "Unverified"; IsCustomerPinEnabled = false; IsSalesPinEnabled = false; IsPayBtnEnabled = false; IsBuyInputEnabled = true; if (Application.Current.Properties.ContainsKey("transSelectedCustomerPricing")) { _customersPricing = (CustomerPricing)Application.Current.Properties["transSelectedCustomerPricing"]; _customerEmail = (string)Application.Current.Properties["transCustomer"]; Application.Current.Properties["transSelectedCustomerPricing"] = null; Application.Current.Properties["transCustomer"] = null; this.CustomerEmail = _customerEmail; this.Product = _customersPricing.ProductName; this.UnitCost = _customersPricing.CostView; this.AccountBalance = _customersPricing.CustomerBalanceView; } }
private bool IsPriceOverride(CustomerPricing pricing) { if (pricing == null) { return(false); } return(Convert.ToInt32(pricing.PriceTypeId).Equals(3)); }
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { if (value == null) { writer.WriteValue("null"); return; } CustomerPricing pricing = (CustomerPricing)value; writer.WriteStartObject(); writer.WritePropertyName("PriceTypeId"); writer.WriteValue(pricing.PriceTypeId); writer.WritePropertyName("PriceCode"); writer.WriteValue(pricing.PriceCode); writer.WriteEndObject(); }
private CustomerPricing CheckInventory(DefaultVariation currentContent) { CustomerPricing localcheck = new CustomerPricing(); // need some logic to pick the right price-group // Could have DefaultPrice, BatchPrice and WebPrice ... and groups accordingly to those prices // if PreOrder (the batch qty) > InventoryRecord record = inventoryService.Service.Get(currentContent.Code, "London"); var a = record.AdditionalQuantity; // (now Reserved... not used in bizlogic API says...but it is) //var x = record.a /* Suggestion: * Having a prop at the sku like BatchQty set to e.g. 100 * Having a prop at the SKU for original inventory * when PurchaseAvailable reach that number we revert to the Default Price * ...have 10 in stock... gets a batch of 100 --> 110 in stock * When it reach 10 */ return(localcheck); }
/// <summary> /// Default constructor /// </summary> /// <param name="catalogKey">catalog key</param> /// <param name="marketId">market Id</param> /// <param name="minQuantity">min quantity</param> /// <param name="unitPrice">unit price</param> /// <param name="customerPricing">customer Pricing</param> /// <param name="validFrom">valid from</param> /// <param name="validUntil">valid until</param> public ReadOnlyPriceValue(CatalogKey catalogKey, MarketId marketId, decimal minQuantity, Money unitPrice, CustomerPricing customerPricing, DateTime validFrom, DateTime?validUntil) { this.CatalogKey = catalogKey; this.MarketId = marketId; this.CustomerPricing = customerPricing; this.ValidFrom = validFrom; this.ValidUntil = validUntil; this.MinQuantity = minQuantity; this.UnitPrice = unitPrice; }
private bool IsPriceOverride(CustomerPricing pricing) { if (pricing == null) { return false; } return Convert.ToInt32(pricing.PriceTypeId).Equals(3); }