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" ) %>
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', "Payment 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">Payment#</TD>
43 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->paynum %></B></TD>
47 <TD ALIGN="right">Date</TD>
48 <TD BGCOLOR="#FFFFFF"><B><% time2str"%a %b %o, %Y %r", $cust_pay->_date %></B></TD>
52 <TD ALIGN="right">Amount</TD>
53 <TD BGCOLOR="#FFFFFF"><B><% $money_char. $cust_pay->paid %></B></TD>
57 <TD ALIGN="right">Payment method</TD>
58 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->payby_name %> #<% $cust_pay->paymask %></B></TD>
61 % if ( $cust_pay->payby =~ /^(CARD|CHEK|LECB)$/ && $cust_pay->paybatch ) {
64 <TD ALIGN="right">Processor</TD>
65 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->processor %></B></TD>
69 <TD ALIGN="right">Authorization#</TD>
70 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->authorization %></B></TD>
73 % if ( $cust_pay->order_number ) {
75 <TD ALIGN="right">Order#</TD>
76 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->order_number %></B></TD>
84 % if ( $link eq 'print' ) {
86 <SCRIPT TYPE="text/javascript">
92 % if ( $link =~ /^(popup|print)$/ ) {
96 <% include('/elements/footer.html') %>
101 my $curuser = $FS::CurrentUser::CurrentUser;
104 unless $curuser->access_right('View invoices') #remove this in 1.9 EVENTUALLY
105 || $curuser->access_right('View customer payments');
107 $cgi->param('paynum') =~ /^(\d+)$/ or die "no paynum";
111 if ( $cgi->param('link') =~ /^(\w+)$/ ) {
115 my $cust_pay = qsearchs({
116 'select' => 'cust_pay.*',
117 'table' => 'cust_pay',
118 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
119 'hashref' => { 'paynum' => $paynum },
120 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
122 die "Payment #$paynum not found!" unless $cust_pay;
124 my $pr_link = "${p}view/cust_pay.html?link=print;paynum=$paynum";
126 my $custnum = $cust_pay->custnum;
127 my $display_custnum = $cust_pay->cust_main->display_custnum;
129 my $conf = new FS::Conf;
131 my $money_char = $conf->config('money_char') || '$';
133 tie my %payby, 'Tie::IxHash', FS::payby->payby2longname;