X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpayment_history%2Fvoided_payment.html;h=207ab9cdd4297a6ca2f82b1df34ab3961beb5a12;hb=063d9f211aa19a26755279ad7277648cfdae6313;hp=0a8cd107766fc447533095ca72816d7f5270ebfc;hpb=170aa1e8078280e7c03a6ebfc67280de66fa1b9d;p=freeside.git
diff --git a/httemplate/view/cust_main/payment_history/voided_payment.html b/httemplate/view/cust_main/payment_history/voided_payment.html
index 0a8cd1077..207ab9cdd 100644
--- a/httemplate/view/cust_main/payment_history/voided_payment.html
+++ b/httemplate/view/cust_main/payment_history/voided_payment.html
@@ -1,5 +1,5 @@
<% mt("Payment [_1] by [_2]", $info, $cust_pay_void->otaker ) |h %>
-<% mt("voided [_1]", time2str($date_format, $cust_pay_void->void_date) ) |h %>
+<% mt("voided ([_1]) [_2]", $cust_pay_void->reason, time2str($date_format, $cust_pay_void->void_date) ) |h %>
% my $void_user = $cust_pay_void->void_access_user;
% if ($void_user) {
by <% $void_user->username %>
@@ -11,20 +11,7 @@ my( $cust_pay_void, %opt ) = @_;
my $date_format = $opt{'date_format'} || '%m/%d/%Y';
-my $curuser = $FS::CurrentUser::CurrentUser;
-
-my $payby = $cust_pay_void->payby;
-
-my $payinfo;
-if ( $payby eq 'CARD' ) {
- $payinfo = $cust_pay_void->paymask;
-} elsif ( $payby eq 'CHEK' ) {
- my( $account, $aba ) = split('@', $cust_pay_void->paymask );
- $payinfo = mt("ABA [_1], Acct #[_2]",$aba,$account);
-} else {
- $payinfo = $cust_pay_void->payinfo;
-}
-
+my ($payby,$payinfo) = translate_payinfo($cust_pay_void);
$payby = translate_payby($payby,$payinfo);
my $info = $payby ? "($payby$payinfo)" : '';
@@ -34,19 +21,14 @@ if ( $opt{'pkg-balances'} && $cust_pay_void->pkgnum ) {
}
my $unvoid = '';
-if ( $cust_pay_void->closed !~ /^Y/i
- && $curuser->access_right('Unvoid')
- )
-{
- $unvoid = qq! ('.mt('unvoid').')';
-}
+my $unvoidmsg = $cust_pay_void->payby =~ /^(CARD|CHEK)$/
+ ? ' ('.emt('do not send anything to the payment gateway') .')'
+ : '';
+$unvoid = areyousure_link("${p}misc/unvoid-cust_pay_void.cgi?".$cust_pay_void->paynum,
+ emt('Are you sure you want to unvoid this payment?'),
+ emt('Unvoid this payment from the database') . $unvoidmsg,
+ emt('unvoid')
+ )
+ if $cust_pay_void->closed !~ /^Y/i && $opt{'Unvoid payments'};
%init>