Changeset 733 for trunk/grails-app/services
- Timestamp:
- Nov 30, 2010, 10:48:14 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/AssetReportService.groovy
r732 r733 142 142 result.site = result.section.site 143 143 144 // Start date. 145 if(params.startDate) 146 params.startDate = dateUtilService.makeDate(params.startDate_year, params.startDate_month, params.startDate_day) 147 else 148 params.startDate = dateUtilService.oneWeekAgo 149 150 // End date. 151 if(params.endDate) 152 params.endDate = dateUtilService.makeDate(params.endDate_year, params.endDate_month, params.endDate_day) 153 else 154 params.endDate = dateUtilService.today 155 144 result.startDate = params.startDate ?: dateUtilService.oneWeekAgo 145 result.endDate = params.endDate ?: dateUtilService.today 156 146 // Auto swap date range. 157 if(params.startDate > params.endDate) { 158 def tempStartDate = params.startDate 159 params.startDate = params.endDate 160 params.endDate = tempStartDate 161 } 147 if(result.startDate > result.endDate) { 148 def tempStartDate = result.startDate 149 result.startDate = result.endDate 150 result.endDate = tempStartDate 151 } 152 153 result.startDateString = g.formatDate(format: "EEE, dd-MMM-yyyy", date: result.startDate) 154 result.endDateString = g.formatDate(format: "EEE, dd-MMM-yyyy", date: result.endDate) 162 155 163 156 // Inner join used to return only attribTypes that are used by AssetSubItemExtendedAttributes. … … 234 227 235 228 // Subquery namedParams. 236 namedParams.startDate = params.startDate237 namedParams.endDate = params.endDate+1229 namedParams.startDate = result.startDate 230 namedParams.endDate = result.endDate+1 238 231 239 232 select 'new map(asset.name as assetName',
Note: See TracChangeset
for help on using the changeset viewer.