1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
<& /elements/header.html, mt('Voided Invoice'), menubar(
emt("View this customer (#[_1])",$display_custnum) => "${p}view/cust_main.cgi?$custnum",
) &>
<SCRIPT TYPE="text/javascript">
function areyousure(href, message) {
if (confirm(message) == true)
window.location.href = href;
}
</SCRIPT>
<% 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
)
%>
<BR><BR>
% #voided PDFs?
% #if ( $conf->exists('invoice_latex') ) {
%#
%# <A HREF="<% $p %>view/cust_bill-pdf.cgi?<% $link %>"><% mt('View typeset invoice PDF') |h %></A>
%# <BR><BR>
% #}
%#something very big and obvious showing its voided...
<DIV STYLE="color:#FF0000; font-size:1000%; font-weight:bold; z-index:100;
position: absolute; top: 300px; left: 130px;
zoom: 1; filter: alpha(opacity=25); opacity: 0.25;
">VOID</DIV>
% if ( $conf->exists('invoice_html') ) {
<% join('', $cust_bill_void->print_html(\%opt) ) %>
% } else {
<PRE><% join('', $cust_bill_void->print_text(\%opt) ) %></PRE>
% }
<& /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);
'<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>';
}
</%init>
|