quotations, RT#16996
[freeside.git] / httemplate / view / quotation.html
1 <& /elements/header.html, mt('Quotation View'), $menubar &>
2
3 %#XXX link to order...
4
5 <%doc>
6
7 XXX resending quotations
8
9 % if ( $curuser->access_right('Resend invoices') ) {
10
11     <A HREF="<% $p %>misc/send-invoice.cgi?method=print;<% $link %>"><% mt('Re-print this invoice') |h %></A>
12
13 %   if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) { 
14         | <A HREF="<% $p %>misc/send-invoice.cgi?method=email;<% $link %>"><% mt('Re-email this invoice') |h %></A>
15 %   } 
16
17 %   if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) { 
18         | <A HREF="<% $p %>misc/send-invoice.cgi?method=fax;<% $link %>"><% mt('Re-fax this invoice') |h %></A>
19 %   } 
20
21     <BR><BR>
22
23 % } 
24
25 </%doc>
26
27 % if ( $curuser->access_right('Order customer package') ) {
28   <& /elements/order_pkg_link.html,
29        'label'       => emt('Add package'),
30        'actionlabel' => emt('Add package'),
31        map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
32   &>
33 % }
34
35 % if ( $conf->exists('quotation_latex') ) { 
36   | <A HREF="<% $p %>view/quotation-pdf.cgi?<% $link %>"><% mt('View typeset quotation PDF') |h %></A>
37   <BR><BR>
38 % } 
39
40 % if ( $conf->exists('quotation_html') ) { 
41     <% join('', $quotation->print_html() ) %>
42 % } else { 
43 %   die "quotation_html config missing";
44 % }
45 % #plaintext quotations? <PRE><% join('', $quotation->print_text() ) %></PRE>
46
47 </%doc>
48
49 <& /elements/footer.html &>
50 <%init>
51
52 my $curuser = $FS::CurrentUser::CurrentUser;
53
54 #die "access denied"
55 #  unless $curuser->access_right('View quotations');
56
57 my $quotationnum;
58 my($query) = $cgi->keywords;
59 if ( $query =~ /^(\d+)$/ ) {
60   $quotationnum = $1;
61 } else {
62   $quotationnum = $cgi->param('quotationnum');
63 }
64
65 my $conf = new FS::Conf;
66
67 my $quotation = qsearchs({
68   'select'    => 'quotation.*',
69   'table'     => 'quotation',
70   #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
71   'hashref'   => { 'quotationnum' => $quotationnum },
72   #'extra_sql' => ' AND '. $curuser->agentnums_sql,
73 });
74 die "Quotation #$quotationnum not found!" unless $quotation;
75
76 my $menubar;
77 if ( my $custnum = $quotation->custnum ) {
78   my $display_custnum = $quotation->cust_main->display_custnum;
79   $menubar = menubar(
80     emt("View this customer (#[_1])",$display_custnum) => "${p}view/cust_main.cgi?$custnum",
81   );
82 } elsif ( my $prospectnum = $quotation->prospectnum ) {
83   $menubar = menubar(
84     emt("View this prospect (#[_1])",$prospectnum) => "${p}view/prospect_main.html?$prospectnum",
85   );
86 }
87
88 my $link = "quotationnum=$quotationnum";
89 #$link .= ';template='. uri_escape($template) if $template;
90 #$link .= ';notice_name='. $notice_name if $notice_name;
91
92
93 </%init>