1 % if ( $link eq 'popup' ) {
3 <% include('/elements/header-popup.html', "$thing 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', "$thing 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', "$thing 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>
54 <TD ALIGN="right">Void Date</TD>
55 <TD BGCOLOR="#FFFFFF"><B><% time2str"%a %b %o, %Y %r", $cust_pay->void_date %></B></TD>
59 %# <TD ALIGN="right">Void reason</TD>
60 %# <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->reason %></B></TD>
66 <TD ALIGN="right">Amount</TD>
67 <TD BGCOLOR="#FFFFFF"><B><% $money_char. $cust_pay->paid %></B></TD>
71 <TD ALIGN="right">Payment method</TD>
72 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->payby_name %> #<% $cust_pay->paymask %></B></TD>
75 % if ( $cust_pay->payby =~ /^(CARD|CHEK|LECB)$/ && $cust_pay->paybatch ) {
78 <TD ALIGN="right">Processor</TD>
79 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->processor %></B></TD>
83 <TD ALIGN="right">Authorization#</TD>
84 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->authorization %></B></TD>
87 % if ( $cust_pay->order_number ) {
89 <TD ALIGN="right">Order#</TD>
90 <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->order_number %></B></TD>
96 % if ( $conf->exists('pkg-balances') && $cust_pay->pkgnum ) {
97 % my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_pay->pkgnum } );
99 <TD ALIGN="right">For package</TD>
100 <TD BGCOLOR="#FFFFFF"><B><% $cust_pkg->pkg_label_long %></B></TD>
107 % if ( $link eq 'print' ) {
109 <SCRIPT TYPE="text/javascript">
115 % if ( $link =~ /^(popup|print)$/ ) {
119 <% include('/elements/footer.html') %>
124 my $curuser = $FS::CurrentUser::CurrentUser;
127 unless $curuser->access_right('View invoices') #remove this in 1.9 EVENTUALLY
128 || $curuser->access_right('View customer payments');
130 $cgi->param('paynum') =~ /^(\d+)$/ or die "no paynum";
134 if ( $cgi->param('link') =~ /^(\w+)$/ ) {
138 my $void = $cgi->param('void') ? 1 : 0;
139 my $thing = $void ? 'Voided Payment' : 'Payment';
140 my $table = $void ? 'cust_pay_void' : 'cust_pay';
142 my $cust_pay = qsearchs({
143 'select' => "$table.*",
145 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
146 'hashref' => { 'paynum' => $paynum },
147 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
149 die "$thing #$paynum not found!" unless $cust_pay;
151 my $pr_link = "${p}view/cust_pay.html?link=print;paynum=$paynum;void=$void";
153 my $custnum = $cust_pay->custnum;
154 my $display_custnum = $cust_pay->cust_main->display_custnum;
156 my $conf = new FS::Conf;
158 my $money_char = $conf->config('money_char') || '$';
160 tie my %payby, 'Tie::IxHash', FS::payby->payby2longname;