예제 #1
0
        public static int CalculateQuarterForTenant(DateTime date)
        {
            if (MultiTenantHelpers.UseFiscalYears())
            {
                var startMonthOfFiscalYear = (DateUtilities.Month)MultiTenantHelpers.GetStartDayOfFiscalYear().Month;
                return((int)CalculateFiscalQuarterFromStartMonth(date, startMonthOfFiscalYear));
            }

            return((int)CalculateCalendarQuarter(date));
        }
예제 #2
0
        public static int?CalculateFiscalYearForTenant(DateTime date)
        {
            if (MultiTenantHelpers.UseFiscalYears())
            {
                var startMonthOfFiscalYear = (DateUtilities.Month)MultiTenantHelpers.GetStartDayOfFiscalYear().Month;
                return(date.GetFiscalYearFromStartMonth(startMonthOfFiscalYear));
            }

            return(null);
        }
예제 #3
0
        public static int CalculateCurrentYearToUseForUpToAllowableInputInReporting()
        {
            var startDayOfYear     = MultiTenantHelpers.GetStartDayOfFiscalYear();
            var currentDateTime    = DateTime.Today;
            var dateToCheckAgainst = new DateTime(currentDateTime.Year, startDayOfYear.Month, startDayOfYear.Day);

            if (MultiTenantHelpers.UseFiscalYears())
            {
                return(currentDateTime.IsDateBefore(dateToCheckAgainst) ? currentDateTime.Year : currentDateTime.Year + 1);
            }
            return(currentDateTime.IsDateBefore(dateToCheckAgainst) ? currentDateTime.Year - 1 : currentDateTime.Year);
        }