public virtual void CleanPostInfo(PXGraph cleanerGraph, FSPostDet fsPostDetRow)
 {
     PXUpdate <
         Set <FSPostInfo.aRLineNbr, Null,
              Set <FSPostInfo.arRefNbr, Null,
                   Set <FSPostInfo.arDocType, Null,
                        Set <FSPostInfo.aRPosted, False> > > >,
         FSPostInfo,
         Where <
             FSPostInfo.postID, Equal <Required <FSPostInfo.postID> >,
             And <FSPostInfo.aRPosted, Equal <True> > > >
     .Update(cleanerGraph, fsPostDetRow.PostID);
 }
        public virtual void openDocumentByService()
        {
            if (Services.Current == null)
            {
                return;
            }

            FSPostDet fsPostDetRow = PXSelect <FSPostDet,
                                               Where <
                                                   FSPostDet.postDetID, Equal <Required <FSPostDet.postDetID> > > >
                                     .SelectSingleBound(this, null, Services.Current.PostID);

            openDocument(fsPostDetRow);
        }
        public virtual void openDocumentByPickUpDeliveryItem()
        {
            if (PickUpDeliveryItems.Current == null)
            {
                return;
            }

            FSPostDet fsPostDetRow = PXSelect <FSPostDet,
                                               Where <
                                                   FSPostDet.postDetID, Equal <Required <FSPostDet.postDetID> > > >
                                     .SelectSingleBound(this, null, PickUpDeliveryItems.Current.PostID);

            openDocument(fsPostDetRow);
        }
 private void openDocument(FSPostDet fsPostDetRow)
 {
     if (fsPostDetRow.SOPosted == true)
     {
         if (PXAccess.FeatureInstalled <FeaturesSet.distributionModule>())
         {
             SOOrderEntry graphSOOrderEntry = PXGraph.CreateInstance <SOOrderEntry>();
             graphSOOrderEntry.Document.Current = graphSOOrderEntry.Document.Search <SOOrder.orderNbr>(fsPostDetRow.SOOrderNbr, fsPostDetRow.SOOrderType);
             throw new PXRedirectRequiredException(graphSOOrderEntry, null)
                   {
                       Mode = PXBaseRedirectException.WindowMode.NewWindow
                   };
         }
     }
     else if (fsPostDetRow.ARPosted == true)
     {
         ARInvoiceEntry graphARInvoiceEntry = PXGraph.CreateInstance <ARInvoiceEntry>();
         graphARInvoiceEntry.Document.Current = graphARInvoiceEntry.Document.Search <ARInvoice.refNbr>(fsPostDetRow.ARRefNbr, fsPostDetRow.ARDocType);
         throw new PXRedirectRequiredException(graphARInvoiceEntry, null)
               {
                   Mode = PXBaseRedirectException.WindowMode.NewWindow
               };
     }
     else if (fsPostDetRow.SOInvPosted == true)
     {
         SOInvoiceEntry graphSOInvoiceEntry = PXGraph.CreateInstance <SOInvoiceEntry>();
         graphSOInvoiceEntry.Document.Current = graphSOInvoiceEntry.Document.Search <ARInvoice.refNbr>(fsPostDetRow.ARRefNbr, fsPostDetRow.ARDocType);
         throw new PXRedirectRequiredException(graphSOInvoiceEntry, null)
               {
                   Mode = PXBaseRedirectException.WindowMode.NewWindow
               };
     }
     else if (fsPostDetRow.APPosted == true)
     {
         APInvoiceEntry graphAPInvoiceEntry = PXGraph.CreateInstance <APInvoiceEntry>();
         graphAPInvoiceEntry.Document.Current = graphAPInvoiceEntry.Document.Search <APInvoice.refNbr>(fsPostDetRow.APRefNbr, fsPostDetRow.APDocType);
         throw new PXRedirectRequiredException(graphAPInvoiceEntry, null)
               {
                   Mode = PXBaseRedirectException.WindowMode.NewWindow
               };
     }
 }
