示例#1
0
        protected virtual void APSetup_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e)
        {
            APSetup row = e.Row as APSetup;

            if (row == null)
            {
                return;
            }

            if (row != null && (!sender.ObjectsEqual <APSetup.retentionType>(e.Row, e.OldRow) || !sender.ObjectsEqual <APSetup.numberOfMonths>(e.Row, e.OldRow)))
            {
                if (row.RetentionType == AR.RetentionTypeList.LastPrice)
                {
                    sender.RaiseExceptionHandling <APSetup.retentionType>(e.Row, ((APSetup)e.Row).RetentionType, new PXSetPropertyException(Messages.LastPriceWarning, PXErrorLevel.Warning));
                }
                if (row.RetentionType == AR.RetentionTypeList.FixedNumOfMonths)
                {
                    if (row.NumberOfMonths != 0)
                    {
                        sender.RaiseExceptionHandling <APSetup.retentionType>(e.Row, ((APSetup)e.Row).RetentionType, new PXSetPropertyException(Messages.HistoricalPricesWarning, PXErrorLevel.Warning, row.NumberOfMonths));
                    }
                    if (row.NumberOfMonths == 0)
                    {
                        sender.RaiseExceptionHandling <APSetup.retentionType>(e.Row, ((APSetup)e.Row).RetentionType, new PXSetPropertyException(Messages.HistoricalPricesUnlimitedWarning, PXErrorLevel.Warning, row.NumberOfMonths));
                    }
                }
            }
        }
示例#2
0
        public AP1099SummaryEnq()
        {
            APSetup setup = APSetup.Current;

            PXUIFieldAttribute.SetEnabled <AP1099Box.boxNbr>(Year_Summary.Cache, null, false);
            PXUIFieldAttribute.SetEnabled <AP1099Box.descr>(Year_Summary.Cache, null, false);
        }
示例#3
0
        public APApproveBills()
        {
            APSetup setup = APSetup.Current;

            Views["_ApproveBillsFilter_curyInfoID_CurrencyInfo.CuryInfoID_"] = new PXView(this, false, new Select <ApproveBillsFilter>(), new PXSelectDelegate(Filter.Get));
            PXUIFieldAttribute.SetDisplayName <APInvoice.paySel>(APDocumentList.Cache, PXLocalizer.Localize(Messages.Selected, typeof(Messages).FullName));
        }
        public APScheduleRun()
        {
            APSetup setup = APSetup.Current;

            Schedule_List.SetProcessCaption("Run Selected");
            Schedule_List.SetProcessAllCaption("Run All");
        }
示例#5
0
        protected virtual void APSetup_MigrationMode_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
        {
            APSetup row = e.Row as APSetup;

            if (row == null)
            {
                return;
            }

            bool?oldvalue = (bool?)e.OldValue;

            if (row.MigrationMode == true && oldvalue != true)
            {
                GLTran glTransactionFromModule = PXSelect <GLTran,
                                                           Where <GLTran.module, Equal <BatchModule.moduleAP> > > .SelectSingleBound(this, null);

                if (glTransactionFromModule != null)
                {
                    sender.RaiseExceptionHandling <APSetup.migrationMode>(row, row.MigrationMode,
                                                                          new PXSetPropertyException(Common.Messages.MigrationModeActivateGLTransactionFromModuleExist, PXErrorLevel.Warning));
                }
            }
            else if (row.MigrationMode != true && oldvalue == true)
            {
                APRegister unreleasedMigratedDocument = PXSelect <APRegister,
                                                                  Where <APRegister.released, NotEqual <True>,
                                                                         And <APRegister.isMigratedRecord, Equal <True> > > > .SelectSingleBound(this, null);

                if (unreleasedMigratedDocument != null)
                {
                    sender.RaiseExceptionHandling <APSetup.migrationMode>(row, row.MigrationMode,
                                                                          new PXSetPropertyException(Common.Messages.MigrationModeDeactivateUnreleasedMigratedDocumentExist, PXErrorLevel.Warning));
                }
            }
        }
        public AP1099DetailEnq()
        {
            APSetup setup = APSetup.Current;

            PXUIFieldAttribute.SetEnabled <AP1099Box.boxNbr>(YearVendor_Summary.Cache, null, false);
            PXUIFieldAttribute.SetEnabled <AP1099Box.descr>(YearVendor_Summary.Cache, null, false);
            PXUIFieldAttribute.SetRequired <AP1099YearMaster.vendorID>(YearVendor_Header.Cache, true);
        }
