X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpayment_history.html;h=cbe143d598b1e57332ee52384e54f044c105da10;hb=a5f95feae5eca0eeb14de0cd21931cb3cfd93ffe;hp=4e4cd154f22fe07c51068ffeed7eddd4e2136c0f;hpb=c8cccb4a92adceb943c635fe62dad0d034462ce0;p=freeside.git
diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html
index 4e4cd154f..cbe143d59 100644
--- a/httemplate/view/cust_main/payment_history.html
+++ b/httemplate/view/cust_main/payment_history.html
@@ -18,6 +18,7 @@
% if ( ( $payby{'CARD'} || $payby{'DCRD'} )
% && $curuser->access_right('Process payment')
+% && ! $cust_main->is_encrypted($cust_main->payinfo)
% ) {
<% $s++ ? ' | ' : '' %>
Process credit card payment
@@ -25,6 +26,7 @@
% if ( ( $payby{'CHEK'} || $payby{'DCHK'} )
% && $curuser->access_right('Process payment')
+% && ! $cust_main->is_encrypted($cust_main->payinfo)
% ) {
<% $s++ ? ' | ' : '' %>
Process electronic check (ACH) payment
@@ -47,6 +49,17 @@
% }
+% if ( $conf->exists('batch-enable')
+% && $curuser->access_right('View customer batched payments')
+% ) {
+ View batched payments:
+% foreach my $status (qw( Queued In-transit Complete All )) {
+ <% $status %>
+ <% $status ne 'All' ? '|' : '' %>
+% }
+
+% }
+
%#get payment history
%my @history = ();
%
@@ -60,11 +73,21 @@
% my $link = $curuser->access_right('View invoices')
% ? qq!!
% : '';
+% my $events = '';
+% if ( $cust_bill->num_cust_event
+% && ( $curuser->access_right('Billing event reports')
+% || $curuser->access_right('View customer billing events')
+% )
+% ) {
+% $events =
+% qq!
( View invoice events )';
+% }
% push @history, {
% 'date' => $cust_bill->_date,
% 'desc' => $link. $pre.
% "Invoice #$invnum (Balance \$". $cust_bill->owed. ')'.
-% $post. ( $link ? '' : '' ),
+% $post. ( $link ? '' : '' ). $events,
% 'charge' => $cust_bill->charged,
% };
%}
@@ -76,7 +99,7 @@
%
% my $payinfo;
% if ( $payby eq 'CARD' ) {
-% $payinfo = $cust_pay->payinfo_masked;
+% $payinfo = $cust_pay->paymask;
% } elsif ( $payby eq 'CHEK' && $cust_pay->payinfo =~ /^(\d+)\@(\d+)$/ ) {
% $payinfo = "ABA $2, Acct# $1";
% } else {
@@ -103,10 +126,11 @@
% #completely unapplied
% $pre = 'Unapplied ';
% $post = '';
-% $apply = qq! (apply)!;
-%
+% if ( $curuser->access_right('Apply payment') ) {
+% $apply = qq! (apply)!;
+% }
% } elsif ( scalar(@cust_bill_pay) == 1
% && scalar(@cust_pay_refund) == 0
% && $cust_pay->unapplied == 0 ) {
@@ -140,14 +164,20 @@
% if ( $cust_pay->unapplied > 0 ) {
% $desc .= ' '.
% '$'.
-% $cust_pay->unapplied. ' unapplied'.
-% qq! (apply)!.
-% '
';
+% $cust_pay->unapplied. ' unapplied';
+% if ( $curuser->access_right('Apply payment') ) {
+% $desc .= qq! (apply)!;
+% }
+% $desc .= '
';
% }
% }
%
+% my $view = qq! (view receipt)!;
+%
% my $refund = '';
% my $refund_days = $conf->config('card_refund-days') || 120;
% if ( $cust_pay->closed !~ /^Y/i
@@ -216,7 +246,7 @@
% push @history, {
% 'date' => $cust_pay->_date,
% 'desc' => $pre. "Payment$post$info$desc".
-% "$apply$refund$void$delete$unapply",
+% "$view$apply$refund$void$delete$unapply",
% 'payment' => $cust_pay->paid,
% 'target' => $target,
% };
@@ -227,7 +257,7 @@
%
% my $payby = $cust_pay_void->payby;
% my $payinfo = $payby eq 'CARD'
-% ? $cust_pay_void->payinfo_masked
+% ? $cust_pay_void->paymask
% : $cust_pay_void->payinfo;
%
% $payby =~ s/^BILL$/Check #/ if $payinfo;
@@ -274,9 +304,11 @@
% #completely unapplied
% $pre = 'Unapplied ';
% $post = '';
-% $apply = qq! (apply)!;
+% if ( $curuser->access_right('Apply credit') ) {
+% $apply = qq! (apply)!;
+% }
% } elsif ( scalar(@cust_credit_bill) == 1
% && scalar(@cust_credit_refund) == 0
% && $cust_credit->credited == 0 ) {
@@ -309,11 +341,13 @@
% }
% if ( $cust_credit->credited > 0 ) {
% $desc .= ' $'.
-% $cust_credit->credited. ' unapplied'.
-% qq! (apply)!.
-% '
';
+% $cust_credit->credited. ' unapplied';
+% if ( $curuser->access_right('Apply credit') ) {
+% $desc .= qq! (apply)!;
+% }
+% $desc .= '
';
% }
% }
%#
@@ -363,16 +397,30 @@
%
% my $payby = $cust_refund->payby;
% my $payinfo = $payby eq 'CARD'
-% ? $cust_refund->payinfo_masked
+% ? $cust_refund->paymask
% : $cust_refund->payinfo;
%
% $payby =~ s/^BILL$/Check #/ if $payinfo;
% $payby =~ s/^CHEK$/Electronic check /;
% $payby =~ s/^(CARD|COMP)$/$1 /;
%
+% my $delete = '';
+% if ( $cust_refund->closed !~ /^Y/i
+% && $conf->exists('deleterefunds')
+% && $curuser->access_right('Delete refund')
+% )
+% {
+% $delete = qq! (delete)!;
+% }
+%
% push @history, {
% 'date' => $cust_refund->_date,
-% 'desc' => "Refund ($payby$payinfo) by ". $cust_refund->otaker,
+% 'desc' => "Refund ($payby$payinfo) by ". $cust_refund->otaker. "
".
+% $delete,
% 'refund' => $cust_refund->refund,
% };
%
@@ -400,6 +448,31 @@
%
%#display payment history
%
+%sub balance_forward_row {
+% my( $b, $date ) = @_;
+% my $conf = new FS::Conf;
+% my $money_char = $conf->config('money_char') || '$';
+% ( my $balance_forward = $money_char. $b ) =~ s/^\$\-/- \$/;
+
+