X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpayment_history.html;h=502c127d35eadab5e18c732cb86e45678849d396;hb=67f033bc45654a380f47bffc9253dd86c4f784ec;hp=c453ffadc9da24ff22f5ecf023d1f3aa16c6fe3f;hpb=32276032c4c3754b6318b9b70a934a1f8fb52586;p=freeside.git diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index c453ffadc..502c127d3 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,8 +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' => 968, #763, + 'height' => 575, + &> % } +<% $s ? '
' : '' %> %# refund links @@ -476,6 +490,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) { @@ -491,7 +516,7 @@ foreach my $cust_credit ($cust_main->cust_credit) { foreach my $cust_refund ($cust_main->cust_refund) { push @history, { 'date' => $cust_refund->_date, - 'desc' => include('payment_history/refund.html', $cust_refund), + 'desc' => include('payment_history/refund.html', $cust_refund, %opt), 'refund' => $cust_refund->refund, }; @@ -530,13 +555,18 @@ sub translate_payinfo { my $payby = $object->payby; my $payinfo = $object->payinfo; - my $conf = new FS::Conf; - if ( $payby eq 'CARD' ) { $payinfo = $object->paymask; } elsif ( $payby eq 'CHEK' ) { + #false laziness w/payinfo_Mixin::payby_payinfo_pretty, should use that my( $account, $aba ) = split('@', $object->paymask ); - $payinfo = emt("ABA [_1], Acct #[_2]",$aba,$account); + if ( $aba =~ /^(\d{5})\.(\d{3})$/ ) { #blame canada + my($branch, $routing) = ($1, $2); + $payinfo = emt("Routing [_1], Branch [_2], Acct [_3]", + $routing, $branch, $account); + } else { + $payinfo = emt("Routing [_1], Acct [_2]", $aba, $account); + } } ($payby,$payinfo);