Exemple #1
0
        protected virtual IEnumerable spdocs()
        {
            List <ARSPCommnDocResult> res = new List <ARSPCommnDocResult>();
            SPDocFilter filter            = (SPDocFilter)this.Filter.Current;

            if (filter != null && filter.SalesPersonID != null && filter.CommnPeriod != null)
            {
                PXSelectBase <ARSalesPerTran> sel = new PXSelectJoin <ARSalesPerTran,
                                                                      InnerJoin <ARRegister, On <ARSalesPerTran.docType, Equal <ARRegister.docType>,
                                                                                                 And <ARSalesPerTran.refNbr, Equal <ARRegister.refNbr> > >,
                                                                                 InnerJoinSingleTable <Customer, On <Customer.bAccountID, Equal <ARRegister.customerID>,
                                                                                                                     And <Match <Customer, Current <AccessInfo.userName> > > > > >,
                                                                      Where <ARSalesPerTran.salespersonID, Equal <Current <SPDocFilter.salesPersonID> >,
                                                                             And <ARSalesPerTran.commnPaymntPeriod, Equal <Current <SPDocFilter.commnPeriod> >,
                                                                                  And <ARSalesPerTran.actuallyUsed, Equal <BQLConstants.BitOn> > > > >(this);
                if (filter.CustomerID != null)
                {
                    sel.WhereAnd <Where <ARRegister.customerID, Equal <Current <SPDocFilter.customerID> > > >();
                }
                if (filter.LocationID != null)
                {
                    sel.WhereAnd <Where <ARRegister.customerLocationID, Equal <Current <SPDocFilter.locationID> > > >();
                }

                foreach (PXResult <ARSalesPerTran, ARRegister, Customer> it in sel.Select())
                {
                    ARSPCommnDocResult m = new ARSPCommnDocResult();
                    Copy(m, ((ARSalesPerTran)it));
                    Copy(m, ((ARRegister)it));
                    res.Add(m);
                }
            }
            return(res);
        }
        public virtual void SPDocFilter_CustomerID_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
        {
            SPDocFilter row = (SPDocFilter)e.Row;

            //row.LocationID = null;
            cache.SetDefaultExt <SPDocFilter.locationID>(e.Row);
            cache.SetValuePending <SPDocFilter.locationID>(e.Row, null);
        }
        public virtual void SPDocFilter_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            SPDocFilter row = (SPDocFilter)e.Row;
            //PXUIFieldAttribute.SetEnabled<SPDocFilter.locationID>(cache, row, (row.CustomerID.HasValue));
        }
Exemple #4
0
 public virtual IEnumerable ViewDetails(PXAdapter adapter)
 {
     if (this.CommissionsHistory.Current != null)
     {
         ARSPCommnHistory     current = this.CommissionsHistory.Current;
         ARSPCommissionDocEnq graph   = PXGraph.CreateInstance <ARSPCommissionDocEnq>();
         SPDocFilter          filter  = graph.Filter.Current;
         filter.SalesPersonID = current.SalesPersonID;
         filter.CommnPeriod   = current.CommnPeriod;
         graph.Filter.Update(filter);
         throw new PXRedirectRequiredException(graph, "Document");
     }
     return(adapter.Get());
 }
        protected virtual IEnumerable spdocs()
        {
            List <ARSPCommnDocResult> res = new List <ARSPCommnDocResult>();
            SPDocFilter filter            = Filter.Current;

            if (filter?.CommnPeriod != null)
            {
                PXSelectBase <ARSalesPerTran> sel = new PXSelectJoin <ARSalesPerTran,
                                                                      InnerJoin <ARRegister, On <ARSalesPerTran.docType, Equal <ARRegister.docType>,
                                                                                                 And <ARSalesPerTran.refNbr, Equal <ARRegister.refNbr> > >,
                                                                                 InnerJoinSingleTable <Customer, On <Customer.bAccountID, Equal <ARRegister.customerID>,
                                                                                                                     And <Match <Customer, Current <AccessInfo.userName> > > > > >,
                                                                      Where <ARSalesPerTran.actuallyUsed, Equal <BQLConstants.BitOn> > >(this);

                if (filter.SalesPersonID != null)
                {
                    sel.WhereAnd <Where <ARSalesPerTran.salespersonID, Equal <Current <SPDocFilter.salesPersonID> > > >();
                }
                if (filter.CommnPeriod != null)
                {
                    sel.WhereAnd <Where <ARSalesPerTran.commnPaymntPeriod, Equal <Current <SPDocFilter.commnPeriod> > > >();
                }
                if (filter.CustomerID != null)
                {
                    sel.WhereAnd <Where <ARRegister.customerID, Equal <Current <SPDocFilter.customerID> > > >();
                }
                if (filter.LocationID != null)
                {
                    sel.WhereAnd <Where <ARRegister.customerLocationID, Equal <Current <SPDocFilter.locationID> > > >();
                }

                PXView        view              = sel.View;
                int           startRow          = PXView.StartRow;
                int           totalRows         = 0;
                List <object> windowedSelection = view.Select(PXView.Currents, PXView.Parameters, PXView.Searches, PXView.SortColumns, PXView.Descendings, PXView.Filters, ref startRow, PXView.MaximumRows, ref totalRows);
                PXView.StartRow = 0;

                foreach (PXResult <ARSalesPerTran, ARRegister, Customer> it in windowedSelection)
                {
                    ARSPCommnDocResult m = new ARSPCommnDocResult();
                    Copy(m, ((ARSalesPerTran)it));
                    Copy(m, ((ARRegister)it));
                    res.Add(m);
                }
            }
            return(res);
        }