- Timestamp:
- Oct 11, 2010, 11:57:58 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/InventoryReportService.groovy
r677 r690 184 184 result.site = Site.get(params.site.id.toLong()) 185 185 186 if(params.inventoryTypes) { 186 result.inventoryTypes = [] 187 if(params.inventoryTypes instanceof String) 188 result.inventoryTypes << InventoryType.get(params.inventoryTypes.toInteger()) 189 else if(params.inventoryTypes) 187 190 result.inventoryTypes = params.inventoryTypes.collect { InventoryType.get(it.toInteger()) } 188 }189 191 else 190 192 result.inventoryTypes = InventoryType.findAllByIsActive(true, [max:254, sort:'name']) 191 193 192 if(params.inventoryGroups) { 194 result.inventoryGroups = [] 195 if(params.inventoryGroups instanceof String) 196 result.inventoryGroups << InventoryGroup.get(params.inventoryGroups.toInteger()) 197 else if(params.inventoryGroups) 193 198 result.inventoryGroups = params.inventoryGroups.collect { InventoryGroup.get(it.toInteger()) } 194 }195 199 else 196 200 result.inventoryGroups = InventoryGroup.findAllByIsActive(true, [max:254, sort:'name']) … … 267 271 result.site = Site.get(params.site.id.toLong()) 268 272 269 if(params.inventoryTypes) 273 result.inventoryTypes = [] 274 if(params.inventoryTypes instanceof String) 275 result.inventoryTypes << InventoryType.get(params.inventoryTypes.toInteger()) 276 else if(params.inventoryTypes) 270 277 result.inventoryTypes = params.inventoryTypes.collect { InventoryType.get(it.toInteger()) } 271 278 else 272 279 result.inventoryTypes = InventoryType.findAllByIsActive(true, [max:254, sort:'name']) 273 280 274 if(params.inventoryGroups) 281 result.inventoryGroups = [] 282 if(params.inventoryGroups instanceof String) 283 result.inventoryGroups << InventoryGroup.get(params.inventoryGroups.toInteger()) 284 else if(params.inventoryGroups) 275 285 result.inventoryGroups = params.inventoryGroups.collect { InventoryGroup.get(it.toInteger()) } 276 286 else … … 345 355 346 356 // Check all currency is the same. 347 if(currencyCount !=1)357 if(currencyCount > 1) 348 358 fail(code:'report.error.multiple.currency.found') // No return, populate errors but continue report. 349 359
Note: See TracChangeset
for help on using the changeset viewer.