public virtual IEnumerable ViewDoc(PXAdapter adapter)
        {
            CABankTranMatch match =
                PXSelect <CABankTranMatch,
                          Where <CABankTranMatch.tranID, Equal <Required <CABankTran.tranID> >,
                                 And <CABankTranMatch.tranType, Equal <Required <CABankTran.tranType> > > > >
                .Select(this, Result.Current.TranID, Result.Current.TranType);

            if (match.DocModule == BatchModule.EP)
            {
                RedirectionToOrigDoc.TryRedirect(match.DocType, match.DocRefNbr, match.DocModule);
            }
            else
            {
                CATran tran = null;
                if (match.DocModule == BatchModule.AP && match.DocType == CATranType.CABatch)
                {
                    tran = new CATran()
                    {
                        OrigTranType = CATranType.CABatch,
                        OrigModule   = BatchModule.AP,
                        OrigRefNbr   = match.DocRefNbr
                    };
                }
                else
                {
                    tran = PXSelect <CATran, Where <CATran.tranID, Equal <Required <CABankTranMatch.cATranID> > > > .Select(this, match.CATranID);
                }


                CATran.Redirect(TranFilter.Cache, tran);
            }
            return(adapter.Get());
        }
        public static void Redirect(PXGraph graph, CABankTranMatch match)
        {
            if (match.DocModule == GL.BatchModule.AP && match.DocType == CATranType.CABatch && match.DocRefNbr != null)
            {
                CABatchEntry docGraph = PXGraph.CreateInstance <CABatchEntry>();
                docGraph.Clear();
                docGraph.Document.Current = PXSelect <CABatch, Where <CABatch.batchNbr, Equal <Required <CATran.origRefNbr> > > > .Select(docGraph, match.DocRefNbr);

                throw new PXRedirectRequiredException(docGraph, true, "Document")
                      {
                          Mode = PXBaseRedirectException.WindowMode.NewWindow
                      };
            }
            else if (match.CATranID != null)
            {
                CATran catran = PXSelect <CATran, Where <CATran.tranID, Equal <Required <CABankTranMatch.cATranID> > > > .Select(graph, match.CATranID);

                CATran.Redirect(null, catran);
            }
            else if (match.DocModule != null && match.DocType != null && match.DocRefNbr != null)
            {
                RedirectionToOrigDoc.TryRedirect(match.DocType, match.DocRefNbr, match.DocModule);
            }
        }
 protected virtual IEnumerable viewRetainageDocument(PXAdapter adapter)
 {
     RedirectionToOrigDoc.TryRedirect(RetainageDocuments.Current.DocType, RetainageDocuments.Current.RefNbr, RetainageDocuments.Current.OrigModule);
     return(adapter.Get());
 }
Example #4
0
 protected virtual IEnumerable viewCorrectionDocument(PXAdapter adapter)
 {
     RedirectionToOrigDoc.TryRedirect(Base.Document.Current.CorrectionDocType, Base.Document.Current.CorrectionRefNbr, GL.BatchModule.SO);
     return(adapter.Get());
 }