Ignore:
Timestamp:
Sep 18, 2010, 9:57:20 PM (14 years ago)
Author:
gav
Message:

Two new asset reports: Asset Detail and Asset Register.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/ReportController.groovy

    r546 r652  
    88    def dateUtilService
    99    def taskReportService
     10    def assetReportService
    1011    def inventoryReportService
    1112
     
    138139    } // stockTakeByLocation
    139140
     141    def assetDetail = {
     142
     143        params.reportTitle = "Asset Detail"
     144        params.logoUrl = grailsApplication.mainContext.getResource('images/logo.png').getURL()
     145        params.currentUser = authService.currentUser
     146        if(params.asset.id == 'all')
     147            params.asset = "All"
     148        else
     149            params.asset = Asset.get(params.asset.id.toLong())
     150
     151        def dataModel = assetReportService.getAssetDetail(params, RCU.getLocale(request))
     152
     153        // Jasper plugin controller expects data to be a Collection.
     154        chain(controller:'jasper', action:'index', model:[data: dataModel], params:params)
     155
     156    } // assetDetail
     157
     158    def assetRegister = {
     159
     160        params.reportTitle = "Asset Register"
     161        params.logoUrl = grailsApplication.mainContext.getResource('images/logo.png').getURL()
     162        params.currentUser = authService.currentUser
     163        if(params.section.id == 'all')
     164            params.section = "All"
     165        else
     166            params.section = Section.get(params.section.id.toLong())
     167
     168        def dataModel = assetReportService.getAssetRegister(params, RCU.getLocale(request))
     169
     170        // Jasper plugin controller expects data to be a Collection.
     171        chain(controller:'jasper', action:'index', model:[data: [dataModel]], params:params)
     172
     173    } // assetRegister
     174
    140175} // end of class.
Note: See TracChangeset for help on using the changeset viewer.