示例#7
0
        public APChecksToPrintEnq()
        {
            APSetup setup = APSetup.Current;

            this.Documents.Cache.AllowDelete = false;
            this.Documents.Cache.AllowInsert = false;
            this.Documents.Cache.AllowUpdate = false;
        }
示例#8
0
        public APPendingInvoicesEnq()
        {
            APSetup setup = APSetup.Current;

            this.Documents.Cache.AllowDelete = false;
            this.Documents.Cache.AllowInsert = false;
            this.Documents.Cache.AllowUpdate = false;
        }
示例#9
0
        public APRetainageRelease()
        {
            APSetup setup = APSetup.Current;

            bool isRequireSingleProjectPerDocument = APSetup.Current?.RequireSingleProjectPerDocument == true;

            PXUIFieldAttribute.SetVisible <APRetainageFilter.projectID>(Filter.Cache, null, isRequireSingleProjectPerDocument);
            PXUIFieldAttribute.SetVisible <APInvoiceExt.projectID>(DocumentList.Cache, null, isRequireSingleProjectPerDocument);
        }
示例#10
0
        public APScheduleMaint()
        {
            APSetup aps = APSetup.Current;
            GLSetup gls = GLSetup.Current;

            Document_History.Cache.AllowDelete = false;
            Document_History.Cache.AllowInsert = false;
            Document_History.Cache.AllowUpdate = false;
            CopyPaste.SetVisible(false);
        }
        public APAccess()
        {
            APSetup setup = APSetup.Current;

            Vendor.Cache.AllowDelete = false;
            PXUIFieldAttribute.SetEnabled(Vendor.Cache, null, false);
            PXUIFieldAttribute.SetEnabled <Vendor.included>(Vendor.Cache, null);
            PXUIFieldAttribute.SetEnabled <Vendor.acctCD>(Vendor.Cache, null);
            PXUIFieldAttribute.SetVisible <PX.SM.Users.username>(Caches[typeof(PX.SM.Users)], null);
        }
示例#12
0
        public APRetainageRelease()
        {
            APSetup setup = APSetup.Current;

            bool isRequireSingleProjectPerDocument = APSetup.Current?.RequireSingleProjectPerDocument == true;

            PXUIFieldAttribute.SetVisible <APRetainageFilter.projectID>(Filter.Cache, null, isRequireSingleProjectPerDocument);
            PXUIFieldAttribute.SetVisible <APInvoiceExt.displayProjectID>(DocumentList.Cache, null,
                                                                          isRequireSingleProjectPerDocument || PXAccess.FeatureInstalled <FeaturesSet.paymentsByLines>());
        }
示例#13
0
        public AP1099DetailEnq()
        {
            APSetup setup = APSetup.Current;

            PXUIFieldAttribute.SetEnabled <AP1099Box.boxNbr>(YearVendorSummary.Cache, null, false);
            PXUIFieldAttribute.SetEnabled <AP1099Box.descr>(YearVendorSummary.Cache, null, false);
            PXUIFieldAttribute.SetRequired <AP1099YearMaster.vendorID>(YearVendorHeader.Cache, true);
            reportsFolder.MenuAutoOpen = true;
            reportsFolder.AddMenuAction(year1099SummaryReport);
            reportsFolder.AddMenuAction(year1099DetailReport);
        }
