Ejemplo n.º 1
0
        public PalletItem(Order order, Item sku, int caseQuantity, Slotting slotting)
        {
            Order    = order;
            Sku      = sku;
            Quantity = caseQuantity;
            Layer    = 0;

            Slotting = slotting ?? new Slotting();
        }
Ejemplo n.º 2
0
        public bool addPackagetoPalletWithoutCheck(Order order, List <OrderLine> ordLines, List <Slotting> slottings)
        {
            foreach (OrderLine orderLine in ordLines)
            {
                Slotting slotting = slottings.FindFirst(orderLine.Sku.InventoryId);

                AddItemToPalletWithoutCheck(order, orderLine, orderLine.CaseQuantityRemaining, slotting);
            }

            return(true);
        }
Ejemplo n.º 3
0
        public bool AddPackageToPallet(Order order, List <OrderLine> ordLines, List <Slotting> slottings,
                                       double buildToPct, double overflow, bool stable, bool enforceStability, int maxUnstablePkgs, double maxUnstablePct)
        {
            bool isAdded = false;

            if (CanAdd(ordLines, buildToPct, overflow, enforceStability, maxUnstablePkgs, maxUnstablePct))
            {
                isAdded = true;

                foreach (OrderLine orderLine in ordLines)
                {
                    Slotting slotInfo = slottings.FindFirst(orderLine.Sku.InventoryId);

                    isAdded = this.AddItemToPallet(order, orderLine, orderLine.CaseQuantityRemaining,
                                                   slotInfo, buildToPct, overflow, stable, enforceStability, maxUnstablePkgs, maxUnstablePct);
                }
            }

            return(isAdded);
        }
Ejemplo n.º 4
0
        public bool AddItemToPallet(Order order, OrderLine orderLine, int caseQuantity, Slotting slotting, double buldToPercentage,
                                    double overflow, bool stable, bool enforceStability, int maxUnstablePackages, double maxUnstablePercentage)
        {
            bool isAdded = false;

            PalletItem palletItem = new PalletItem(order, orderLine.Sku, caseQuantity, slotting);

            if (slotting?.PickMethodCode == PickMethodCode.FullLayer ||                 // If item is a layer item set the layer number
                slotting?.PickMethodCode == PickMethodCode.MixedLayer)
            {
                palletItem.Layer = NextLayerNumber;
            }
            else                                                                                                                                // Else check if the inven already exists on this pallet
            {
                PalletItem palletItemOnPallet = this.GetPalletItemByInventoryId(orderLine.Sku.InventoryId, order.OrderId);

                if (palletItemOnPallet != null)
                {
                    palletItem = palletItemOnPallet;
                }
            }

            if (CanAdd(orderLine, caseQuantity, buldToPercentage, overflow, enforceStability, maxUnstablePackages, maxUnstablePercentage))
            {
                if (PalletItems.Contains(palletItem))                       // If inven already exists on this pallet add to it's quantity
                {
                    palletItem.Quantity += caseQuantity;
                }
                else                                                                                            // Else add the item to the pallet
                {
                    PalletItems.Add(palletItem);
                }

                double itemPercentage = orderLine.CalculatePercentageSkuOfItself(caseQuantity);

                if (!stable)
                {
                    UnstablePercentage += itemPercentage;

                    if (!UnstablePackageIds.Contains(orderLine.Sku.Package.PackageId))
                    {
                        UnstablePackageIds.Add(orderLine.Sku.Package.PackageId);
                    }
                }

                if (!Orders.Contains(order))
                {
                    Orders.Add(order);
                }

                isAdded = true;
            }

            return(isAdded);
        }
Ejemplo n.º 5
0
        public bool AddItemToPalletWithoutCheck(Order order, OrderLine ordLine, int caseQty, Slotting slotting)
        {
            Item       sku        = ordLine.Sku;
            PalletItem palletItem = new PalletItem(order, sku, caseQty, slotting);

            // If item is a layer item set the layer number
            if (slotting?.PickMethodCode == PickMethodCode.FullLayer ||
                slotting?.PickMethodCode == PickMethodCode.MixedLayer)
            {
                palletItem.Layer = NextLayerNumber;
            }
            else
            {
                // Else check if the inven already exists on this pallet
                PalletItem palletItemOnPallet = GetPalletItemByInventoryId(sku.InventoryId, order.OrderId);

                if (palletItemOnPallet != null)
                {
                    palletItem = palletItemOnPallet;
                }
            }


            // If inven already exists on this pallet add to it's quantity
            if (PalletItems.Contains(palletItem))
            {
                palletItem.Quantity += caseQty;
            }
            else
            {
                // Else add the item to the pallet
                PalletItems.Add(palletItem);
            }

            if (!Orders.Contains(order))
            {
                Orders.Add(order);
            }

            return(true);
        }