protected virtual void Filter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
		{
			if (e.Row == null) return;
			Filter row = (Filter)e.Row;
			bool allDataIsFilled = !string.IsNullOrEmpty(row.OldPaymentMethodID) 
				&& !string.IsNullOrEmpty(row.OldCCProcessingCenterID) 
				&& !string.IsNullOrEmpty(row.NewCCProcessingCenterID);
			CustomerPaymentMethodList.SetProcessEnabled(allDataIsFilled);
			CustomerPaymentMethodList.SetProcessAllEnabled(allDataIsFilled);
			if (allDataIsFilled)
			{
				CCProcessingCenter newCCPC = NewProcessingCenter.Select();
				string oldProcCenterId = OldProcessingCenter.SelectSingle()?.ProcessingCenterID;
				string newProcCenterId = NewProcessingCenter.SelectSingle()?.ProcessingCenterID;
				CustomerPaymentMethodList.SetParametersDelegate(cpm =>
				{
					WebDialogResult result = filter.Ask(PXMessages.LocalizeFormatNoPrefix(Messages.PaymentMethodConverterWarning, oldProcCenterId, newProcCenterId), MessageButtons.OKCancel);
					return result == WebDialogResult.OK ? true : false;
				});
				CustomerPaymentMethodList.SetProcessDelegate(cpm => ConvertCustomerPaymentMethod(row, cpm, newCCPC));
			}

			ShowUnknownPluginWarningIfNeeded(row, OldProcessingCenter.Select(), nameof(Filter.OldCCProcessingCenterID));
			ShowUnknownPluginWarningIfNeeded(row, NewProcessingCenter.Select(), nameof(Filter.NewCCProcessingCenterID));
		}
예제 #2
0
        protected virtual void APIntegrityCheckFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            bool errorsOnForm = PXUIFieldAttribute.GetErrors(sender, null, PXErrorLevel.Error, PXErrorLevel.RowError).Count > 0;

            APVendorList.SetProcessEnabled(!errorsOnForm);
            APVendorList.SetProcessAllEnabled(!errorsOnForm);

            APIntegrityCheckFilter filter = Filter.Current;

            APVendorList.SetProcessDelegate <APReleaseProcess>(
                delegate(APReleaseProcess re, Vendor vend)
            {
                re.Clear(PXClearOption.PreserveTimeStamp);
                re.IntegrityCheckProc(vend, filter.FinPeriodID);
            }
                );

            //For perfomance recomended select not more than maxVendorCount vendors,
            //because the operation is performed for a long time.
            const int maxVendorCount = 5;

            APVendorList.SetParametersDelegate(delegate(List <Vendor> list)
            {
                bool processing = true;
                if (PX.Common.PXContext.GetSlot <AUSchedule>() == null && list.Count > maxVendorCount)
                {
                    WebDialogResult wdr = APVendorList.Ask(Messages.ContinueValidatingBalancesForMultipleVendors, MessageButtons.OKCancel);
                    processing          = wdr == WebDialogResult.OK;
                }
                return(processing);
            });
        }
        public virtual void CABalanceValidationPeriodFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            bool errorsOnForm = PXUIFieldAttribute.GetErrors(sender, null, PXErrorLevel.Error, PXErrorLevel.RowError).Count > 0;

            CABalValidateList.SetProcessEnabled(!errorsOnForm);
            CABalValidateList.SetProcessAllEnabled(!errorsOnForm);
        }
예제 #4
0
        protected virtual void GLIntegrityCheckFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            bool errorsOnForm = PXUIFieldAttribute.GetErrors(sender, null, PXErrorLevel.Error, PXErrorLevel.RowError).Count > 0;

            LedgerList.SetProcessEnabled(!errorsOnForm);
            LedgerList.SetProcessAllEnabled(!errorsOnForm);
        }
        protected virtual void GLIntegrityCheckFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            GLIntegrityCheckFilter filter = Filter.Current;

            bool errorsOnForm = PXUIFieldAttribute.GetErrors(sender, null).Count > 0;

            LedgerList.SetProcessEnabled(!errorsOnForm);
            LedgerList.SetProcessAllEnabled(!errorsOnForm);

            LedgerList.SetProcessDelegate(
                (PostGraph postGraph, Ledger ledger) => Validate(postGraph, ledger, filter));
        }
