invoice voiding, RT#18677
[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 <& /elements/footer.html &>
48 <%init>
49
50 my $curuser = $FS::CurrentUser::CurrentUser;
51
52 #die "access denied"
53 #  unless $curuser->access_right('View quotations');
54
55 my $quotationnum;
56 my($query) = $cgi->keywords;
57 if ( $query =~ /^(\d+)$/ ) {
58   $quotationnum = $1;
59 } else {
60   $quotationnum = $cgi->param('quotationnum');
61 }
62
63 my $conf = new FS::Conf;
64
65 my $quotation = qsearchs({
66   'select'    => 'quotation.*',
67   'table'     => 'quotation',
68   #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
69   'hashref'   => { 'quotationnum' => $quotationnum },
70   #'extra_sql' => ' AND '. $curuser->agentnums_sql,
71 });
72 die "Quotation #$quotationnum not found!" unless $quotation;
73
74 my $menubar;
75 if ( my $custnum = $quotation->custnum ) {
76   my $display_custnum = $quotation->cust_main->display_custnum;
77   $menubar = menubar(
78     emt("View this customer (#[_1])",$display_custnum) => "${p}view/cust_main.cgi?$custnum",
79   );
80 } elsif ( my $prospectnum = $quotation->prospectnum ) {
81   $menubar = menubar(
82     emt("View this prospect (#[_1])",$prospectnum) => "${p}view/prospect_main.html?$prospectnum",
83   );
84 }
85
86 my $link = "quotationnum=$quotationnum";
87 #$link .= ';template='. uri_escape($template) if $template;
88 #$link .= ';notice_name='. $notice_name if $notice_name;
89
90
91 </%init>