Example #1
0
        public SmCalcRecommendation(SmScenario scenario, SmDenseSchedule schedule, decimal[] pricePath, int revisionId, bool isCsp = false)
        {
            ScheduleId            = schedule.ScheduleNumber;
            ScheduleMask          = scenario.ScheduleMask;
            ScheduleMarkdownCount = schedule.MarkdownCount;

            IsCsp      = isCsp;
            PricePath  = pricePath;
            RevisionId = revisionId;

            // Defaults
            Rank = 0;
            TotalMarkdownCount = 0;
            TerminalStock      = 0;
            TotalRevenue       = 0M;
            TotalCost          = 0M;
            TotalMarkdownCost  = 0M;
            FinalDiscount      = null;
            StockValue         = 0M;
            EstimatedProfit    = 0M;
            EstimatedSales     = 0M;
            SellThroughRate    = 0M;
            SellThroughTarget  = 0M;
            FinalMarkdownType  = MarkdownType.None;

            Projections = new List <SmCalcRecommendationProjection>();
        }
Example #2
0
        public SmCalcProduct(SmScenario scenario, int modelId, SmProduct product, List <SmDenseSchedule> schedules, SmDepth depth)
        {
            ClientId      = scenario.OrganisationId;
            ModelId       = modelId;
            ScenarioId    = scenario.ScenarioId;
            ProductId     = product.ProductId;
            ProductName   = product.Name;
            PriceLadderId = product.PriceLadder.PriceLadderId;

            Recommendations = new List <SmCalcRecommendation>();

            HierarchyId   = product.HierarchyId;
            HierarchyName = product.HierarchyName;

            ScheduleCount                  = schedules.Count;
            ScheduleCrossProductCount      = 0;
            ScheduleProductMaskFilterCount = 0;
            ScheduleMaxMarkdownFilterCount = 0;
            ScheduleExceededFlowlineThresholdFilterCount = 0;

            HighPredictionCount      = 0;
            NegativeRevenueCount     = 0;
            InvalidMarkdownTypeCount = 0;
            MinimumAbsolutePriceChangeNotMetCount           = 0;
            MinimumRelativePercentagePriceChangeNotMetCount = 0;
            DiscountPercentageOutsideAllowedRangeCount      = 0;

            CurrentMarkdownCount = product.CurrentMarkdownCount;
            CurrentMarkdownType  = product.CurrentMarkdownType;
            CurrentSellingPrice  = product.CurrentSellingPrice;
            OriginalSellingPrice = product.OriginalSellingPrice;
            CurrentCostPrice     = product.CurrentCostPrice;
            CurrentStock         = product.CurrentStock;
            CurrentSalesQuantity = product.CurrentSalesQuantity;

            SellThroughTarget = product.SellThrough;

            SalesFlexFactor = product.SalesFlexFactor;

            MarkdownTypeConstraint               = product.MarkdownTypeConstraint;
            MinimumAbsolutePriceChange           = product.MinimumAbsolutePriceChange;
            MinimumRelativePercentagePriceChange = product.MinimumRelativePercentagePriceChange;
            MinDiscountsNew     = product.MinDiscountsNew;
            MinDiscountsFurther = product.MinDiscountsFurther;
            MaxDiscountsNew     = product.MaxDiscountsNew;
            MaxDiscountsFurther = product.MaxDiscountsFurther;

            CurrentMarkdownDepth       = depth.MarkdownDepth;
            CurrentDiscountLadderDepth = depth.DiscountLadderDepth;

            State         = ProductState.Fatal;
            DecisionState = scenario.DefaultDecisionState;
        }
Example #3
0
        public static SmScenarioSummary Build(ScenarioSummary entity)
        {
            return(new SmScenarioSummary
            {
                ScenarioId = entity.ScenarioId,
                ScenarioName = entity.ScenarioName,

                Status = (ScenarioSummaryStatusType)entity.ScenarioSummaryStatusTypeId,

                LastGroupType = (FunctionGroupType)entity.LastGroupTypeId,
                LastFunctionInstanceId = entity.LastFunctionInstanceId,
                FunctionInstanceCount = entity.FunctionInstanceCount,
                FunctionInstanceCountTotal = entity.FunctionInstanceCountTotal,

                ProductTotal = entity.ProductTotal,
                ProductCount = entity.ProductCount,
                RecommendationCount = entity.RecommendationCount,

                AttemptCountMin = entity.AttemptCountMin,
                AttemptCountAvg = entity.AttemptCountAvg,
                AttemptCountMax = entity.AttemptCountMax,

                Duration = entity.Duration,

                SuccessCount = entity.SuccessCount,
                ErrorCount = entity.ErrorCount,
                LastRunDate = entity.LastRunDate,

                //New scenario list elements
                ProductsCost = entity.ProductsCost,
                ProductsAcceptedCost = entity.ProductsAcceptedCost,
                ProductsAcceptedCount = entity.ProductsAcceptedCount,
                ProductsRejectedCount = entity.ProductsRejectedCount,
                ProductsRevisedCount = entity.ProductsRevisedCount,
                ProductsAcceptedPercentage = entity.ProductsAcceptedPercentage,
                ProductsRejectedPercentage = entity.ProductsRejectedPercentage,
                ProductsRevisedPercentage = entity.ProductsRevisedPercentage,
                ProductsEstimatedProfit = entity.ProductsEstimatedProfit,
                ProductsEstimatedSales = entity.ProductsEstimatedSales,
                ProductsAverageDepth = entity.ProductsAverageDepth,
                ProductsMarkdownCost = entity.ProductsMarkdownCost,
                ProductsTerminalStock = entity.ProductsTerminalStock,

                OrganisationId = entity.OrganisationId,
                Scenario = SmScenario.Build(entity.Scenario)
            });
        }