예제 #6
0
        protected virtual void ReleaseChecksFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            PXUIFieldAttribute.SetVisible <ReleaseChecksFilter.curyID>(sender, null, PXAccess.FeatureInstalled <FeaturesSet.multicurrency>());

            ReleaseChecksFilter filter = e.Row as ReleaseChecksFilter;

            if (filter == null)
            {
                return;
            }

            PaymentMethod paymentMethod = PXSelect <PaymentMethod,
                                                    Where <PaymentMethod.paymentMethodID, Equal <Required <ReleaseChecksFilter.payTypeID> > > > .Select(this, filter.PayTypeID);

            Reprint.SetEnabled(paymentMethod != null && paymentMethod.PrintOrExport == true);
            VoidReprint.SetEnabled(paymentMethod != null && paymentMethod.PrintOrExport == true);

            List <Tuple <string, string> > availableActions = new List <Tuple <string, PXAction> >
            {
                new Tuple <string, PXAction>(ReleaseChecksFilter.action.ReleaseChecks, Release),
                new Tuple <string, PXAction>(ReleaseChecksFilter.action.ReprintChecks, Reprint),
                new Tuple <string, PXAction>(ReleaseChecksFilter.action.VoidAndReprintChecks, VoidReprint)
            }
            .Select(t => new { ShortCut = t.Item1, State = t.Item2.GetState(filter) as PXButtonState })
            .Where(t => t.State?.Enabled == true)
            .Select(t => new Tuple <string, string>(t.ShortCut, t.State.DisplayName)).ToList();

            string[] actions = availableActions.Select(t => t.Item1).ToArray();
            PXStringListAttribute.SetLocalizable <ReleaseChecksFilter.action>(Filter.Cache, null, false);
            PXStringListAttribute.SetList <ReleaseChecksFilter.action>(Filter.Cache, null, actions, availableActions.Select(t => t.Item2).ToArray());
            PXUIFieldAttribute.SetEnabled <ReleaseChecksFilter.action>(Filter.Cache, filter, availableActions.Count > 1);

            if (availableActions.Count > 0)
            {
                if (filter.Action == null || !actions.Contains(filter.Action))
                {
                    filter.Action = actions[0];
                }
            }
            else
            {
                filter.Action = null;
            }

            string action = filter.Action;

            APPaymentList.SetProcessEnabled(action != null);
            APPaymentList.SetProcessAllEnabled(action != null);

            APPaymentList.SetProcessDelegate(list => ReleasePayments(list, action));
        }
예제 #7
0
        public virtual void InvoiceContractPeriodFilter_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            InvoiceContractPeriodFilter createInvoiceFilterRow = (InvoiceContractPeriodFilter)e.Row;

            string errorMessage         = PXUIFieldAttribute.GetErrorOnly <InvoiceContractPeriodFilter.invoiceFinPeriodID>(cache, createInvoiceFilterRow);
            bool   enableProcessButtons = string.IsNullOrEmpty(errorMessage) == true;

            Contracts.SetProcessAllEnabled(enableProcessButtons);
            Contracts.SetProcessEnabled(enableProcessButtons);
        }
        protected override void CreateInvoiceFilter_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            base.CreateInvoiceFilter_RowSelected(cache, e);

            CreateInvoiceFilter createInvoiceFilterRow = (CreateInvoiceFilter)e.Row;

            string errorMessage         = PXUIFieldAttribute.GetErrorOnly <CreateInvoiceFilter.invoiceFinPeriodID>(cache, createInvoiceFilterRow);
            bool   enableProcessButtons = string.IsNullOrEmpty(errorMessage) == true;

            PostLines.SetProcessAllEnabled(enableProcessButtons);
            PostLines.SetProcessEnabled(enableProcessButtons);
        }
        protected virtual void Filter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }
            Filter row             = (Filter)e.Row;
            bool   allDataIsFilled = !string.IsNullOrEmpty(row.OldPaymentMethodID) &&
                                     !string.IsNullOrEmpty(row.OldCCProcessingCenterID) &&
                                     !string.IsNullOrEmpty(row.NewCCProcessingCenterID);

            CustomerPaymentMethodList.SetProcessEnabled(allDataIsFilled);
            CustomerPaymentMethodList.SetProcessAllEnabled(allDataIsFilled);
            if (allDataIsFilled)
            {
                CCProcessingCenter newCCPC = ProcessingCenters.Select();
                CustomerPaymentMethodList.SetProcessDelegate(cpm => ConvertCustomerPaymentMethod(cpm, newCCPC));
            }
        }
예제 #10
0
        protected virtual void Filter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }
            Filter row = (Filter)e.Row;

            PXUIFieldAttribute.SetEnabled <Filter.oldCCProcessingCenterID>(sender, e.Row, (!string.IsNullOrEmpty(row.OldPaymentMethodID)));
            PXUIFieldAttribute.SetEnabled <Filter.newCCProcessingCenterID>(sender, e.Row, (!string.IsNullOrEmpty(row.OldCCProcessingCenterID)));
            bool newDataIsFilled = !string.IsNullOrEmpty(row.NewCCProcessingCenterID);

            CustomerPaymentMethodList.SetProcessEnabled(newDataIsFilled);
            CustomerPaymentMethodList.SetProcessAllEnabled(newDataIsFilled);
            if (newDataIsFilled)
            {
//				PaymentMethod newPM = PaymentMethods.Select();
                CCProcessingCenter newCCPC = ProcessingCenters.Select();
                CustomerPaymentMethodList.SetProcessDelegate(cpm => ConvertCustomerPaymentMethod(cpm, newCCPC));
            }
        }