public override object Evaluate(PXCache cache, object item, Dictionary<Type, object> pars)
		{
			object val = base.Evaluate(cache, item, pars);

			if (val == null)
			{
				return null;
			}

			DateTime? recoveryEndDate = (DateTime?)val;
			int? bookID = (int?)pars[typeof(BookID)];
			return FABookPeriodIDAttribute.FormatPeriod(FABookPeriodIDAttribute.PeriodFromDate(cache.Graph, recoveryEndDate, bookID, false));
		}
		public override object Evaluate(PXCache cache, object item, Dictionary<Type, object> pars)
		{
			try
			{
				return FABookPeriodIDAttribute.FormatPeriod(DeprCalcParameters.GetRecoveryStartPeriod(cache.Graph, (FABookBalance)item));
			}
			catch (PXException ex)
			{
				throw new PXSetPropertyException(ex.Message, PXErrorLevel.Error);
			}
			catch
			{
				return null;
			}
		}
Example #3
0
        public override void Verify(PXCache cache, object item, List <object> pars, ref bool?result, ref object value)
        {
            base.Verify(cache, item, pars, ref result, ref value);

            if (value == null)
            {
                return;
            }
            DateTime?recoveryEndDate = (DateTime?)value;

            int?bookID = (int?)Calculate <BookID>(cache, item);

            string recoveryEndPeriod = FABookPeriodIDAttribute.PeriodFromDate(cache.Graph, recoveryEndDate, bookID);

            value = FABookPeriodIDAttribute.FormatPeriod(recoveryEndPeriod);
        }
Example #4
0
        public override void Verify(PXCache cache, object item, List <object> pars, ref bool?result, ref object value)
        {
            int?bookID = (int?)Calculate <BookID>(cache, item);

            try
            {
                string recoveryStartPeriod = DepreciationCalc.GetRecoveryStartPeriod(cache.Graph, (FABookBalance)item);
                value = FABookPeriodIDAttribute.FormatPeriod(recoveryStartPeriod);
            }
            catch (PXException ex)
            {
                throw new PXSetPropertyException(ex.Message, PXErrorLevel.Error);
            }
            catch
            {
                value = null;
            }
        }