protected virtual void FABookSettings_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            FABookSettings set = (FABookSettings)e.Row;

            if (set == null)
            {
                return;
            }

            PXUIFieldAttribute.SetEnabled <FABookSettings.bookID>(sender, set, set.BookID == null);

            IYearSetup           yearSetup = FABookPeriodIDAttribute.GetBookCalendar(this, set.BookID);
            FADepreciationMethod method    = PXSelect <FADepreciationMethod, Where <FADepreciationMethod.methodID, Equal <Current <FABookSettings.depreciationMethodID> > > > .SelectSingleBound(this, new object[] { set });

            List <KeyValuePair <object, Dictionary <object, string[]> > > parsList = new List <KeyValuePair <object, Dictionary <object, string[]> > >();

            if (method != null)
            {
                parsList.Add(method.IsTableMethod == true
                                        ? new KeyValuePair <object, Dictionary <object, string[]> >(method.RecordType, FAAveragingConvention.RecordTypeDisabledValues)
                                        : new KeyValuePair <object, Dictionary <object, string[]> >(method.DepreciationMethod, FAAveragingConvention.DeprMethodDisabledValues));
            }
            if (yearSetup != null)
            {
                parsList.Add(new KeyValuePair <object, Dictionary <object, string[]> >(yearSetup.IsFixedLengthPeriod, FAAveragingConvention.FixedLengthPeriodDisabledValues));
            }

            FAAveragingConvention.SetAveragingConventionsList <FADepreciationMethod.averagingConvention>(sender, set, parsList.ToArray());
        }
Beispiel #2
0
        protected virtual void FADepreciationMethod_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            FADepreciationMethod meth = (FADepreciationMethod)e.Row;

            if (meth == null)
            {
                return;
            }

            bool editable = meth.IsPredefined != true || FASetup.Current.AllowEditPredefinedDeprMethod == true;

            sender.AllowUpdate = editable;
            sender.AllowDelete = editable;

            this.Caches <FADepreciationMethodLines>().AllowInsert = editable;
            this.Caches <FADepreciationMethodLines>().AllowUpdate = editable;
            this.Caches <FADepreciationMethodLines>().AllowDelete = editable;

            FAAveragingConvention.SetAveragingConventionsList <FADepreciationMethod.averagingConvention>(sender, meth,
                                                                                                         new KeyValuePair <object, Dictionary <object, string[]> >(meth.DepreciationMethod, FAAveragingConvention.DeprMethodDisabledValues));
        }
Beispiel #3
0
        protected virtual void FADepreciationMethod_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            FADepreciationMethod method = (FADepreciationMethod)e.Row;

            if (method == null)
            {
                return;
            }

            PXUIFieldAttribute.SetEnabled <FADepreciationMethod.parentMethodID>(sender, method, method.RecordType == FARecordType.AssetType);
            PXUIFieldAttribute.SetEnabled <FADepreciationMethod.averagingConvPeriod>(sender, method, method.AveragingConvention != FAAveragingConvention.FullYear);
            FAAveragingConvention.SetAveragingConventionsList <FADepreciationMethod.averagingConvention>(sender, method,
                                                                                                         new KeyValuePair <object, Dictionary <object, string[]> >(method.RecordType, FAAveragingConvention.RecordTypeDisabledValues));

            bool editable = method.IsPredefined != true || FASetup.Current.AllowEditPredefinedDeprMethod == true;

            sender.AllowUpdate = editable;
            sender.AllowDelete = editable;

            this.Caches <FADepreciationMethodLines>().AllowUpdate = editable;
        }