default to a session cookie instead of setting an explicit timeout, weird timezone...
[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 <FONT CLASS="fsinnerbox-title"><% emt('Search options') %></FONT>
9 <TABLE CLASS="fsinnerbox">
10
11 % unless ( $custnum ) {
12   <& /elements/tr-select-agent.html,
13                  'curr_value'    => scalar( $cgi->param('agentnum') ),
14                  'label'         => emt('Quotations for agent: '),
15                  'disable_empty' => 0,
16   &>
17 % }
18
19   <& /elements/tr-input-beginning_ending.html &>
20
21   <& /elements/tr-input-lessthan_greaterthan.html,
22                 label   => emt('Setup'),
23                 field   => 'total_setup',
24   &>
25
26   <& /elements/tr-input-lessthan_greaterthan.html,
27                 label   => emt('Recurring'),
28                 field   => 'total_recur',
29   &>
30
31 </TABLE>
32
33 <BR>
34 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
35
36 </FORM>
37
38 <& /elements/footer.html &>
39 <%init>
40
41 die "access denied"
42   unless $FS::CurrentUser::CurrentUser->access_right('List quotations');
43
44 my $conf = new FS::Conf;
45
46 my $title = 'Quotation Report';
47 #false laziness w/report_cust_pkg.html
48 my @title_arg = ();
49
50 my $prospectnum = '';
51 my $prospect_main = '';
52 if ( $cgi->param('prospectnum') =~ /^(\d+)$/ ) {
53   $prospectnum = $1;
54   $prospect_main = qsearchs({
55     'table'     => 'prospect_main', 
56     'hashref'   => { 'prospectnum' => $prospectnum },
57     'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
58   }) or die "unknown prospectnum $prospectnum";
59   $title .= ': [_1]';
60   push @title_arg, $prospect_main->name;
61 }
62
63 my $custnum = '';
64 my $cust_main = '';
65 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
66   $custnum = $1;
67   $cust_main = qsearchs({
68     'table'     => 'cust_main', 
69     'hashref'   => { 'custnum' => $custnum },
70     'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
71   }) or die "unknown custnum $custnum";
72   $title .= ': [_1]';
73   push @title_arg, $cust_main->name;
74 }
75
76 </%init>