Beispiel #1
0
 public void AppsShip(CustomerShipmentShip method)
 {
     if (this.CanShip)
     {
         this.CustomerShipmentState = new CustomerShipmentStates(this.Strategy.Session).Shipped;
         this.EstimatedShipDate     = DateTime.UtcNow.Date;
     }
 }
Beispiel #2
0
        public void BaseShip(CustomerShipmentShip method)
        {
            if (this.CanShip)
            {
                this.ShipmentState     = new ShipmentStates(this.Strategy.Session).Shipped;
                this.EstimatedShipDate = this.Session().Now().Date;

                foreach (ShipmentItem shipmentItem in this.ShipmentItems)
                {
                    shipmentItem.ShipmentItemState = new ShipmentItemStates(this.Session()).Shipped;

                    foreach (OrderShipment orderShipment in shipmentItem.OrderShipmentsWhereShipmentItem)
                    {
                        foreach (SalesOrderItemInventoryAssignment salesOrderItemInventoryAssignment in ((SalesOrderItem)orderShipment.OrderItem).SalesOrderItemInventoryAssignments)
                        {
                            // Quantity is used to calculate QuantityReserved (via inventoryItemTransactions)
                            salesOrderItemInventoryAssignment.Quantity -= orderShipment.Quantity;
                        }
                    }

                    foreach (InventoryItem inventoryItem in shipmentItem.ReservedFromInventoryItems)
                    {
                        if (inventoryItem.Part.InventoryItemKind.IsSerialised)
                        {
                            new InventoryItemTransactionBuilder(this.Session())
                            .WithPart(shipmentItem.Part)
                            .WithSerialisedItem(shipmentItem.SerialisedItem)
                            .WithUnitOfMeasure(inventoryItem.Part.UnitOfMeasure)
                            .WithFacility(inventoryItem.Facility)
                            .WithReason(new InventoryTransactionReasons(this.Strategy.Session).OutgoingShipment)
                            .WithSerialisedInventoryItemState(new SerialisedInventoryItemStates(this.Session()).Good)
                            .WithQuantity(1)
                            .Build();
                        }
                        else
                        {
                            new InventoryItemTransactionBuilder(this.Session())
                            .WithPart(inventoryItem.Part)
                            .WithUnitOfMeasure(inventoryItem.Part.UnitOfMeasure)
                            .WithFacility(inventoryItem.Facility)
                            .WithReason(new InventoryTransactionReasons(this.Strategy.Session).OutgoingShipment)
                            .WithQuantity(shipmentItem.Quantity)
                            .WithCost(inventoryItem.Part.PartWeightedAverage.AverageCost)
                            .Build();
                        }
                    }
                }
            }
        }
Beispiel #3
0
 public void AppsShip(CustomerShipmentShip method)
 {
     if (this.CanShip)
     {
         this.CurrentObjectState = new CustomerShipmentObjectStates(this.Strategy.Session).Shipped;
         this.EstimatedShipDate = DateTime.UtcNow.Date;
     }
 }