<& /elements/header.html, mt('Voided Invoice'), menubar( emt("View this customer (#[_1])",$display_custnum) => "${p}view/cust_main.cgi?$custnum", ) &> %#XXX something very big and obvious showing its voided... % #voided PDFs? % #if ( $conf->exists('invoice_latex') ) { %# %# <% mt('View typeset invoice PDF') |h %> %#

% #}
VOID
% if ( $conf->exists('invoice_html') ) { <% join('', $cust_bill_void->print_html(\%opt) ) %> % } else {
<% join('', $cust_bill_void->print_text(\%opt) ) %>
% } <& /elements/footer.html &> <%init> my $curuser = $FS::CurrentUser::CurrentUser; die "access denied" unless $curuser->access_right('View invoices'); my $invnum; my($query) = $cgi->keywords; if ( $query =~ /^(\d+)$/ ) { $invnum = $1; } else { $invnum = $cgi->param('invnum'); } my $conf = new FS::Conf; my %opt = ( 'unsquelch_cdr' => $conf->exists('voip-cdr_email'), ); my $cust_bill_void = qsearchs({ 'select' => 'cust_bill_void.*', 'table' => 'cust_bill_void', #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', 'hashref' => { 'invnum' => $invnum }, #'extra_sql' => ' AND '. $curuser->agentnums_sql, }); die "Voided invoice #$invnum not found!" unless $cust_bill_void; my $custnum = $cust_bill_void->custnum; my $display_custnum = $cust_bill_void->cust_main->display_custnum; #my $link = "invnum=$invnum";