1 % if ( $link eq 'popup' ) {
3 <% include('/elements/header-popup.html', "Payment 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', "Payment Receipt" ) %>
13 <% include('/elements/header.html', "Payment Receipt", menubar(
14 "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
15 'Print receipt' => $pr_link,
21 % unless ($link eq 'popup' ) {
22 <% include('/elements/small_custview.html',
24 scalar($conf->config('countrydefault')),
31 <% ntable("#cccccc", 2) %>
34 <TD ALIGN="right">Payment#</TD>
35 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->paynum %></B></TD>
39 <TD ALIGN="right">Date</TD>
40 <TD BGCOLOR="#FFFFFF"><B><% time2str"%a %b %o, %Y %r", $cust_pay->_date %></B></TD>
44 <TD ALIGN="right">Amount</TD>
45 <TD BGCOLOR="#FFFFFF"><B><% $money_char. $cust_pay->paid %></B></TD>
49 <TD ALIGN="right">Payment method</TD>
50 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->payby_name %> #<% $cust_pay->paymask %></B></TD>
53 % if ( $cust_pay->payby =~ /^(CARD|CHEK|LECB)$/ && $cust_pay->paybatch ) {
56 <TD ALIGN="right">Processor</TD>
57 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->processor %></B></TD>
61 <TD ALIGN="right">Authorization#</TD>
62 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->authorization %></B></TD>
65 % if ( $cust_pay->order_number ) {
67 <TD ALIGN="right">Order#</TD>
68 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->order_number %></B></TD>
76 % if ( $link eq 'print' ) {
78 <SCRIPT TYPE="text/javascript">
84 % if ( $link =~ /^(popup|print)$/ ) {
88 <% include('/elements/footer.html') %>
93 my $curuser = $FS::CurrentUser::CurrentUser;
96 unless $curuser->access_right('View invoices') #remove this in 1.9
97 || $curuser->access_right('View customer payments');
99 $cgi->param('paynum') =~ /^(\d+)$/ or die "no paynum";
103 if ( $cgi->param('link') =~ /^(\w+)$/ ) {
107 my $cust_pay = qsearchs({
108 'select' => 'cust_pay.*',
109 'table' => 'cust_pay',
110 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
111 'hashref' => { 'paynum' => $paynum },
112 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
114 die "Payment #$paynum not found!" unless $cust_pay;
116 my $pr_link = "${p}view/cust_pay.html?link=print;paynum=$paynum";
118 my $custnum = $cust_pay->custnum;
120 my $conf = new FS::Conf;
122 my $money_char = $conf->config('money_char') || '$';
124 tie my %payby, 'Tie::IxHash', FS::payby->payby2longname;