5 use OpenILS::Reporter::SQLBuilder;
10 column => { transform => month_trunc => colname => 'checkin_time' },
13 { relation=> 'circ-checkin_lib-aou',
14 column => { colname => 'shortname', transform => 'Bare'},
15 alias => 'Library Short Name',
17 { relation=> 'circ-circ_staff-au-card-ac',
19 alias => 'User Barcode',
21 { relation=> 'circ-id-mb',
22 column => { transform => sum => colname => 'amount' },
27 table => 'action.circulation',
32 alias => 'circ-circ_staff-au',
37 table => 'actor.card',
38 alias => 'circ-circ_staff-au-card-ac',
45 table => 'actor.org_unit',
46 alias => 'circ-checkin_lib-aou',
51 table => 'money.billing',
52 alias => 'circ-id-mb',
59 { relation => 'circ-checkin_lib-aou',
61 condition => { 'in' => '::PARAM1' },
64 column => { transform => month_trunc => colname => 'checkin_time' },
65 condition => { 'in' => '::PARAM2' },
67 { relation => 'circ-id-mb',
69 condition => { '=' => '::PARAM7' },
74 { relation=> 'circ-checkin_lib-aou',
75 column => { colname => 'shortname', transform => 'Bare' },
78 column => { transform => month_trunc => colname => 'checkin_time' },
79 direction => 'descending'
81 { relation=> 'circ-circ_staff-au-card-ac',
91 PARAM1 => [ 18, 19, 20, 21, 22, 23 ],
92 #PARAM2 => ['2006-07','2006-08','2006-09'],
93 PARAM2 => [{transform => 'relative_month', params => [-2]},{transform => 'relative_month', params => [-3]}],
94 PARAM3 => 'Billed Amount',
95 PARAM4 => 'Checkin Date',
96 PARAM5 => [{ transform => 'Bare', params => [10] },{ transform => 'Bare', params => [100] }],
101 my $r = OpenILS::Reporter::SQLBuilder->new;
103 $r->register_params( $params );
104 my $rs = $r->parse_report( $report );
105 $rs->relative_time('2006-10-01T00:00:00-4');
107 print "Column Labels: " . join(', ', $rs->column_label_list) . "\n";
112 print "SQL group by list: ".join(',',$rs->group_by_list)."\n";
113 print "Perl group by list: ".join(',',$rs->group_by_list(0))."\n";