summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/payment_history
diff options
context:
space:
mode:
authorlevinse <levinse>2011-05-16 18:48:25 +0000
committerlevinse <levinse>2011-05-16 18:48:25 +0000
commit170aa1e8078280e7c03a6ebfc67280de66fa1b9d (patch)
tree64729456f0178ab841f578a6efc3b099020be742 /httemplate/view/cust_main/payment_history
parent2238711675eefa60cd2feb47c8d3e43d3e6f1860 (diff)
internationalization/localization, RT12515
Diffstat (limited to 'httemplate/view/cust_main/payment_history')
-rw-r--r--httemplate/view/cust_main/payment_history/attempted_payment.html14
-rw-r--r--httemplate/view/cust_main/payment_history/credit.html34
-rw-r--r--httemplate/view/cust_main/payment_history/invoice.html17
-rw-r--r--httemplate/view/cust_main/payment_history/payment.html58
-rw-r--r--httemplate/view/cust_main/payment_history/pending_payment.html18
-rw-r--r--httemplate/view/cust_main/payment_history/refund.html25
-rw-r--r--httemplate/view/cust_main/payment_history/voided_payment.html22
7 files changed, 76 insertions, 112 deletions
diff --git a/httemplate/view/cust_main/payment_history/attempted_payment.html b/httemplate/view/cust_main/payment_history/attempted_payment.html
index 554aa737d..1a705b7f8 100644
--- a/httemplate/view/cust_main/payment_history/attempted_payment.html
+++ b/httemplate/view/cust_main/payment_history/attempted_payment.html
@@ -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 @@ if ( $payby eq 'CARD' ) {
$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 ) {
diff --git a/httemplate/view/cust_main/payment_history/credit.html b/httemplate/view/cust_main/payment_history/credit.html
index 75038cc56..ae388eb54 100644
--- a/httemplate/view/cust_main/payment_history/credit.html
+++ b/httemplate/view/cust_main/payment_history/credit.html
@@ -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 @@ if ($conf->exists('cust_credit_bill_pkg-manual')) {
%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 ( scalar(@cust_credit_bill) == 0
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 @@ if ( scalar(@cust_credit_bill) == 0
&& 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 @@ if ( scalar(@cust_credit_bill) == 0
} 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 ( scalar(@cust_credit_bill) == 0
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 ( scalar(@cust_credit_bill) == 0
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,
).
')';
}
diff --git a/httemplate/view/cust_main/payment_history/invoice.html b/httemplate/view/cust_main/payment_history/invoice.html
index c0d32df4d..fe14d3e54 100644
--- a/httemplate/view/cust_main/payment_history/invoice.html
+++ b/httemplate/view/cust_main/payment_history/invoice.html
@@ -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 $conf = new FS::Conf;
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 @@ if ( $opt{'deleteinvoices'} && $curuser->access_right('Delete invoices') ) {
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 @@ if ( $cust_bill->num_cust_event
) {
$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>';
}
#
diff --git a/httemplate/view/cust_main/payment_history/payment.html b/httemplate/view/cust_main/payment_history/payment.html
index e745864b7..61486518e 100644
--- a/httemplate/view/cust_main/payment_history/payment.html
+++ b/httemplate/view/cust_main/payment_history/payment.html
@@ -1,4 +1,4 @@
-<% $pre %>Payment<% $post %> by <% $otaker %>
+<% $payment %>
<% "$info$desc$view$apply$refund$void$delete$unapply" %>
<%init>
@@ -16,7 +16,7 @@ if ( $payby eq 'CARD' ) {
$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_bill_pay = $cust_pay->cust_bill_pay;
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 @@ if ($conf->exists('cust_bill_pay_pkg-manual')) {
%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 ( scalar(@cust_bill_pay) == 0
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 @@ if ( scalar(@cust_bill_pay) == 0
&& 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 @@ if ( scalar(@cust_bill_pay) == 0
} 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 ( scalar(@cust_bill_pay) == 0
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 ( scalar(@cust_bill_pay) == 0
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 @@ if ( scalar(@cust_bill_pay) == 0
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 @@ if ( $cust_pay->closed !~ /^Y/i
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>
diff --git a/httemplate/view/cust_main/payment_history/pending_payment.html b/httemplate/view/cust_main/payment_history/pending_payment.html
index 7d21f899f..3da5a6229 100644
--- a/httemplate/view/cust_main/payment_history/pending_payment.html
+++ b/httemplate/view/cust_main/payment_history/pending_payment.html
@@ -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 @@ if ( $payby eq 'CARD' ) {
$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 @@ if ( $action && $edit_pending ) {
'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'),
);
}
diff --git a/httemplate/view/cust_main/payment_history/refund.html b/httemplate/view/cust_main/payment_history/refund.html
index 4a48fea1e..154525d54 100644
--- a/httemplate/view/cust_main/payment_history/refund.html
+++ b/httemplate/view/cust_main/payment_history/refund.html
@@ -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 @@ my $payinfo = $payby eq 'CARD'
? $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 @@ if ( $cust_refund->closed !~ /^Y/i
$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>
diff --git a/httemplate/view/cust_main/payment_history/voided_payment.html b/httemplate/view/cust_main/payment_history/voided_payment.html
index 5d7f60cf5..0a8cd1077 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 @@
-<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 @@ 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";
+ $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 @@ if ( $cust_pay_void->closed !~ /^Y/i
$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>