- g_date_set_dmy(date, PREFS->fisc_year_day, PREFS->fisc_year_month, year);
- if( refjuliandate >= g_date_get_julian (date))
- {
- g_date_set_dmy(date, PREFS->fisc_year_day, PREFS->fisc_year_month, year-1);
- flt->mindate = g_date_get_julian(date);
- }
- else
- {
- g_date_set_dmy(date, PREFS->fisc_year_day, PREFS->fisc_year_month, year-2);
- flt->mindate = g_date_get_julian(date);
- }
- g_date_add_years (date, 1);
- g_date_subtract_days (date, 1);
- flt->maxdate = g_date_get_julian(date);
+ g_date_set_dmy(tmpdate, PREFS->fisc_year_day, PREFS->fisc_year_month, yfiscal);
+ if( range == FLT_RANGE_LASTYEAR )
+ g_date_subtract_years(tmpdate, 1);
+ flt->mindate = g_date_get_julian(tmpdate);
+ g_date_add_years (tmpdate, 1);
+ flt->maxdate = g_date_get_julian(tmpdate) - 1;