Changeset 670 for trunk/grails-app


Ignore:
Timestamp:
Oct 3, 2010, 9:54:30 PM (14 years ago)
Author:
gav
Message:

Improvements to Inventory Value report.

File:
1 edited

Legend:

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

    r669 r670  
    183183
    184184        result.site = Site.get(params.site.id.toLong())
    185         result.inventoryTypes = params.inventoryTypes.collect { InventoryType.get(it.toInteger()) }
    186         result.inventoryGroups = params.inventoryGroups.collect { InventoryGroup.get(it.toInteger()) }
     185
     186        if(params.inventoryTypes) {
     187            result.inventoryTypes = params.inventoryTypes.collect { InventoryType.get(it.toInteger()) }
     188        }
     189        else
     190            result.inventoryTypes = InventoryType.findAllByIsActive(true, [max:254, sort:'name'])
     191
     192        if(params.inventoryGroups) {
     193            result.inventoryGroups = params.inventoryGroups.collect { InventoryGroup.get(it.toInteger()) }
     194        }
     195        else
     196            result.inventoryGroups = InventoryGroup.findAllByIsActive(true, [max:254, sort:'name'])
    187197
    188198        def fail = { Map m ->
Note: See TracChangeset for help on using the changeset viewer.