3 <& elements/grouped-search/html,
6 'title' => 'Page title',
8 'name_singular' => 'item',
11 'table' => 'tablename',
12 'hashref' => { 'field' => 'value', ... }, # optional
16 #'order_by' is not allowed
18 'group_column' => 'classnum', # must be a single field
19 # 'group_table' => 'mytable', # optional; defaults to the one in the query
20 'group_label' => 'classname',
21 'subtotal' => { amount => 'sum(amount)', ... }
22 # The subtotal row will be generated as an FS::* object of the same type
23 # as all the detail rows.
24 # The only fields present will be the grouping column and any subtotals
25 # defined in 'subtotal'. Key is a field name (in the FS::* object),
26 # value is an SQL aggregate expression.
28 # How to display that object: arrayref of literal strings or coderefs
29 # (the subtotal object will be passed). These will be placed in table
30 # cells, and can contain HTML.
33 sub { sprintf('%.2f', $_[0]->amount) },
36 'order_by' => '_date', # SQL ordering expression for the detail rows
38 'header' => [ ... ], # per search.html
45 if ($cgi->param('type') =~ /^(html|html-print|xls)$/) {
49 <& "grouped-search/$type", @_ &>