[freeside-commits] freeside/httemplate/view/cust_main/payment_history attempted_payment.html, 1.1, 1.2 credit.html, 1.6, 1.7 invoice.html, 1.2, 1.3 payment.html, 1.8, 1.9 pending_payment.html, 1.2, 1.3 refund.html, 1.3, 1.4 voided_payment.html, 1.6, 1.7

Erik Levinson levinse at wavetail.420.am
Mon May 16 11:48:27 PDT 2011


Update of /home/cvs/cvsroot/freeside/httemplate/view/cust_main/payment_history
In directory wavetail.420.am:/tmp/cvs-serv10956/payment_history

Modified Files:
	attempted_payment.html credit.html invoice.html payment.html 
	pending_payment.html refund.html voided_payment.html 
Log Message:
internationalization/localization, RT12515

Index: refund.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/payment_history/refund.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -d -r1.3 -r1.4
--- refund.html	7 Feb 2009 08:23:10 -0000	1.3
+++ refund.html	16 May 2011 18:48:25 -0000	1.4
@@ -1,6 +1,6 @@
-<% $pre %>Refund<% $post %>
+<% $refund %>
 (<% $payby. $payinfo %>)
-by <% $cust_refund->otaker %><% $view %><% $delete %>
+<% mt('by') |h %> <% $cust_refund->otaker %><% $view %><% $delete %>
 <%init>
 
 my( $cust_refund, %opt ) = @_;
@@ -12,23 +12,18 @@
                 ? $cust_refund->paymask
                 : $cust_refund->payinfo;
 
-$payby =~ s/^BILL$/Check #/ if $payinfo;
-$payby =~ s/^BILL$/Check/;
-$payby =~ s/^CHEK$/Electronic check /;
-$payby =~ s/^(CARD|COMP)$/$1 /;
+$payby = translate_payby_refund($payby,$payinfo);
 
-my($pre, $post) = ('', '');
-if ( $cust_refund->unapplied > 0 ) {
-  $pre = '<B><FONT COLOR="#FF0000">Unapplied ';
-  $post = '</FONT></B>';
-}
+my $refund = mt('Refund');
+$refund = '<B><FONT COLOR="#FF0000">' . mt('Unapplied Refund') . '</FONT></B>' 
+    if $cust_refund->unapplied > 0;
 
 my $view =
   ' ('. include('/elements/popup_link.html',
-                  'label'     => 'view receipt',
+                  'label'     => mt('view receipt'),
                   'action'    => "${p}view/cust_refund.html?link=popup;".
                                  'refundnum='. $cust_refund->refundnum,
-                  'actionlabel' => 'Payment Receipt',
+                  'actionlabel' => mt('Payment Receipt'),
                ).
    ')';
 
@@ -42,8 +37,8 @@
   $delete = qq! (<A HREF="javascript:areyousure('!.
             qq!${p}misc/delete-cust_refund.cgi?!. $cust_refund->refundnum.
             qq!', 'Are you sure you want to delete this refund?')"!.
-            qq! TITLE="Delete this refund from the database completely - not recommended"!.
-            qq!>delete</A>)!;
+            qq! TITLE="!.mt('Delete this refund from the database completely - not recommended').
+            ">".mt('delete')."</A>)";
 }
 
 </%init>

Index: invoice.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/payment_history/invoice.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- invoice.html	4 Oct 2009 02:04:49 -0000	1.2
+++ invoice.html	16 May 2011 18:48:25 -0000	1.3
@@ -1,5 +1,4 @@
-<% $link %><% $pre %>Invoice #<% $cust_bill->display_invnum %>
-(Balance $ <% $cust_bill->owed %>)<% $post %><% $link ? '</A>' : '' %><% $delete %><% $events %>
+<% $link %><% $invoice %><% $link ? '</A>' : '' %><% $delete %><% $events %>
 <%init>
 
 my( $cust_bill, %opt ) = @_;
@@ -8,11 +7,11 @@
 
 my $curuser = $FS::CurrentUser::CurrentUser;
 
