enable CardFortress in test database, #71513
[freeside.git] / httemplate / search / vend_main.html
1 <& elements/search.html,
2      'title'       => 'Payables summary by vendor',
3      'name'        => 'vendors',
4      'query'       => $query,
5      'count_query' => $count_query,
6      'count_addl'  => [ '$%.2f total', ],
7      'header'      => [
8                         'Vendor',
9                         'Class',
10                         'Amount',
11                         '',
12                       ],
13      'fields'      => [
14                         sub { shift->vendname },
15                         sub { shift->vend_class->classname },
16                         'sum_charged',
17                       ],
18
19 &>
20 <%init>
21
22 die "access denied"
23   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
24
25 my %search = ();
26
27 # begin/end/beginning/ending
28 my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, '_date');
29 $search{'_date'} = [ $beginning, $ending ];
30
31 ($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, 'payment_date');
32 $search{'payment_date'} = [ $beginning, $ending ];
33
34 $search{'classnum'} = $cgi->param('classnum');
35
36 my $query = FS::vend_main->search( \%search );
37 my $count_query = delete( $query->{'count_query'} );
38
39 </%init>
40