Changeset 733
- Timestamp:
- Nov 30, 2010, 10:48:14 AM (14 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/ReportController.groovy
r732 r733 191 191 def equipmentRegisterOhs = { 192 192 193 params.calculateRegulatoryTaskCompletion = true 194 def result = assetReportService.getEquipmentRegister(params, RCU.getLocale(request)) 195 193 196 params.reportTitle = "Equipment Register OH&S" 194 197 params.logoUrl = grailsApplication.mainContext.getResource('images/logo.png').getURL() 195 198 params.currentUser = authService.currentUser 196 197 params.calculateRegulatoryTaskCompletion = true 198 params.startDateString = g.formatDate(format: "EEE, dd-MMM-yyyy", date: params.startDate) 199 params.endDateString = g.formatDate(format: "EEE, dd-MMM-yyyy", date: params.endDate) 200 201 def result = assetReportService.getEquipmentRegister(params, RCU.getLocale(request)) 199 params.startDateString = result.startDateString 200 params.endDateString = result.endDateString 202 201 203 202 if(!result.error) { -
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.