From 3ccf7174fccb0b576a8c34838b3db4a429635483 Mon Sep 17 00:00:00 2001
From: Ivan Kohler <ivan@freeside.biz>
Date: Thu, 12 Apr 2012 16:14:23 -0700
Subject: [PATCH] display apple and android store payments by name

---
 FS/FS/payby.pm                                 | 5 +++++
 httemplate/view/cust_main/payment_history.html | 8 +++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/FS/FS/payby.pm b/FS/FS/payby.pm
index 33ed42507..d1961a58d 100644
--- a/FS/FS/payby.pm
+++ b/FS/FS/payby.pm
@@ -176,6 +176,11 @@ sub realtime {  # can use realtime payment facilities
   return $hash{$payby}->{realtime};
 }
 
+sub payby2shortname {
+  my $self = shift;
+  map { $_ => $hash{$_}->{shortname} } $self->payby;
+}
+
 sub payby2longname {
   my $self = shift;
   map { $_ => $hash{$_}->{longname} } $self->payby;
diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html
index c453ffadc..c7a7c8024 100644
--- a/httemplate/view/cust_main/payment_history.html
+++ b/httemplate/view/cust_main/payment_history.html
@@ -500,14 +500,15 @@ foreach my $cust_refund ($cust_main->cust_refund) {
 sub translate_payby {
     my ($payby,$payinfo) = (shift,shift);
     my %payby = (
+        FS::payby->payby2shortname,
         BILL    => $payinfo ? emt('Check #') : '',
         CHEK    => emt('Electronic check '),
         PREP    => emt('Prepaid card '),
         CARD    => emt('Credit card #'),
         COMP    => emt('Complimentary by '),
-        CASH    => emt('Cash'),
-        WEST    => emt('Western Union'),
-        MCRD    => emt('Manual credit card'),
+        #CASH    => emt('Cash'),
+        #WEST    => emt('Western Union'),
+        #MCRD    => emt('Manual credit card'),
     );
     $payby = (exists $payby{$payby}) ? $payby{$payby} : $payby; 
     $payby;
@@ -516,6 +517,7 @@ sub translate_payby {
 sub translate_payby_refund {
     my ($payby,$payinfo) = (shift,shift);
     my %payby = (
+        FS::payby->payby2shortname,
         BILL    => $payinfo ? emt('Check #') : emt('Check'),
         CHEK    => emt('Electronic check '),
         CARD    => emt('Credit card #'),
-- 
2.20.1