fix 4.x upgrades of address-less customers, RT#24968
authorIvan Kohler <ivan@freeside.biz>
Mon, 9 Dec 2013 20:24:58 +0000 (12:24 -0800)
committerIvan Kohler <ivan@freeside.biz>
Mon, 9 Dec 2013 20:24:58 +0000 (12:24 -0800)
FS/FS/cust_main/Location.pm

index 4bcffab..4f382af 100644 (file)
@@ -158,7 +158,11 @@ sub _upgrade_data {
     }
   }
 
-  foreach my $cust_main (qsearch('cust_main', { bill_locationnum => '' })) {
+  foreach my $cust_main (qsearch('cust_main', {
+                           bill_locationnum => '',
+                           address1         => { op=>'!=', value=>'' },
+                        }))
+  {
     # Step 1: extract billing and service addresses into cust_location
     my $custnum = $cust_main->custnum;
     my $bill_location = FS::cust_location->new(