prevent customer payment type changes from skewing payment report
authorIvan Kohler <ivan@freeside.biz>
Thu, 3 Mar 2016 21:55:22 +0000 (13:55 -0800)
committerIvan Kohler <ivan@freeside.biz>
Thu, 3 Mar 2016 21:55:22 +0000 (13:55 -0800)
FS/FS/UI/Web.pm

index cb0cc99..d31e918 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 { 'cust_payby' eq $field } @cust_fields;
   push @fields, 'agent_custid';
 
   my @extra_fields = ();