Exemplo n.º 1
0
        public static int CalculateCurrentYearToUseForUpToAllowableInputInReporting()
        {
            var startDayOfReportingYear = MultiTenantHelpers.GetStartDayOfReportingYear();
            var currentDateTime         = DateTime.Today;
            var dateToCheckAgainst      = new DateTime(currentDateTime.Year, startDayOfReportingYear.Month, startDayOfReportingYear.Day);

            if (MultiTenantHelpers.UseFiscalYears())
            {
                return(currentDateTime.IsDateBefore(dateToCheckAgainst) ? currentDateTime.Year : currentDateTime.Year + 1);
            }
            return(currentDateTime.IsDateBefore(dateToCheckAgainst) ? currentDateTime.Year - 1 : currentDateTime.Year);
        }
Exemplo n.º 2
0
        public static int CalculateCurrentYearToUseForRequiredReporting()
        {
            var startDayOfReportingYear = MultiTenantHelpers.GetStartDayOfReportingYear();

            return(CalculateCurrentYearToUseForReportingImpl(DateTime.Today, startDayOfReportingYear.Month, startDayOfReportingYear.Day));
        }
Exemplo n.º 3
0
        public static DateTime LastReportingPeriodStartDate()
        {
            var startDayOfReportingYear = MultiTenantHelpers.GetStartDayOfReportingYear();

            return(new DateTime(CalculateCurrentYearToUseForRequiredReporting(), startDayOfReportingYear.Month, startDayOfReportingYear.Day));
        }