/** * There initial stock levels defined in M_Stock, to avoid modelling stocks, * the initial stock levels are simulated as stockExchangeDemands */ public static void AddInitialStockLevels(IDbTransactionData dbTransactionData) { foreach (var stock in ZppConfiguration.CacheManager.GetMasterDataCache().M_StockGetAll()) { if (stock.Current > 0) { Id articleId = new Id(stock.ArticleForeignKey); Demand stockExchangeDemand = StockExchangeDemand.CreateStockExchangeStockDemand(articleId, new DueTime(0), new Quantity(stock.Current)); stockExchangeDemand.SetReadOnly(); dbTransactionData.DemandsAdd(stockExchangeDemand); } } }