prevent customer payment type changes from skewing payment report
[freeside.git] / FS / FS / UI / Web.pm
index 0e54aa2..136c8e6 100644 (file)
@@ -273,7 +273,7 @@ sub cust_header {
     '(service) Latitude'       => 'ship_latitude',
     '(service) Longitude'      => 'ship_longitude',
     'Invoicing email(s)'       => 'invoicing_list_emailonly_scalar',
-    'Payment Type'             => 'payby',
+    'Payment Type'             => 'cust_payby',
     'Current Balance'          => 'current_balance',
     'Agent Cust#'              => 'agent_custid',
   );
@@ -373,9 +373,11 @@ sub cust_sql_fields {
     }
   }
 
-  foreach my $field (qw(daytime night mobile fax payby)) {
+  foreach my $field (qw(daytime night mobile fax )) {
     push @fields, $field if (grep { $_ eq $field } @cust_fields);
   }
+  push @fields, "payby AS cust_payby"
+    if grep { $_ eq 'cust_payby' } @cust_fields;
   push @fields, 'agent_custid';
 
   my @extra_fields = ();
@@ -655,7 +657,7 @@ use vars qw($DEBUG);
 use Carp;
 use Storable qw(nfreeze);
 use MIME::Base64;
-use JSON::XS;
+use Cpanel::JSON::XS;
 use FS::CurrentUser;
 use FS::Record qw(qsearchs);
 use FS::queue;