Exemplo n.º 1
0
        public virtual IEnumerable LastVendor(PXAdapter adapter)
        {
            AP1099YearMaster filter      = (AP1099YearMaster)YearVendorHeader.Current;
            Vendor           next_vendor = (Vendor)PXSelect <Vendor, Where <Vendor.vendor1099, Equal <True> >, OrderBy <Desc <Vendor.acctCD> > > .Select(this);

            if (next_vendor != null)
            {
                filter.VendorID = next_vendor.BAccountID;
            }
            return(adapter.Get());
        }
Exemplo n.º 2
0
        public virtual IEnumerable Year1099DetailReport(PXAdapter adapter)
        {
            AP1099YearMaster filter = YearVendorHeader.Current;

            if (filter != null)
            {
                Dictionary <string, string> parameters = new Dictionary <string, string>();
                Organization org = OrganizationMaint.FindOrganizationByID(this, filter.OrganizationID);
                parameters["OrganizationID"] = org?.OrganizationCD;
                parameters["FinYear"]        = filter.FinYear;
                throw new PXReportRequiredException(parameters, "AP654500", Messages.Year1099DetailReport);
            }
            return(adapter.Get());
        }
        public virtual IEnumerable Year1099DetailReport(PXAdapter adapter)
        {
            AP1099YearMaster filter = YearVendorHeader.Current;

            if (filter != null)
            {
                Dictionary <string, string> parameters = new Dictionary <string, string>();
                Branch cbranch = PXSelect <Branch, Where <Branch.branchID, Equal <Current <AP1099YearMaster.masterBranchID> > > > .Select(this);

                parameters["MasterBranchID"] = cbranch != null ? cbranch.BranchCD : null;
                parameters["FinYear"]        = filter.FinYear;
                throw new PXReportRequiredException(parameters, "AP654500", Messages.Year1099DetailReport);
            }
            return(adapter.Get());
        }
Exemplo n.º 4
0
        public virtual IEnumerable PreviousVendor(PXAdapter adapter)
        {
            AP1099YearMaster filter = (AP1099YearMaster)YearVendorHeader.Current;
            Vendor           vendor = (Vendor)PXSelect <Vendor, Where <Vendor.bAccountID, Equal <Current <AP1099YearMaster.vendorID> > > > .Select(this);

            if (vendor == null)
            {
                vendor        = new Vendor();
                vendor.AcctCD = "";
            }
            Vendor next_vendor = (Vendor)PXSelect <Vendor, Where <Vendor.vendor1099, Equal <True>, And <Vendor.acctCD, Less <Required <Vendor.acctCD> > > > > .Select(this, vendor.AcctCD);

            if (next_vendor != null)
            {
                filter.VendorID = next_vendor.BAccountID;
            }
            return(adapter.Get());
        }
Exemplo n.º 5
0
        public virtual IEnumerable Year1099DetailReport(PXAdapter adapter)
        {
            AP1099YearMaster filter = YearVendorHeader.Current;

            if (filter != null)
            {
                BAccountR bAccount = SelectFrom <BAccountR>
                                     .Where <BAccountR.bAccountID.IsEqual <@P.AsInt> >
                                     .View
                                     .Select(this, filter.OrgBAccountID);

                Dictionary <string, string> parameters = new Dictionary <string, string>
                {
                    ["PayerBAccountID"] = bAccount.AcctCD,
                    ["FinYear"]         = filter.FinYear
                };
                throw new PXReportRequiredException(parameters, "AP654500", Messages.Year1099DetailReport);
            }
            return(adapter.Get());
        }