Beispiel #1
0
        public bool Run(ShipmentFacts facts, Packlist packlist)
        {
            m_uow = facts.SalesOrder.Session;

            // Associate shipment with sales order
            Shipment shipment = ShipmentMapper.MapFrom(facts);

            // Update the new lot qty after the shipment
            shipment.Item.Ship(shipment);

            // Create Transaction
            // implicit data record creation
            TransactionMapper.MapFrom(shipment);

            // Tell the line item to update its status from this shipment
            shipment.LineItem.UpdateStatusFromShipment(shipment.Qty);

            // Add shipment to packlist
            packlist.AddShipment(shipment);

            //Persist
            Scout.Core.Data.Save(m_uow);

            return(true);
        }
Beispiel #2
0
        public void SetPacklistPrintDate(string packlistId, DateTime printDate)
        {
            IUnitOfWork uow      = Scout.Core.Data.GetUnitOfWork();
            Packlist    packlist =
                Scout.Core.Data.Get <Packlist>(uow).ByCriteria("[PacklistId]='" + packlistId + "'");

            packlist.PrintDate = printDate;
            uow.Commit();
        }
Beispiel #3
0
        private Packlist NewPacklist()
        {
            Packlist newPacklist = new Packlist(Session as Session);

            newPacklist.SalesOrder = this;
            newPacklist.PacklistId = ShippingUtils.GeneratePacklistId();
            newPacklist.ShipDate   = DateTime.Now;
            Packlists.Add(newPacklist);

            // Reset the new packlist upon shipment flag
            // so that a new packlist is not generated
            // upon each new shipment for this sequence.
            m_newPacklistUponShipment = false;

            return(newPacklist);
        }
Beispiel #4
0
        public Packlist GetTodaysPacklist()
        {
            if (Packlists.Count == 0)
            {
                return(null);
            }

            Packlist packlist = Packlists[Packlists.Count - 1];

            if (packlist == null || packlist.ShipDate.Date != DateTime.Today)
            {
                return(null);
            }

            return(packlist);
        }
Beispiel #5
0
        public Packlist GetCurrentPacklist()
        {
            if (AssignedPacklist != null)
            {
                return(AssignedPacklist);
            }

            Packlist todaysPacklist = GetTodaysPacklist();

            if (todaysPacklist != null && NewPacklistUponShipment == false)
            {
                return(todaysPacklist);
            }


            return(NewPacklist());
        }