X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpayment_history.html;h=66008ee29a79ebf9cafd2fa1490684c6b8287748;hb=8e73bf5782dc6fe2b299ba759ad15780a8946cc4;hp=6630d12a5d115f2d46dc01a4634a6dfd42e35766;hpb=431c9ca4fab151862bd24322bf8a1f9252fb38fc;p=freeside.git diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 6630d12a5..66008ee29 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -34,7 +34,7 @@ <% mt('Enter Western Union payment') |h %> % } -
+<% $s ? '
' : '' %> % $s=0; % if ( ( $payby{'CARD'} || $payby{'DCRD'} ) @@ -58,11 +58,13 @@ <% mt('Post manual (offline/POS) credit card payment') |h %> % } -
+<% $s ? '
' : '' %> -%# credit link +%# credit links +% $s=0; % if ( $curuser->access_right('Post credit') ) { + <% $s++ ? ' | ' : '' %> <& /elements/popup_link-cust_main.html, 'label' => emt('Enter credit'), 'action' => "${p}edit/cust_credit.cgi", @@ -70,18 +72,20 @@ 'actionlabel' => emt('Enter credit'), 'width' => 616, #make room for reasons #540 default &> - | +% } +% if ( $curuser->access_right('Credit line items') ) { + <% $s++ ? ' | ' : '' %> <& /elements/popup_link-cust_main.html, 'label' => emt('Credit line items'), #'action' => "${p}search/cust_bill_pkg.cgi?nottax=1;type=select", 'action' => "${p}edit/credit-cust_bill_pkg.html", 'cust_main' => $cust_main, 'actionlabel' => emt('Credit line items'), - 'width' => 884, #763, + 'width' => 968, #763, 'height' => 575, &> -
% } +<% $s ? '
' : '' %> %# refund links @@ -259,7 +263,7 @@ %my $old_history = 0; %my $lastdate = 0; % -%foreach my $item ( sort { $a->{'date'} <=> $b->{'date'} } @history ) { +%foreach my $item ( @history ) { % % $lastdate = $item->{'date'}; % @@ -497,6 +501,17 @@ foreach my $cust_pay_pending ($cust_main->cust_pay_pending_attempt) { #'target' => $target, #XXX }; } +#declined batch payments +foreach my $cust_pay_batch ( + $cust_main->cust_pay_batch(hashref => {status => 'Declined'}) +) { + my $pay_batch = $cust_pay_batch->pay_batch; + push @history, { + 'date' => $pay_batch->upload, + 'desc' => include('payment_history/attempted_batch_payment.html', $cust_pay_batch, %opt), + 'void_payment' => $cust_pay_batch->amount, + }; +} #credits (some false laziness w/payments) foreach my $cust_credit ($cust_main->cust_credit) { @@ -518,6 +533,13 @@ foreach my $cust_refund ($cust_main->cust_refund) { } +# sort history +if ( $curuser->option('history_order') eq 'newest' ) { + @history = sort { $b->{date} <=> $a->{date} } @history; +} else { + @history = sort { $a->{date} <=> $b->{date} } @history; +} # no other sort orders for now + sub translate_payby { my ($payby,$payinfo) = (shift,shift); my %payby = (