'Custom method to provide a report on Vehicle Deployment Times
- this is one of the main tools currently used to manage an Incident'

@staticmethod
def vehicle_report(r, **attr):

    rheader = attr.get('rheader', None)
    if rheader:
        rheader = rheader(r)
    station_id = r.id
    if station_id:
        s3db = current.s3db
        dtable = s3db.irs_ireport_vehicle
        vtable = s3db.vehicle_vehicle
        stable = s3db.fire_station_vehicle
        query = (((stable.station_id == station_id) & (stable.vehicle_id == vtable.id)) & (vtable.asset_id == dtable.asset_id))
        current.response.s3.crud_strings['irs_ireport_vehicle'] = Storage(title_report='Vehicle    Deployment    Times')
        req = r.factory(prefix='irs', name='ireport_vehicle', args=['report'], vars=Storage(rows='asset_id', cols='ireport_id', fact='sum(minutes)'))
        req.set_handler('report', S3Report())
        req.resource.add_filter(query)
        return req(rheader=rheader)
