<& /elements/header.html, mt('Voided Invoice'), menubar( emt("View this customer (#[_1])",$display_custnum) => "${p}view/cust_main.cgi?$custnum", ) &> <% areyousure_link("${p}misc/unvoid-cust_bill_void.html?invnum=". $cust_bill_void->invnum, emt('Are you sure you want to unvoid this invoice?'), emt('Unvoid this invoice'), #tooltip emt('Unvoid this invoice') #link ) %>

% #voided PDFs? % #if ( $conf->exists('invoice_latex') ) { %# %# <% mt('View typeset invoice PDF') |h %> %#

% #} %#something very big and obvious showing its voided...
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"; sub areyousure_link { my ($url,$msg,$title,$label) = (shift,shift,shift,shift); ''.$label.''; }