enable CardFortress in test database, #71513
[freeside.git] / httemplate / search / report_quotation.html
1 <& /elements/header.html, mt($title, @title_arg) &>
2
3 <FORM ACTION="quotation.html" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="_date">
5 <INPUT TYPE="hidden" NAME="prospectnum" VALUE="<% $prospectnum %>">
6 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
7
8 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
9
10 % unless ( $custnum ) {
11   <& /elements/tr-select-agent.html,
12                  'curr_value'    => scalar( $cgi->param('agentnum') ),
13                  'label'         => emt('Quotations for agent: '),
14                  'disable_empty' => 0,
15   &>
16 % }
17
18   <& /elements/tr-input-beginning_ending.html &>
19
20   <& /elements/tr-input-lessthan_greaterthan.html,
21                 label   => emt('Setup'),
22                 field   => 'total_setup',
23   &>
24
25   <& /elements/tr-input-lessthan_greaterthan.html,
26                 label   => emt('Recurring'),
27                 field   => 'total_recur',
28   &>
29
30 </TABLE>
31
32 <BR>
33 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
34
35 </FORM>
36
37 <& /elements/footer.html &>
38 <%init>
39
40 die "access denied"
41   unless $FS::CurrentUser::CurrentUser->access_right('List quotations');
42
43 my $conf = new FS::Conf;
44
45 my $title = 'Quotation Report';
46 #false laziness w/report_cust_pkg.html
47 my @title_arg = ();
48
49 my $prospectnum = '';
50 my $prospect_main = '';
51 if ( $cgi->param('prospectnum') =~ /^(\d+)$/ ) {
52   $prospectnum = $1;
53   $prospect_main = qsearchs({
54     'table'     => 'prospect_main', 
55     'hashref'   => { 'prospectnum' => $prospectnum },
56     'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
57   }) or die "unknown prospectnum $prospectnum";
58   $title .= ': [_1]';
59   push @title_arg, $prospect_main->name;
60 }
61
62 my $custnum = '';
63 my $cust_main = '';
64 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
65   $custnum = $1;
66   $cust_main = qsearchs({
67     'table'     => 'cust_main', 
68     'hashref'   => { 'custnum' => $custnum },
69     'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
70   }) or die "unknown custnum $custnum";
71   $title .= ': [_1]';
72   push @title_arg, $cust_main->name;
73 }
74
75 </%init>