X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpayment_history%2Fvoided_payment.html;h=3c2098d23075275d2e7ed20eb40df301fb6c45a1;hb=93519f9371b41ded713a93fba031ed7a361be04c;hp=5d7f60cf56778b369783a067708ad50257199428;hpb=b5c4237a34aef94976bc343c8d9e138664fc3984;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 5d7f60cf5..3c2098d23 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 @@
-Payment <% $info %> by <% $cust_pay_void->otaker %>
-voided <% time2str($date_format, $cust_pay_void->void_date) %>
+<% mt("Payment [_1] by [_2]", $info, $cust_pay_void->otaker ) |h %>
+<% mt("voided [_1]", 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 %>
@@ -13,27 +13,8 @@ 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 = "ABA $aba, Acct #$account";
-} else {
- $payinfo = $cust_pay_void->payinfo;
-}
-
-$payby =~ s/^BILL$/Check #/ if $payinfo;
-$payby =~ s/^CHEK$/Electronic check /;
-$payby =~ s/^PREP$/Prepaid card /;
-$payby =~ s/^CARD$/Credit card #/;
-$payby =~ s/^COMP$/Complimentary by /;
-$payby =~ s/^CASH$/Cash/;
-$payby =~ s/^WEST$/Western Union/;
-$payby =~ s/^MCRD$/Manual credit card/;
-$payby =~ s/^BILL$//;
+my ($payby,$payinfo) = translate_payinfo($cust_pay_void);
+$payby = translate_payby($payby,$payinfo);
my $info = $payby ? "($payby$payinfo)" : '';
if ( $opt{'pkg-balances'} && $cust_pay_void->pkgnum ) {
@@ -42,19 +23,14 @@ if ( $opt{'pkg-balances'} && $cust_pay_void->pkgnum ) {
}
my $unvoid = '';
-if ( $cust_pay_void->closed !~ /^Y/i
- && $curuser->access_right('Unvoid')
- )
-{
- $unvoid = qq! (unvoid)!;
-}
+my $unvoidmsg = $cust_pay_void->payby =~ /^(CARD|CHEK)$/
+ ? ' ('.mt('do not send anything to the payment gateway') .')'
+ : '';
+$unvoid = areyousure_link("${p}misc/unvoid-cust_pay_void.cgi?".$cust_pay_void->paynum,
+ mt('Are you sure you want to unvoid this payment?'),
+ mt('Unvoid this payment from the database') . $unvoidmsg,
+ mt('unvoid')
+ )
+ if ( $cust_pay_void->closed !~ /^Y/i && $curuser->access_right('Unvoid') );
%init>