示例#14
0
        public APReleaseChecks()
        {
            APSetup setup = APSetup.Current;

            PXUIFieldAttribute.SetEnabled(APPaymentList.Cache, null, false);
            PXUIFieldAttribute.SetEnabled <APPayment.selected>(APPaymentList.Cache, null, true);
            PXUIFieldAttribute.SetEnabled <APPayment.extRefNbr>(APPaymentList.Cache, null, true);

            PXUIFieldAttribute.SetVisible <APPayment.printCheck>(APPaymentList.Cache, null, false);
            PXUIFieldAttribute.SetVisibility <APPayment.printCheck>(APPaymentList.Cache, null, PXUIVisibility.Invisible);
        }
        public APAccessDetail()
        {
            APSetup setup = APSetup.Current;

            Vendor.Cache.AllowDelete = false;
            Vendor.Cache.AllowInsert = false;
            PXUIFieldAttribute.SetEnabled(Vendor.Cache, null, false);
            PXUIFieldAttribute.SetEnabled <Vendor.acctCD>(Vendor.Cache, null);
            Views.Caches.Remove(Groups.GetItemType());
            Views.Caches.Add(Groups.GetItemType());
        }
示例#16
0
        public APPrintChecks()
        {
            APSetup setup = APSetup.Current;

            PXUIFieldAttribute.SetEnabled(APPaymentList.Cache, null, false);
            PXUIFieldAttribute.SetEnabled <APPayment.selected>(APPaymentList.Cache, null, true);
            PXUIFieldAttribute.SetEnabled <APPayment.extRefNbr>(APPaymentList.Cache, null, true);

            APPaymentList.SetSelected <APPayment.selected>();
            PXUIFieldAttribute.SetDisplayName <APPayment.vendorID>(APPaymentList.Cache, Messages.VendorID);
        }
        public AP1099SummaryEnq()
        {
            APSetup setup = APSetup.Current;

            PXUIFieldAttribute.SetEnabled <AP1099Box.boxNbr>(Year_Summary.Cache, null, false);
            PXUIFieldAttribute.SetEnabled <AP1099Box.descr>(Year_Summary.Cache, null, false);

            reportsFolder.MenuAutoOpen = true;
            reportsFolder.AddMenuAction(year1099SummaryReport);
            reportsFolder.AddMenuAction(year1099DetailReport);
            reportsFolder.AddMenuAction(open1099PaymentsReport);
        }
        public APLandedCostProcess()
        {
            APSetup apSetup = APSetup.Current;
            POSetup poSetup = POSetup.Current;

            documents.SetSelected <APInvoiceLCInfo.selected>();
            documents.SetProcessCaption(ActionsMessages.Process);
            documents.SetProcessAllCaption(ActionsMessages.ProcessAll);
            documents.SetProcessDelegate(delegate(List <APInvoiceLCInfo> list)
            {
                ReleaseDoc(list);
            });
        }
        public APScheduleRun()
        {
            APSetup setup = APSetup.Current;

            Schedule_List.Join <
                LeftJoin <APRegisterAccess,
                          On <APRegisterAccess.scheduleID, Equal <Schedule.scheduleID>,
                              And <APRegisterAccess.scheduled, Equal <boolTrue>,
                                   And <Not <Match <APRegisterAccess, Current <AccessInfo.userName> > > > > > > >();

            Schedule_List.WhereAnd <Where <
                                        Schedule.module, Equal <BatchModule.moduleAP>,
                                        And <APRegisterAccess.docType, IsNull> > >();
        }