-my($pre, $post) = ('', '');
-if ( $cust_bill->owed > 0 ) {
-  $pre = '<B><FONT SIZE="+1" COLOR="#FF0000">Open ';
-  $post = '</FONT></B>';
-}
+my $invoice = mt("Invoice #[_1] (Balance [_2])",$cust_bill->display_invnum,$cust_bill->owed);
+$invoice = '<B><FONT SIZE="+1" COLOR="#FF0000">' .
+    mt("Open Invoice #[_1] (Balance [_2])",$cust_bill->display_invnum,$cust_bill->owed) .
+    '</FONT></B>'
+if ( $cust_bill->owed > 0 );
 
 my $invnum = $cust_bill->invnum;
 
@@ -26,7 +25,7 @@
             qq!${p}misc/delete-cust_bill.html?$invnum',!.
             qq!'Are you sure you want to delete this invoice?')"!.
             qq! TITLE="Delete this invoice from the database completely"!.
-            qq!>delete</A>)!;
+            mt('delete') . '</A>)';
 }
 
 my $events = '';
@@ -38,7 +37,7 @@
    ) {
   $events =
     qq!<BR><FONT SIZE="-1"><A HREF="${p}search/cust_event.html?invnum=$invnum!.
-    '">(&nbsp;View invoice events&nbsp;)</A></FONT>';
+    '">( '.mt('View invoice events').' )</A></FONT>';
 }
 #
 

Index: attempted_payment.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/payment_history/attempted_payment.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- attempted_payment.html	4 Aug 2010 19:14:50 -0000	1.1
+++ attempted_payment.html	16 May 2011 18:48:25 -0000	1.2
@@ -1,4 +1,4 @@
-<I>Payment attempt <% $info |h %></I>
+<I><% mt('Payment attempt') |h %> <% $info |h %></I>
 <%init>
 
 my( $cust_pay_pending, %opt ) = @_;
