예제 #1
0
        public static PXGraph FindSourceDocumentGraph(CCProcTran tran)
        {
            PXGraph target = null;

            if (tran != null)
            {
                if (tran.DocType == ARDocType.CashSale || tran.DocType == ARDocType.Payment)
                {
                    if (tran.DocType == ARDocType.Payment)
                    {
                        ARPaymentEntry graph = PXGraph.CreateInstance <ARPaymentEntry>();
                        graph.Document.Current = graph.Document.Search <ARPayment.refNbr>(tran.RefNbr, tran.DocType);
                        if (graph.Document.Current != null)
                        {
                            target = graph;
                        }
                    }
                    if (tran.DocType == ARDocType.Payment)
                    {
                        ARCashSaleEntry graph = PXGraph.CreateInstance <ARCashSaleEntry>();
                        graph.Document.Current = graph.Document.Search <PX.Objects.AR.Standalone.ARCashSale.refNbr>(tran.RefNbr, tran.DocType);
                        if (graph.Document.Current != null)
                        {
                            target = graph;
                        }
                    }
                }
                if (tran.DocType == ARDocType.Invoice)
                {
                    SO.SOInvoiceEntry graph = PXGraph.CreateInstance <SO.SOInvoiceEntry>();
                    graph.Document.Current = graph.Document.Search <ARInvoice.refNbr>(tran.RefNbr, tran.DocType);
                    if (graph.Document.Current != null)
                    {
                        target = graph;
                    }
                }
                if (target == null && !String.IsNullOrEmpty(tran.OrigRefNbr))
                {
                    SO.SOOrderEntry graph = PXGraph.CreateInstance <SO.SOOrderEntry>();
                    graph.Document.Current = graph.Document.Search <SO.SOOrder.orderNbr>(tran.OrigRefNbr, tran.OrigDocType);
                    if (graph.Document.Current != null)
                    {
                        target = graph;
                    }
                }
            }
            return(target);
        }
예제 #2
0
        public static PXGraph FindSourceDocumentGraph(string docType, string refNbr, string origDocType, string origRefNbr)
        {
            PXGraph target = null;

            if (docType == ARDocType.Payment || docType == ARDocType.VoidPayment)
            {
                ARPaymentEntry graph = PXGraph.CreateInstance <ARPaymentEntry>();
                graph.Document.Current = graph.Document.Search <ARPayment.refNbr>(refNbr, docType);
                if (graph.Document.Current != null)
                {
                    target = graph;
                }
            }
            if (docType == ARDocType.CashSale)
            {
                ARCashSaleEntry graph = PXGraph.CreateInstance <ARCashSaleEntry>();
                graph.Document.Current = graph.Document.Search <Standalone.ARCashSale.refNbr>(refNbr, docType);
                if (graph.Document.Current != null)
                {
                    target = graph;
                }
            }
            if (docType == ARDocType.Invoice)
            {
                SO.SOInvoiceEntry graph = PXGraph.CreateInstance <SO.SOInvoiceEntry>();
                graph.Document.Current = graph.Document.Search <ARInvoice.refNbr>(refNbr, docType);
                if (graph.Document.Current != null)
                {
                    target = graph;
                }
            }
            if (target == null && !string.IsNullOrEmpty(origRefNbr))
            {
                SO.SOOrderEntry graph = PXGraph.CreateInstance <SO.SOOrderEntry>();
                graph.Document.Current = graph.Document.Search <SO.SOOrder.orderNbr>(origRefNbr, origDocType);
                if (graph.Document.Current != null)
                {
                    target = graph;
                }
            }
            return(target);
        }
        public virtual IEnumerable viewOrigDocument(PXAdapter adapter)
        {
            ExternalTransactionExt tran = this.PaymentTrans.Current;

            if (tran != null && !string.IsNullOrWhiteSpace(tran.OrigRefNbr))
            {
                SO.SOOrderEntry graph = PXGraph.CreateInstance <SO.SOOrderEntry>();
                graph.Document.Current = graph.Document.Search <SO.SOOrder.orderNbr>(tran.OrigRefNbr, tran.OrigDocType);

                if (graph.Document.Current != null)
                {
                    throw new PXRedirectRequiredException(graph, true, Messages.ViewOrigDocument)
                          {
                              Mode = PXBaseRedirectException.WindowMode.NewWindow
                          }
                }
                ;
            }
            return(Filter.Select());
        }