Beispiel #1
0
        protected virtual IEnumerable AccountByPeriod(PXAdapter adapter)
        {
            if (this.EnqResult.Current != null)
            {
                AccountHistoryByYearEnq graph  = PXGraph.CreateInstance <AccountHistoryByYearEnq>();
                AccountByYearFilter     filter = PXCache <AccountByYearFilter> .CreateCopy(graph.Filter.Current);

                filter.OrgBAccountID  = Filter.Current.OrgBAccountID;
                filter.OrganizationID = Filter.Current.OrganizationID;
                filter.BranchID       = EnqResult.Current.BranchID;
                filter.LedgerID       = Filter.Current.LedgerID;
                filter.AccountID      = EnqResult.Current.AccountID;
                filter.SubCD          = Filter.Current.SubCD;
                filter.FinPeriodID    = EnqResult.Current.LastActivityPeriod;

                OrganizationFinPeriod fp = PXSelect <
                    OrganizationFinPeriod,
                    Where <OrganizationFinPeriod.finPeriodID, Equal <Required <OrganizationFinPeriod.finPeriodID> >,
                           And <OrganizationFinPeriod.organizationID, Equal <Required <OrganizationFinPeriod.organizationID> > > > >
                                           .Select(this, filter.FinPeriodID, PXAccess.GetParentOrganizationID(filter.BranchID));

                if (fp != null)
                {
                    filter.FinYear = fp.FinYear;
                }

                filter.ShowCuryDetail = this.Filter.Current.ShowCuryDetail;
                graph.Filter.Update(filter);
                throw new PXRedirectRequiredException(graph, "Account By Period");
            }
            return(adapter.Get());
        }
 public virtual IEnumerable AccountByPeriodEnq(PXAdapter adapter)
 {
     if (AccountRecords.Current != null)
     {
         AccountHistoryByYearEnq graph = CreateInstance <AccountHistoryByYearEnq>();
         graph.Filter.Current.AccountID = AccountRecords.Current.AccountID;
         throw new PXRedirectRequiredException(graph, false, Messages.ViewAccountByPeriod);
     }
     return(adapter.Get());
 }