@@ -14,20 +14,12 @@
   $payinfo = $cust_pay_pending->paymask;
 } elsif ( $payby eq 'CHEK' ) {
   my( $account, $aba ) = split('@', $cust_pay_pending->paymask );
-  $payinfo = "ABA $aba, Acct #$account";
+  $payinfo = mt("ABA [_1], Acct #[_2]",$aba,$account);
 } else {
   $payinfo = $cust_pay_pending->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$//;
+$payby = translate_payby($payby,$payinfo);
 my $info = $payby ? "($payby$payinfo)" : '';
 
 if ( $opt{'pkg-balances'} && $cust_pay_pending->pkgnum ) {

Index: credit.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/payment_history/credit.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -d -r1.6 -r1.7
--- credit.html	8 Mar 2010 10:57:06 -0000	1.6
+++ credit.html	16 May 2011 18:48:25 -0000	1.7
@@ -1,5 +1,5 @@
-<% $pre %>Credit<% $post %>
-by <% $cust_credit->otaker %><% "$reason$desc$apply$delete$unapply" %>
+<% $credit %>
+<% "$reason$desc$apply$delete$unapply" %>
 <%init>
 
 my( $cust_credit, %opt ) = @_;
@@ -25,20 +25,22 @@
   %cust_credit_bill_height = ('height' => 436);
 }
 
-my( $pre, $post, $apply, $ext ) = ( '', '', '', '' );
+my( $apply, $ext ) = ( '', '', '', '' );
+my $credit = mt("Credit by [_1]", $cust_credit->otaker );
 if (    scalar(@cust_credit_bill)   == 0
      && scalar(@cust_credit_refund) == 0 ) {
   #completely unapplied
-  $pre = '<B><FONT COLOR="#FF0000">Unapplied ';
-  $post = '</FONT></B>';
+  $credit = '<B><FONT COLOR="#FF0000">'
+        . mt("Unapplied Credit by [_1]", $cust_credit->otaker )
+        . '</FONT></B>';
   if ( $curuser->access_right('Apply credit') ) {
     if ( $cust_credit->cust_main->total_owed > 0 ) {
       $apply = ' ('.
                include( '/elements/popup_link.html',
-                          'label'    => 'apply',
+                          'label'    => mt('apply'),
                           'action'   => "${p}edit/cust_credit_bill.cgi?".
                                         $cust_credit->crednum,
-                          'actionlabel' => 'Apply credit',
+                          'actionlabel' => mt('Apply credit'),
                           %cust_credit_bill_width,
                           %cust_credit_bill_height,
                       ).
@@ -47,12 +49,11 @@
     if ( $cust_credit->cust_main->total_unapplied_refunds > 0 ) {
       $apply.= ' ('.
                include( '/elements/popup_link.html',
-                          'label'    => 'apply to refund',
+                          'label'    => mt('apply to refund'),
                           'action'   => "${p}edit/cust_credit_refund.cgi?".
                                         $cust_credit->crednum,
-                          'actionlabel' => 'Apply credit to refund',
+                          'actionlabel' => mt('Apply credit to refund'),
                           'width'    => 392,
-                          #default# 'height' => 336,
                       ).
                ')';
     }
@@ -66,7 +67,7 @@
           && scalar(@cust_credit_refund) == 1
           && $cust_credit->credited == 0      ) {
   #applied to one refund
-  $desc .= ' refunded on '.  time2str($date_format, $cust_credit_refund[0]->_date);
+  $desc .= mt(" refunded on [_1]", time2str($date_format, $cust_credit_refund[0]->_date) );
 } else {
   #complicated
   $desc .= '<BR>';
@@ -81,7 +82,7 @@
     } elsif ( $app->isa('FS::cust_credit_refund') ) {
       $desc .= '&nbsp;&nbsp;'.
                '$'. $app->amount.
-               ' refunded on '. time2str($date_format, $app->_date).
+               mt(" refunded on [_1]", time2str($date_format, $app->_date) ).
                '<BR>';
     } else {
       die "$app is not a FS::cust_credit_bill or a FS::cust_credit_refund";
@@ -94,10 +95,10 @@
       if ( $cust_credit->cust_main->total_owed > 0 ) {
         $apply = ' ('.
                  include( '/elements/popup_link.html',
-                            'label'       => 'apply',
+                            'label'       => mt('apply'),
                             'action'      => "${p}edit/cust_credit_bill.cgi?".
                                              $cust_credit->crednum,
-                            'actionlabel' => 'Apply credit',
+                            'actionlabel' => mt('Apply credit'),
                             %cust_credit_bill_width,
                             %cust_credit_bill_height,
                         ).
@@ -106,12 +107,11 @@
       if ( $cust_credit->cust_main->total_unapplied_refunds > 0 ) {
         $apply.= ' ('.
                  include( '/elements/popup_link.html',
-                            'label'       => 'apply to refund',
+                            'label'       => mt('apply to refund'),
                             'action'      => "${p}edit/cust_credit_refund.cgi?".
                                              $cust_credit->crednum,
-                            'actionlabel' => 'Apply credit to refund',
+                            'actionlabel' => mt('Apply credit to refund'),
                             'width'       => 392,
-                            #default# 'height' => 336,
                         ).
                  ')';
       }

Index: pending_payment.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/payment_history/pending_payment.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- pending_payment.html	12 May 2011 19:57:01 -0000	1.2
+++ pending_payment.html	16 May 2011 18:48:25 -0000	1.3
@@ -1,4 +1,4 @@
-<b><font size="+1" color="#FF0000">Pending payment </font></b> <% "$info $status ($link)" %>
+<b><font size="+1" color="#FF0000"><% mt('Pending payment') |h %> </font></b> <% "$info $status ($link)" %>
 <%init>
 
 my( $cust_pay_pending, %opt ) = @_;
@@ -14,21 +14,13 @@
   $payinfo = $cust_pay_pending->paymask;
 } elsif ( $payby eq 'CHEK' ) {
   my( $account, $aba ) = split('@', $cust_pay_pending->paymask );
-  $payinfo = "ABA $aba, Acct #$account";
+  $payinfo = mt("ABA [_1], Acct #[_2]",$aba,$account);
 } else {
   $payinfo = $cust_pay_pending->payinfo;
 }
 
 my $target = "$payby$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$//;
+$payby = translate_payby($payby,$payinfo);
 my $info = $payby ? "($payby$payinfo)" : '';
 
 my %statusaction = (
@@ -51,11 +43,11 @@
 	       'action' => $p. 'edit/cust_pay_pending.html'.
 			     '?paypendingnum='. $cust_pay_pending->paypendingnum.
 			     ";action=$action",
-	       'label'  => $action,
+	       'label'  => mt($action),
 	       'color'  => '#ff0000',
 	       'width'  => 655,
 	       'height' => ( $action eq 'delete' ? 480 : 575 ),
-	       'actionlabel' => ucfirst($action). ' pending payment',
+	       'actionlabel' => mt(ucfirst($action). ' pending payment'),
 	    );
 }
 

Index: voided_payment.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/payment_history/voided_payment.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -d -r1.6 -r1.7
--- voided_payment.html	22 Oct 2010 06:14:24 -0000	1.6
+++ voided_payment.html	16 May 2011 18:48:25 -0000	1.7
@@ -1,5 +1,5 @@
-<DEL>Payment <% $info %> by <% $cust_pay_void->otaker %></DEL>
-<I>voided <% time2str($date_format, $cust_pay_void->void_date) %>
+<DEL><% mt("Payment [_1] by [_2]", $info, $cust_pay_void->otaker ) |h %></DEL>
+<I><% 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 %></I>
@@ -20,20 +20,12 @@
   $payinfo = $cust_pay_void->paymask;
 } elsif ( $payby eq 'CHEK' ) {
   my( $account, $aba ) = split('@', $cust_pay_void->paymask );
-  $payinfo = "ABA $aba, Acct #$account";
+  $payinfo = mt("ABA [_1], Acct #[_2]",$aba,$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$//;
+$payby = translate_payby($payby,$payinfo);
 my $info = $payby ? "($payby$payinfo)" : '';
 
 if ( $opt{'pkg-balances'} && $cust_pay_void->pkgnum ) {
@@ -49,12 +41,12 @@
   $unvoid = qq! (<A HREF="javascript:areyousure('!.
             qq!${p}misc/unvoid-cust_pay_void.cgi?!. $cust_pay_void->paynum.
             qq!', 'Are you sure you want to unvoid this payment?')"!.
-            qq! TITLE="Unvoid this payment from the database!.
+            qq! TITLE="!.mt('Unvoid this payment from the database').
               ( $cust_pay_void->payby =~ /^(CARD|CHEK)$/
-                ? ' (do not send anything to the payment gateway)'
+                ? ' ('.mt('do not send anything to the payment gateway') .')'
                 : '' 
               ). '"'.
-            qq!>unvoid</A>)!;
+            '>'.mt('unvoid').'</A>)';
 }
 
 </%init>

Index: payment.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/payment_history/payment.html,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -d -r1.8 -r1.9
--- payment.html	3 Nov 2010 23:44:47 -0000	1.8
+++ payment.html	16 May 2011 18:48:25 -0000	1.9
@@ -1,4 +1,4 @@
-<% $pre %>Payment<% $post %> by <% $otaker %>
+<% $payment %>
 <% "$info$desc$view$apply$refund$void$delete$unapply" %>
 <%init>
 
@@ -16,7 +16,7 @@
   $payinfo = $cust_pay->paymask;
 } elsif ( $payby eq 'CHEK' ) {
   my( $account, $aba ) = split('@', $cust_pay->paymask );
-  $payinfo = "ABA $aba, Acct #$account";
+  $payinfo = mt("ABA [_1], Acct #[_2]",$aba,$account);
 } else {
   $payinfo = $cust_pay->payinfo;
 }
@@ -24,15 +24,7 @@
 my @cust_pay_refund = $cust_pay->cust_pay_refund;
 
 my $target = "$payby$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$//;
+$payby = translate_payby($payby,$payinfo);
 my $info = $payby ? "($payby$payinfo)" : '';
 
 my $desc = '';
@@ -48,20 +40,28 @@
   %cust_bill_pay_height = ('height' => 436);
 }
 
-my( $pre, $post, $apply, $ext ) = ( '', '', '', '' );
+my( $apply, $ext ) = ( '', '', '', '' );
+
+my $otaker = $cust_pay->otaker;
+$otaker = '<i>auto billing</i>'          if $otaker eq 'fs_daily';
+$otaker = '<i>customer self-service</i>' if $otaker eq 'fs_selfservice';
+
+my $payment = mt("Payment by [_1]",$otaker);
+
 if (    scalar(@cust_bill_pay)   == 0
      && scalar(@cust_pay_refund) == 0 ) {
   #completely unapplied
-  $pre = '<B><FONT COLOR="#FF0000">Unapplied ';
-  $post = '</FONT></B>';
+  $payment = '<B><FONT COLOR="#FF0000">' 
+                . mt("Unapplied Payment by [_1]",$otaker)
+                . '</FONT></B>';
   if ( $curuser->access_right('Apply payment') ) {
     if ( $cust_pay->cust_main->total_owed > 0 ) {
       $apply = ' ('.
                include( '/elements/popup_link.html',
-                          'label'       => 'apply',
+                          'label'       => mt('apply'),
                           'action'      => "${p}edit/cust_bill_pay.cgi?".
                                            $cust_pay->paynum,
-                          'actionlabel' => 'Apply payment',
+                          'actionlabel' => mt('Apply payment'),
                           %cust_bill_pay_width,
                           %cust_bill_pay_height,
                       ).
@@ -70,12 +70,11 @@
     if ( $cust_pay->cust_main->total_unapplied_refunds > 0 ) {
       $apply.= ' ('.
                include( '/elements/popup_link.html',
-                          'label'       => 'apply to refund',
+                          'label'       => mt('apply to refund'),
                           'action'      => "${p}edit/cust_pay_refund.cgi?".
                                            $cust_pay->paynum,
-                          'actionlabel' => 'Apply payment to refund',
+                          'actionlabel' => mt('Apply payment to refund'),
                           'width'       => 392,
-                          #default# 'height' => 336,
                       ).
                ')';
     }
@@ -89,7 +88,7 @@
           && scalar(@cust_pay_refund) == 1
           && $cust_pay->unapplied == 0     ) {
   #applied to one refund
-  $desc .= ' refunded on '. time2str($date_format, $cust_pay_refund[0]->_date);
+  $desc .= mt(" refunded on [_1]", time2str($date_format, $cust_pay_refund[0]->_date) );
 } else {
   #complicated
   $desc .= '<BR>';
@@ -104,7 +103,7 @@
     } elsif ( $app->isa('FS::cust_pay_refund') ) {
       $desc .= '&nbsp;&nbsp;'.
                '$'. $app->amount.
-               ' refunded on '. time2str($date_format, $app->_date).
+               mt(" refunded on [_1]", time2str($date_format, $app->_date) ) .
                '<BR>';
     } else {
       die "$app is not a FS::cust_bill_pay or FS::cust_pay_refund";
@@ -118,10 +117,10 @@
       if ( $cust_pay->cust_main->total_owed > 0 ) {
         $apply = ' ('.
                  include( '/elements/popup_link.html',
-                            'label'      => 'apply',
+                            'label'      => mt('apply'),
                             'action'     => "${p}edit/cust_bill_pay.cgi?".
                                             $cust_pay->paynum,
-                            'actionlabel' => 'Apply payment',
+                            'actionlabel' => mt('Apply payment'),
                             %cust_bill_pay_width,
                             %cust_bill_pay_height,
                         ).
@@ -130,12 +129,11 @@
       if ( $cust_pay->cust_main->total_unapplied_refunds > 0 ) {
         $apply.= ' ('.
                  include( '/elements/popup_link.html',
-                            'label'      => 'apply to refund',
+                            'label'      => mt('apply to refund'),
                             'action'     => "${p}edit/cust_pay_refund.cgi?".
                                             $cust_pay->paynum,
-                            'actionlabel' => 'Apply payment to refund',
+                            'actionlabel' => mt('Apply payment to refund'),
                             'width'      => 392,
-                            #default# 'height' => 336,
                         ).
                  ')';
       }
@@ -146,10 +144,10 @@
 
 my $view =
   ' ('. include('/elements/popup_link.html',
-                  'label'     => 'view receipt',
+                  'label'     => mt('view receipt'),
                   'action'    => "${p}view/cust_pay.html?link=popup;paynum=".
                                   $cust_pay->paynum,
-                  'actionlabel' => 'Payment Receipt',
+                  'actionlabel' => mt('Payment Receipt'),
                ).
    ')';
 
@@ -221,8 +219,4 @@
              qq!>unapply</A>)!;
 }
 
-my $otaker = $cust_pay->otaker;
-$otaker = '<i>auto billing</i>'          if $otaker eq 'fs_daily';
-$otaker = '<i>customer self-service</i>' if $otaker eq 'fs_selfservice';
-
 </%init>



More information about the freeside-commits mailing list