Ignore:
Timestamp:
Nov 15, 2010, 11:48:34 AM (13 years ago)
Author:
gav
Message:

Fix small bug in reactive ratio report, where BigDecimal? not returned and therefore setScale() not available.
Also return error message for endDate < startDate.

File:
1 edited

Legend:

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

    r706 r708  
    9191        params.endDateString = g.formatDate(format: "EEE, dd-MMM-yyyy", date: params.endDate)
    9292
    93         def dataModel = taskReportService.getReactiveRatio(params, RCU.getLocale(request))
    94 
    95         // Jasper plugin controller expects data to be a Collection.
    96         chain(controller:'jasper', action:'index', model:[data: [dataModel]], params:params)
     93        def result = taskReportService.getReactiveRatio(params, RCU.getLocale(request))
     94
     95        if(!result.error) {
     96            // Jasper plugin controller expects data to be a Collection.
     97            chain(controller:'jasper', action:'index', model:[data: [result]], params:params)
     98            return
     99        }
     100
     101        flash.errorMessage = g.message(code: result.error.code, args: result.error.args)
     102        redirect(controller: 'appCore', action: 'start', params: [showTab:'showReportsTab'])
    97103
    98104    } // reactiveRatio
Note: See TracChangeset for help on using the changeset viewer.