1 % if ( $link eq 'popup' ) {
3 <% include('/elements/header-popup.html', "Refund Receipt" ) %>
5 <CENTER><A HREF="javascript:self.parent.location = '<% $pr_link %>'">Print</A></CENTER><BR>
7 % } elsif ( $link eq 'print' ) {
9 <% include('/elements/header-popup.html', "Refund Receipt" ) %>
11 % #it would be nice if the menubar could be hidden for print, but better to
12 % # have it available than not, otherwise the user winds up at a dead end
14 "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
21 <% include('/elements/header.html', "Refund Receipt", menubar(
22 "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
23 'Print receipt' => $pr_link,
29 % unless ($link eq 'popup' ) {
30 <% include('/elements/small_custview.html',
32 scalar($conf->config('countrydefault')),
39 <% ntable("#cccccc", 2) %>
42 <TD ALIGN="right">Refund#</TD>
43 <TD BGCOLOR="#FFFFFF"><B><% $cust_refund->refundnum %></B></TD>
47 <TD ALIGN="right">Date</TD>
48 <TD BGCOLOR="#FFFFFF"><B><% time2str"%a %b %o, %Y %r", $cust_refund->_date %></B></TD>
52 <TD ALIGN="right">Amount</TD>
53 <TD BGCOLOR="#FFFFFF"><B><% $money_char. $cust_refund->refund %></B></TD>
57 <TD ALIGN="right">Reason</TD>
58 <TD BGCOLOR="#FFFFFF"><B><% $cust_refund->reason %></B></TD>
62 <TD ALIGN="right">Refund method</TD>
63 <TD BGCOLOR="#FFFFFF"><B><% $cust_refund->payby_name %><% $cust_refund->paymask ? ' #'.$cust_refund->paymask : '' %></B></TD>
66 % if ( $cust_refund->payby =~ /^(CARD|CHEK|LECB)$/ && $cust_refund->paybatch ) {
69 <TD ALIGN="right">Processor</TD>
70 <TD BGCOLOR="#FFFFFF"><B><% $cust_refund->processor %></B></TD>
74 <TD ALIGN="right">Authorization#</TD>
75 <TD BGCOLOR="#FFFFFF"><B><% $cust_refund->authorization %></B></TD>
78 % if ( $cust_refund->order_number ) {
80 <TD ALIGN="right">Order#</TD>
81 <TD BGCOLOR="#FFFFFF"><B><% $cust_refund->order_number %></B></TD>
89 % if ( $link eq 'print' ) {
91 <SCRIPT TYPE="text/javascript">
97 % if ( $link =~ /^(popup|print)$/ ) {
101 <% include('/elements/footer.html') %>
106 my $curuser = $FS::CurrentUser::CurrentUser;
109 unless $curuser->access_right('View invoices') #remove this in 1.9 EVENTUALLY
110 || $curuser->access_right('View customer payments');
111 #'View customer refunds' ???
114 $cgi->param('refundnum') =~ /^(\d+)$/ or die "no refundnum";
118 if ( $cgi->param('link') =~ /^(\w+)$/ ) {
122 my $cust_refund = qsearchs({
123 'select' => 'cust_refund.*',
124 'table' => 'cust_refund',
125 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
126 'hashref' => { 'refundnum' => $refundnum },
127 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
129 die "Refund #$refundnum not found!" unless $cust_refund;
131 my $pr_link = "${p}view/cust_refund.html?link=print;refundnum=$refundnum";
133 my $custnum = $cust_refund->custnum;
134 my $display_custnum = $cust_refund->cust_main->display_custnum;
136 my $conf = new FS::Conf;
138 my $money_char = $conf->config('money_char') || '$';
140 tie my %payby, 'Tie::IxHash', FS::payby->payby2longname;