1 <& /elements/header.html, mt('Legacy Invoice View'), menubar(
2 emt("View this customer (#[_1])",$display_custnum) => "${p}view/cust_main.cgi?$custnum",
5 % if ( 0 ) { #implement resending of legacy invoices?
6 % #if ( $curuser->access_right('Resend invoices') ) {
8 <A HREF="<% $p %>misc/send-invoice.cgi?method=print;<% $link %>"><% mt('Re-print this invoice') |h %></A>
10 % if ( grep { $_ ne 'POST' } $legacy_cust_bill->cust_main->invoicing_list ) {
11 | <A HREF="<% $p %>misc/send-invoice.cgi?method=email;<% $link %>"><% mt('Re-email this invoice') |h %></A>
14 % if ( $conf->exists('hylafax') && length($legacy_cust_bill->cust_main->fax) ) {
15 | <A HREF="<% $p %>misc/send-invoice.cgi?method=fax;<% $link %>"><% mt('Re-fax this invoice') |h %></A>
22 % if ( length($legacy_cust_bill->content_pdf) ) {
24 <A HREF="<% $p %>view/legacy_cust_bill-pdf.cgi?<% $link %>"><% mt('View typeset invoice PDF') |h %></A>
28 <% $legacy_cust_bill->content_html %>
30 <& /elements/footer.html &>
33 my $curuser = $FS::CurrentUser::CurrentUser;
36 unless $curuser->access_right('View invoices');
39 my($query) = $cgi->keywords;
40 if ( $query =~ /^(\d+)$/ ) {
43 $legacyinvnum = $cgi->param('legacyinvnum');
46 my $conf = new FS::Conf;
48 my $legacy_cust_bill = qsearchs({
49 'select' => 'legacy_cust_bill.*',
50 'table' => 'legacy_cust_bill',
51 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
52 'hashref' => { 'legacyinvnum' => $legacyinvnum },
53 'extra_sql' => ' AND '. $curuser->agentnums_sql,
55 die "Legacy invoice #$legacyinvnum not found!" unless $legacy_cust_bill;
57 my $custnum = $legacy_cust_bill->custnum;
58 my $display_custnum = $legacy_cust_bill->cust_main->display_custnum;
60 my $link = "legacyinvnum=$legacyinvnum";