示例#1
0
        protected virtual IEnumerable Action(PXAdapter adapter,
                                             [PXInt]
                                             [SOShipmentEntryActions]
                                             int?actionID,
                                             [PXString()]
                                             string ActionName
                                             )
        {
            object queueName = null;

            if (actionID == SOShipmentEntryActionsAttribute.PrintPickList && adapter.Arguments.TryGetValue("PrintQueue", out queueName) && !String.IsNullOrEmpty(queueName as string))
            {
                GL.Branch company = null;
                using (new PXReadBranchRestrictedScope())
                {
                    company = Base.Company.Select();
                }

                using (PXTransactionScope ts = new PXTransactionScope())
                {
                    var jobMaint = PXGraph.CreateInstance <PrintJobMaint>();
                    foreach (SOShipment shipment in adapter.Get <SOShipment>())
                    {
                        Base.Document.Current = shipment;
                        string actualReportID = new NotificationUtility(Base).SearchReport(ARNotificationSource.Customer, Base.customer.Current, "SO644000", company.BranchID);
                        jobMaint.AddPrintJob(PXMessages.LocalizeFormatNoPrefix(WM.Messages.PrintPickList, shipment.ShipmentNbr), queueName as string, actualReportID, new Dictionary <string, string> {
                            { "ShipmentNbr", shipment.ShipmentNbr }
                        });
                        shipment.PickListPrinted = true;
                        Base.Document.Update(shipment);
                    }
                    Base.Save.Press();
                    ts.Complete();
                }

                return(adapter.Get());
            }
            else
            {
                return(Base.action.Press(adapter));
            }
        }
示例#2
0
        public static BranchRUTROT GetBranchRUTROT(SOOrderEntry graph)
        {
            GL.Branch branch = PXSelect <GL.Branch, Where <GL.Branch.branchID, Equal <Current <AccessInfo.branchID> > > > .Select(graph);

            return(RUTROTHelper.GetExtensionNullable <GL.Branch, BranchRUTROT>(branch));
        }