Example #5
0
        public virtual void openDocument()
        {
            InventoryPostingBatchDetail inventoryPostingBatchDetailRow = BatchDetailsInfo.Current;

            FSPostDet fsPostDetRow = PXSelectJoin <FSPostDet,
                                                   InnerJoin <FSPostInfo,
                                                              On <FSPostInfo.postID, Equal <FSPostDet.postID> >,
                                                              InnerJoin <FSAppointmentDet,
                                                                         On <FSAppointmentDet.postID, Equal <FSPostInfo.postID> > > >,
                                                   Where <
                                                       FSPostDet.batchID, Equal <Current <FSPostBatch.batchID> >,
                                                       And <FSAppointmentDet.appDetID, Equal <Required <FSAppointmentDet.appDetID> > > > >
                                     .Select(this, inventoryPostingBatchDetailRow.AppointmentInventoryItemID);

            if (fsPostDetRow != null && fsPostDetRow.INPosted == true)
            {
                if (fsPostDetRow.INDocType.Trim() == INDocType.Receipt)
                {
                    INReceiptEntry graphINReceiptEntry = PXGraph.CreateInstance <INReceiptEntry>();
                    graphINReceiptEntry.receipt.Current = graphINReceiptEntry.receipt.Search <INRegister.refNbr>(fsPostDetRow.INRefNbr);
                    throw new PXRedirectRequiredException(graphINReceiptEntry, null)
                          {
                              Mode = PXBaseRedirectException.WindowMode.NewWindow
                          };
                }
                else
                {
                    INIssueEntry graphINIssueEntry = PXGraph.CreateInstance <INIssueEntry>();
                    graphINIssueEntry.issue.Current = graphINIssueEntry.issue.Search <INRegister.refNbr>(fsPostDetRow.INRefNbr);
                    throw new PXRedirectRequiredException(graphINIssueEntry, null)
                          {
                              Mode = PXBaseRedirectException.WindowMode.NewWindow
                          };
                }
            }
        }
        /// <summary>
        /// Update the references in <c>FSPostInfo</c> and <c>FSPostDet</c> when the posting process of every AppointmentInventoryItem is complete in IN.
        /// </summary>
        public virtual void UpdateIssuePostInfo(INIssueEntry graphINIssueEntry, InventoryPostBatchMaint graphInventoryPostBatchMaint, PostInfoEntry graphPostInfoEntry, FSAppointmentDet fsAppointmentInventoryItemRow, SharedClasses.AppointmentInventoryItemInfo appointmentInventoryItemInfoRow, FSPostBatch fsPostBatchRow)
        {
            //Create | Update Post info
            FSPostInfo fsPostInfoRow;
            FSPostDet  fsPostDet;

            fsPostBatchRow = graphInventoryPostBatchMaint.BatchRecords.Current = graphInventoryPostBatchMaint.BatchRecords.Search <FSPostBatch.batchID>(fsPostBatchRow.BatchID);

            fsPostInfoRow = PXSelect <FSPostInfo,
                                      Where <
                                          FSPostInfo.postID, Equal <Required <FSPostInfo.postID> > > >
                            .Select(this, appointmentInventoryItemInfoRow.FSAppointmentInventoryItem.PostID);

            if (fsPostInfoRow == null || fsPostInfoRow.PostID == null)
            {
                fsPostInfoRow = new FSPostInfo();
                fsPostInfoRow = graphPostInfoEntry.PostInfoRecords.Current = graphPostInfoEntry.PostInfoRecords.Insert(fsPostInfoRow);
            }
            else
            {
                fsPostInfoRow = graphPostInfoEntry.PostInfoRecords.Current = graphPostInfoEntry.PostInfoRecords.Search <FSPostInfo.postID>(fsPostInfoRow.PostID);
            }

            fsPostInfoRow.INPosted  = true;
            fsPostInfoRow.INDocType = graphINIssueEntry.issue.Current.DocType;
            fsPostInfoRow.INRefNbr  = graphINIssueEntry.issue.Current.RefNbr;

            foreach (INTran inTranRowLocal in graphINIssueEntry.transactions.Select())
            {
                FSxINTran fsxINTranRow = graphINIssueEntry.transactions.Cache.GetExtension <FSxINTran>(inTranRowLocal);

                if (fsxINTranRow != null && appointmentInventoryItemInfoRow.FSAppointmentInventoryItem.AppDetID == fsxINTranRow.AppDetID)
                {
                    fsPostInfoRow.INLineNbr = inTranRowLocal.LineNbr;
                    break;
                }
            }

            fsPostInfoRow.AppointmentID = appointmentInventoryItemInfoRow.FSAppointmentRow.AppointmentID;
            fsPostInfoRow.SOID          = appointmentInventoryItemInfoRow.FSAppointmentRow.SOID;

            fsPostInfoRow = graphPostInfoEntry.PostInfoRecords.Update(fsPostInfoRow);

            graphPostInfoEntry.Save.Press();
            fsPostInfoRow = graphPostInfoEntry.PostInfoRecords.Current;

            fsPostDet = new FSPostDet();

            fsPostDet.PostID    = fsPostInfoRow.PostID;
            fsPostDet.INPosted  = fsPostInfoRow.INPosted;
            fsPostDet.INDocType = fsPostInfoRow.INDocType;
            fsPostDet.INRefNbr  = fsPostInfoRow.INRefNbr;
            fsPostDet.INLineNbr = fsPostInfoRow.INLineNbr;

            graphInventoryPostBatchMaint.BatchDetails.Insert(fsPostDet);
            graphInventoryPostBatchMaint.Save.Press();

            fsAppointmentInventoryItemRow.Mem_BatchNbr = fsPostBatchRow.BatchNbr;

            fsPostInfoRow = graphPostInfoEntry.PostInfoRecords.Current;

            PXUpdate <
                Set <FSAppointmentDet.postID, Required <FSAppointmentDet.postID> >,
                FSAppointmentDet,
                Where <
                    FSAppointmentDet.appDetID, Equal <Required <FSAppointmentDet.appDetID> > > >
            .Update(this, fsPostInfoRow.PostID, appointmentInventoryItemInfoRow.FSAppointmentInventoryItem.AppDetID);
        }