Exemple #1
0
        public CRCaseReleaseProcess()
        {
            Items.SetSelected <CRCase.selected>();

            PXProcessingStep[] targets = PXAutomation.GetProcessingSteps(this);
            if (targets.Length > 0)
            {
                Items.SetProcessTarget(targets[0].GraphName,
                                       targets.Length > 1 ? null : targets[0].Name,
                                       targets[0].Actions[0].Name,
                                       targets[0].Actions[0].Menus[0],
                                       null, null);
            }
            else
            {
                throw new PXException(SO.Messages.MissingMassProcessWorkFlow);
            }

            PXUIFieldAttribute.SetVisible(Items.Cache, null, false);
            PXUIFieldAttribute.SetVisible <CRCase.caseCD>(Items.Cache, null);
            PXUIFieldAttribute.SetVisible <CRCase.subject>(Items.Cache, null);
            PXUIFieldAttribute.SetVisible <CRCase.contractID>(Items.Cache, null);
            PXUIFieldAttribute.SetVisible <CRCase.timeBillable>(Items.Cache, null);
            PXUIFieldAttribute.SetVisible <CRCase.overtimeBillable>(Items.Cache, null);

            var BAccountCache = Caches[typeof(Customer)];

            PXUIFieldAttribute.SetVisible(BAccountCache, null, false);
            PXUIFieldAttribute.SetDisplayName <Customer.acctName>(BAccountCache, Messages.BAccountName);
            PXUIFieldAttribute.SetDisplayName <Customer.classID>(BAccountCache, Messages.BAccountClass);

            Actions.Move("Process", "Cancel");
        }
        public void SplitFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            SplitFilter filter = (SplitFilter)e.Row;

            if (filter == null)
            {
                return;
            }

            PXProcessingStep[] targets = PXAutomation.GetProcessingSteps(this);
            if (targets.Length > 0)
            {
                Splits.SetProcessTarget(targets[0].GraphName,
                                        targets.Length > 1 ? null : targets[0].Name,
                                        targets[0].Actions[0].Name,
                                        targets[0].Actions[0].Menus[0],
                                        filter.SplitDate,
                                        filter.SplitPeriodID,
                                        null, null, null, null, null,
                                        filter.DeprBeforeSplit,
                                        null,
                                        filter.AssetID);
            }
            else
            {
                throw new PXException(SO.Messages.MissingMassProcessWorkFlow);
            }

            Splits.SetProcessVisible(false);
            Splits.SetProcessAllEnabled(filter.AssetID != null && filter.SplitPeriodID != null);
            Splits.SetProcessAllCaption(Messages.Split);

            Splits.Cache.AllowInsert = filter.AssetID != null;
            Splits.Cache.AllowUpdate = filter.AssetID != null;
            Splits.Cache.AllowDelete = true;

            PXUIFieldAttribute.SetEnabled <SplitParams.cost>(Splits.Cache, null, true);
            PXUIFieldAttribute.SetEnabled <SplitParams.splittedQty>(Splits.Cache, null, true);
            PXUIFieldAttribute.SetEnabled <SplitParams.ratio>(Splits.Cache, null, true);
            Numbering nbr = assetNumbering.Select();

            PXUIFieldAttribute.SetEnabled <SplitParams.splittedAssetCD>(Splits.Cache, null, nbr == null || nbr.UserNumbering == true);

            PXUIFieldAttribute.SetEnabled <SplitFilter.deprBeforeSplit>(sender, filter, fasetup.Current.AutoReleaseDepr == true);

            FixedAsset asset = PXSelect <FixedAsset, Where <FixedAsset.assetID, Equal <Required <SplitFilter.assetID> > > > .Select(this, filter.AssetID);

            PXUIFieldAttribute.SetVisible <SplitFilter.deprBeforeSplit>(sender, filter, asset == null || asset.Depreciable == true);
        }
        private void InitializeProcessing()
        {
            FilteredItems.SetSelected <EMailAccount.selected>();

            PXProcessingStep[] targets = PXAutomation.GetProcessingSteps(this);
            if (targets.Length > 0)
            {
                FilteredItems.SetProcessTarget(targets[0].GraphName,
                                               targets.Length > 1 ? null : targets[0].Name,
                                               targets[0].Actions[0].Name,
                                               targets[0].Actions[0].Menus[0],
                                               null, null);
            }
            else
            {
                throw new PXException(PX.Objects.SO.Messages.MissingMassProcessWorkFlow);
            }
        }
        public virtual void SOPostShipmentFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            SOPostShipmentFilter filter = e.Row as SOPostShipmentFilter;

            PXProcessingStep[] targets = PXAutomation.GetProcessingSteps(this);
            if (targets.Length > 0)
            {
                Dictionary <string, object> parameters = Filter.Cache.ToDictionary(filter);
                Orders.SetProcessTarget(targets[0].GraphName, targets[0].Name, targets[0].Actions[0].Name, targets[0].Actions[0].Menus[0], null, parameters);
            }
            else
            {
                Orders.SetProcessDelegate(delegate(List <SOOrder> list)
                {
                    PostOrder(filter, list);
                });
            }
        }
        public MergePrepareProcess()
        {
            Items.SetProcessCaption(Messages.Prepare);
            Items.SetProcessAllCaption(Messages.PrepareAll);
            Items.SetSelected <CRMerge.selected>();

            PXProcessingStep[] targets = PXAutomation.GetProcessingSteps(this);
            if (targets.Length > 0)
            {
                Items.SetProcessTarget(targets[0].GraphName,
                                       targets.Length > 1 ? null : targets[0].Name,
                                       targets[0].Actions[0].Name,
                                       targets[0].Actions[0].Menus[0],
                                       null, null);
            }
            else
            {
                throw new PXScreenMisconfigurationException(SO.Messages.MissingMassProcessWorkFlow);
            }

            Actions.Move("Process", "Cancel");
        }
Exemple #6
0
        protected virtual void DisposalFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            DisposalFilter filter = (DisposalFilter)e.Row;

            if (filter == null)
            {
                return;
            }

            Assets.SetProcessEnabled(filter.DisposalMethodID != null);
            Assets.SetProcessAllEnabled(filter.DisposalMethodID != null);
            PXProcessingStep[] targets = PXAutomation.GetProcessingSteps(this);
            if (targets.Length > 0)
            {
                Assets.SetProcessTarget(targets[0].GraphName,
                                        targets.Length > 1 ? null : targets[0].Name,
                                        targets[0].Actions[0].Name,
                                        targets[0].Actions[0].Menus[0],
                                        filter.DisposalDate,
                                        filter.DisposalPeriodID,
                                        filter.DisposalAmt,
                                        filter.DisposalMethodID,
                                        filter.DisposalAccountID,
                                        filter.DisposalSubID,
                                        filter.DisposalAmtMode,
                                        filter.DeprBeforeDisposal,
                                        filter.Reason);
            }
            else
            {
                throw new PXException(SO.Messages.MissingMassProcessWorkFlow);
            }

            PXUIFieldAttribute.SetEnabled <DisposalFilter.disposalAmt>(sender, e.Row, filter.DisposalAmtMode == DisposalFilter.disposalAmtMode.Automatic);
            PXUIFieldAttribute.SetEnabled <FixedAsset.disposalAmt>(Assets.Cache, null, Filter.Current.DisposalAmtMode == DisposalFilter.disposalAmtMode.Manual);
        }