event refactor, landing on HEAD!
[freeside.git] / httemplate / view / cust_main / payment_history.html
index 43c55e8..099bc4f 100644 (file)
   <BR>
 % } 
 
+% if ( $conf->exists('batch-enable')
+%      #&& $curuser->access_right('View customer tax exemptions')
+%    ) { 
+  View batched payments:
+%   foreach my $status (qw( Queued In-transit Complete All )) {
+      <A HREF="<% $p %>search/cust_pay_batch.cgi?status=<% $status{$status} %>;custnum=<% $custnum %>"><% $status %></A> 
+      <% $status ne 'All' ? '|' : '' %>
+%   }
+  <BR>
+% } 
+
 %#get payment history
 %my @history = ();
 %
 %  my $link = $curuser->access_right('View invoices')
 %               ? qq!<A HREF="${p}view/cust_bill.cgi?$invnum">!
 %               : '';
+%  my $events = '';
+%  if ( $cust_bill->num_cust_event
+%       && (    $curuser->access_right('Billing event reports')
+%            || $curuser->access_right('View customer billing events')
+%          )
+%     ) {
+%    $events =
+%      qq!<BR><FONT SIZE="-1"><A HREF="${p}search/cust_event.html?invnum=!.
+%      $cust_bill->invnum. '">(&nbsp;View invoice events&nbsp;)</A></FONT>';
+%  }
 %  push @history, {
 %    'date'   => $cust_bill->_date,
 %    'desc'   => $link. $pre.
 %                "Invoice #$invnum (Balance \$". $cust_bill->owed. ')'.
-%                $post. ( $link ? '</A>' : '' ),
+%                $post. ( $link ? '</A>' : '' ). $events,
 %    'charge' => $cust_bill->charged,
 %  };
 %}
@@ -584,4 +605,11 @@ my @payby = grep /\w/, $conf->config('payby');
   unless @payby;
 my %payby = map { $_=>1 } @payby;
 
+my %status = (
+  'Queued'     => 'O', #Open
+  'In-transit' => 'I',
+  'Complete'   => 'R', #Resolved
+  'All'        => '',
+);
+
 </%init>