コード例 #1
0
        /**
         *  Get the first Date From date of the next period based on Accumulation
         *	@param from date
         *	@return  first date of next period
         */
        public DateTime?GetDateFromNext(DateTime?from)
        {
            if (from == null)
            {
                return(from);
            }

            DateTime?retValue = from;

            if (BALANCEACCUMULATION_Daily.Equals(GetBALANCEACCUMULATION()))
            {
                return(null);
            }
            if (BALANCEACCUMULATION_CalendarMonth.Equals(GetBALANCEACCUMULATION()))
            {
                retValue = TimeUtil.AddMonths(from, 1);
                retValue = TimeUtil.Trunc(retValue, TimeUtil.TRUNC_MONTH);
            }
            else if (BALANCEACCUMULATION_CalendarWeek.Equals(GetBALANCEACCUMULATION()))
            {
                retValue = TimeUtil.AddDays(from, 7);
                retValue = TimeUtil.Trunc(retValue, TimeUtil.TRUNC_WEEK);
            }
            else if (BALANCEACCUMULATION_PeriodOfAViennaCalendar.Equals(GetBALANCEACCUMULATION()) &&
                     GetC_Calendar_ID() != 0)
            {
            }
            return(retValue);
        }
コード例 #2
0
        /**
         *  Get the first Date From date based on Accumulation
         *	@param from date
         *	@return  first date
         */
        public DateTime?GetDateFrom(DateTime?from)
        {
            if (from == null)
            {
                return(from);
            }

            if (BALANCEACCUMULATION_CalendarMonth.Equals(GetBALANCEACCUMULATION()))
            {
                return(TimeUtil.Trunc(from, TimeUtil.TRUNC_MONTH));
            }
            else if (BALANCEACCUMULATION_CalendarWeek.Equals(GetBALANCEACCUMULATION()))
            {
                return(TimeUtil.Trunc(from, TimeUtil.TRUNC_WEEK));
            }
            else if (BALANCEACCUMULATION_PeriodOfAViennaCalendar.Equals(GetBALANCEACCUMULATION()) &&
                     GetC_Calendar_ID() != 0)
            {
                MPeriod period = MPeriod.GetOfCalendar(GetCtx(), GetC_Calendar_ID(), from);
                if (period != null)
                {
                    return(period.GetStartDate());
                }
            }
            return(from);
        }