示例#20
0
        public virtual void VendorClass_RowDeleting(PXCache cache, PXRowDeletingEventArgs e)
        {
            VendorClass vclass = (VendorClass)e.Row;

            if (vclass == null)
            {
                return;
            }

            APSetup setup = PXSelect <APSetup> .Select(this);

            if (setup != null && vclass.VendorClassID == setup.DfltVendorClassID)
            {
                throw new PXException(Messages.VendorClassCanNotBeDeletedBecauseItIsUsed);
            }
        }
        protected virtual void APSetup_InvoiceRequestApproval_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
        {
            APSetup setup = e.Row as APSetup;

            if (setup == null)
            {
                return;
            }

            if (setup.HoldEntry != true &&
                setup.InvoiceRequestApproval == true)
            {
                // The approval process requires the documents
                // to be created in the hold status.
                // -
                sender.SetValueExt <APSetup.holdEntry>(setup, true);
            }
        }
        public APScheduleMaint()
        {
            APSetup apSetup = APSetup.Current;
            GLSetup glSetup = GLSetup.Current;

            Document_History.Cache.AllowDelete = false;
            Document_History.Cache.AllowInsert = false;
            Document_History.Cache.AllowUpdate = false;

            Schedule_Header.Join <LeftJoin <
                                      APRegisterAccess,
                                      On <APRegisterAccess.scheduleID, Equal <Schedule.scheduleID>,
                                          And <APRegisterAccess.scheduled, Equal <True>,
                                               And <Not <Match <APRegisterAccess, Current <AccessInfo.userName> > > > > > > >();

            Schedule_Header.WhereAnd <Where <
                                          Schedule.module, Equal <BatchModule.moduleAP>,
                                          And <APRegisterAccess.docType, IsNull> > >();
        }
        protected virtual void APSetup_HoldEntry_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
        {
            APSetup setup = e.Row as APSetup;

            if (setup == null)
            {
                return;
            }

            bool newHoldOnEntry = (bool?)e.NewValue == true;

            if (!newHoldOnEntry && setup.InvoiceRequestApproval == true)
            {
                e.NewValue = false;
                throw new PXSetPropertyException <APSetup.holdEntry>(
                          Messages.CannotDisableHoldBecauseApprovalsRequested,
                          PXErrorLevel.RowWarning);
            }
        }
示例#24
0
        private void VerifyInvoiceRounding(PXCache sender, APSetup row)
        {
            var hasError = false;

            if (row.InvoiceRounding != RoundingType.Currency)
            {
                var glSetup = GLSetup.Current;

                if (glSetup.RoundingLimit == 0m)
                {
                    hasError = true;
                    sender.RaiseExceptionHandling <APSetup.invoiceRounding>(row, null, new PXSetPropertyException(AR.Messages.ShouldSpecifyRoundingLimit, PXErrorLevel.Warning));
                }
            }

            if (!hasError)
            {
                sender.RaiseExceptionHandling <APSetup.invoiceRounding>(row, null, null);
            }
        }
        protected virtual void APPPDDebitAdjParameters_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            APPPDDebitAdjParameters filter = (APPPDDebitAdjParameters)e.Row;

            if (filter == null)
            {
                return;
            }

            APSetup setup = apsetup.Current;

            Applications.SetProcessDelegate(list => CreatePPDDebitAdjs(sender, filter, setup, list));

            bool generateOnePerVendor = filter.GenerateOnePerVendor == true;

            PXUIFieldAttribute.SetEnabled <APPPDDebitAdjParameters.debitAdjDate>(sender, filter, generateOnePerVendor);
            PXUIFieldAttribute.SetEnabled <APPPDDebitAdjParameters.finPeriodID>(sender, filter, generateOnePerVendor);
            PXUIFieldAttribute.SetRequired <APPPDDebitAdjParameters.debitAdjDate>(sender, generateOnePerVendor);
            PXUIFieldAttribute.SetRequired <APPPDDebitAdjParameters.finPeriodID>(sender, generateOnePerVendor);
        }
示例#26
0
        protected override IEnumerable periodList()
        {
            string fiscalYear = null;

            APSetup.Current = APSetup.Select();
            if (APSetup.Current == null)
            {
                yield break;
            }
            foreach (FinPeriod per in PXSelect <FinPeriod, Where <FinPeriod.aPClosed, Equal <boolFalse> > > .Select(this))
            {
                if (fiscalYear == null)
                {
                    fiscalYear = per.FinYear;
                }
                if (per.FinYear == fiscalYear)
                {
                    yield return(per);
                }
            }
        }
示例#27
0
 public APApproveBills()
 {
     APSetup setup = APSetup.Current;
     Views["_ApproveBillsFilter_curyInfoID_CurrencyInfo.CuryInfoID_"] = new PXView(this, false, new Select<ApproveBillsFilter>(), new PXSelectDelegate(Filter.Get));
 }
