+=cut
+
+sub payby_payinfo_pretty {
+ my $self = shift;
+ my $locale = shift;
+ my $lh = FS::L10N->get_handle($locale);
+ if ( $self->payby eq 'CARD' ) {
+ $lh->maketext('Card #') . $self->paymask;
+ } elsif ( $self->payby eq 'CHEK' ) {
+
+ #false laziness w/view/cust_main/payment_history.html::translate_payinfo
+ my( $account, $aba ) = split('@', $self->paymask );
+
+ if ( $aba =~ /^(\d{5})\.(\d{3})$/ ) { #blame canada
+ my($branch, $routing) = ($1, $2);
+ $lh->maketext("Routing [_1], Branch [_2], Acct [_3]",
+ $routing, $branch, $account);
+ } else {
+ $lh->maketext("Routing [_1], Acct [_2]", $aba, $account);
+ }
+
+ } elsif ( $self->payby eq 'BILL' ) {
+ $lh->maketext('Check #') . $self->payinfo;
+ } elsif ( $self->payby eq 'PREP' ) {
+ $lh->maketext('Prepaid card #') . $self->payinfo;
+ } elsif ( $self->payby eq 'CASH' ) {
+ $lh->maketext('Cash') . ' ' . $self->payinfo;
+ } elsif ( $self->payby eq 'WEST' ) {
+ # does Western Union localize their name?
+ $lh->maketext('Western Union');
+ } elsif ( $self->payby eq 'MCRD' ) {
+ $lh->maketext('Manual credit card');
+ } elsif ( $self->payby eq 'MCHK' ) {
+ $lh->maketext('Manual electronic check');
+ } elsif ( $self->payby eq 'EDI' ) {
+ $lh->maketext('EDI') . ' ' . $self->paymask;
+ } elsif ( $self->payby eq 'PPAL' ) {
+ $lh->maketext('PayPal transaction#') . $self->order_number;
+ } else {
+ $self->payby. ' '. $self->payinfo;
+ }