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)
            {
                if (match.DocModule == GL.BatchModule.AP)
                {
                    AP.APInvoiceEntry docGraph = PXGraph.CreateInstance <AP.APInvoiceEntry>();
                    docGraph.Clear();
                    AP.APInvoice invoice = PXSelect <AP.APInvoice, Where <AP.APInvoice.refNbr, Equal <Required <CABankTranMatch.docRefNbr> >, And <AP.APInvoice.docType, Equal <Required <CABankTranMatch.docType> > > > > .Select(docGraph, match.DocRefNbr, match.DocType);

                    docGraph.Document.Current = invoice;
                    throw new PXRedirectRequiredException(docGraph, true, "Document")
                          {
                              Mode = PXBaseRedirectException.WindowMode.NewWindow
                          };
                }
                else if (match.DocModule == GL.BatchModule.AR)
                {
                    AR.ARInvoiceEntry docGraph = PXGraph.CreateInstance <AR.ARInvoiceEntry>();
                    docGraph.Clear();
                    AR.ARInvoice invoice = PXSelect <AR.ARInvoice, Where <AR.ARInvoice.refNbr, Equal <Required <CABankTranMatch.docRefNbr> >, And <AR.ARInvoice.docType, Equal <Required <CABankTranMatch.docType> > > > > .Select(docGraph, match.DocRefNbr, match.DocType);

                    docGraph.Document.Current = invoice;
                    throw new PXRedirectRequiredException(docGraph, true, "Document")
                          {
                              Mode = PXBaseRedirectException.WindowMode.NewWindow
                          };
                }
            }
        }
예제 #3
0
 public virtual IEnumerable ViewDoc(PXAdapter adapter)
 {
     CATran.Redirect(Filter.Cache, CATranListRecords.Current);
     return(Filter.Select());
 }