示例#28
0
        public APApproveBills()
        {
            APSetup setup = APSetup.Current;

            PXUIFieldAttribute.SetDisplayName <APInvoice.paySel>(APDocumentList.Cache, Messages.Selected);
        }
示例#29
0
 public APIntegrityCheck()
 {
     APSetup setup = APSetup.Current;
 }
        public static void CreatePPDDebitAdjs(PXCache cache, APPPDDebitAdjParameters filter, APSetup setup, List <PendingPPDDebitAdjApp> docs)
        {
            int            i      = 0;
            bool           failed = false;
            APInvoiceEntry ie     = PXGraph.CreateInstance <APInvoiceEntry>();

            ie.APSetup.Current = setup;

            if (filter.GenerateOnePerVendor == true)
            {
                if (filter.DebitAdjDate == null)
                {
                    throw new PXSetPropertyException(CR.Messages.EmptyValueErrorFormat,
                                                     PXUIFieldAttribute.GetDisplayName <APPPDDebitAdjParameters.debitAdjDate>(cache));
                }

                if (filter.FinPeriodID == null)
                {
                    throw new PXSetPropertyException(CR.Messages.EmptyValueErrorFormat,
                                                     PXUIFieldAttribute.GetDisplayName <APPPDDebitAdjParameters.finPeriodID>(cache));
                }

                Dictionary <PPDApplicationKey, List <PendingPPDDebitAdjApp> > dict = new Dictionary <PPDApplicationKey, List <PendingPPDDebitAdjApp> >();
                foreach (PendingPPDDebitAdjApp pendingPPDDebitAdjApp in docs)
                {
                    CurrencyInfo info = PXSelect <CurrencyInfo, Where <CurrencyInfo.curyInfoID, Equal <Required <CurrencyInfo.curyInfoID> > > > .Select(ie, pendingPPDDebitAdjApp.InvCuryInfoID);

                    PPDApplicationKey key = new PPDApplicationKey();
                    pendingPPDDebitAdjApp.Index = i++;
                    key.BranchID   = pendingPPDDebitAdjApp.AdjdBranchID;
                    key.BAccountID = pendingPPDDebitAdjApp.VendorID;
                    key.LocationID = pendingPPDDebitAdjApp.InvVendorLocationID;
                    key.CuryID     = info.CuryID;
                    key.CuryRate   = info.CuryRate;
                    key.AccountID  = pendingPPDDebitAdjApp.AdjdAPAcct;
                    key.SubID      = pendingPPDDebitAdjApp.AdjdAPSub;
                    key.TaxZoneID  = pendingPPDDebitAdjApp.InvTaxZoneID;

                    List <PendingPPDDebitAdjApp> list;
                    if (!dict.TryGetValue(key, out list))
                    {
                        dict[key] = list = new List <PendingPPDDebitAdjApp>();
                    }

                    list.Add(pendingPPDDebitAdjApp);
                }

                foreach (List <PendingPPDDebitAdjApp> list in dict.Values)
                {
                    APInvoice invoice = CreateAndReleasePPDDebitAdj(ie, filter, list, AutoReleaseDebitAdjustments);

                    if (invoice == null)
                    {
                        failed = true;
                    }
                }
            }
            else
            {
                foreach (PendingPPDDebitAdjApp pendingPPDDebitAdjApp in docs)
                {
                    List <PendingPPDDebitAdjApp> list = new List <PendingPPDDebitAdjApp>(1);
                    pendingPPDDebitAdjApp.Index = i++;
                    list.Add(pendingPPDDebitAdjApp);

                    APInvoice invoice = CreateAndReleasePPDDebitAdj(ie, filter, list, AutoReleaseDebitAdjustments);

                    if (invoice == null)
                    {
                        failed = true;
                    }
                }
            }

            if (failed)
            {
                throw new PXException(GL.Messages.DocumentsNotReleased);
            }
        }