diff --git a/ckanext/canada/tables/reclassification.yaml b/ckanext/canada/tables/reclassification.yaml index ddac39099..e7ec9bb53 100644 --- a/ckanext/canada/tables/reclassification.yaml +++ b/ckanext/canada/tables/reclassification.yaml @@ -288,33 +288,7 @@ resources: validation: This field must not be empty excel_column_width: 10 extract_date_year: true - choices: - 2020: "2020" - 2019: "2019" - 2018: "2018" - 2017: "2017" - 2016: "2016" - 2015: "2015" - 2014: "2014" - 2013: "2013" - 2012: "2012" - 2011: "2011" - 2010: "2010" - 2009: "2009" - 2008: "2008" - 2007: "2007" - 2006: "2006" - 2005: "2005" - 2004: "2004" - 2003: "2003" - 2002: "2002" - 2001: "2001" - 2000: "2000" - 1999: "1999" - 1998: "1998" - 1997: "1997" - 1996: "1996" - 1995: "1995" + excel_error_formula: '{cell}>YEAR(TODAY())' - datastore_id: quarter datastore_type: text @@ -374,6 +348,9 @@ resources: errors := errors || choice_error(NEW.year::text, {year}, 'year'); errors := errors || required_error(NEW.quarter, 'quarter'); errors := errors || choice_error(NEW.quarter, {quarter}, 'quarter'); + IF NEW.year > date_part('year', CURRENT_DATE) THEN + errors := errors || ARRAY[['year', 'This must list the year you are reporting on (not the fiscal year).']]; + END IF; IF errors = '{{}}' THEN RETURN NEW; END IF;