Ignore:
Timestamp:
Nov 16, 2010, 7:56:10 AM (14 years ago)
Author:
gav
Message:

Return error message on equipment register (OH&S) report submit when endDate < startDate.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/AssetReportService.groovy

    r706 r710  
    134134        def result = [:]
    135135
     136        def fail = { Map m ->
     137            result.error = [ code: m.code, args: [] ]
     138            return result
     139        }
     140
    136141        result.section = Section.get(params.section.id.toLong())
    137142        result.site = result.section.site
     
    149154            params.endDate = dateUtilService.today
    150155
    151         // Normalise date range.
    152156        if(params.endDate < params.startDate)
    153             params.endDate = params.startDate
     157            return fail(code: "default.end.date.before.start.date")
    154158
    155159        // Inner join used to return only attribTypes that are used by AssetSubItemExtendedAttributes.
Note: See TracChangeset for help on using the changeset viewer.