X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_Tower_Mixin.pm;h=dab096ddc2f4b80faf5eae299d278aa25ace4b11;hb=6776904eea418b12bec7f1aa0296e9384981d07a;hp=3da07c1cd0d3e3b5d812bf902dabcbd859d0302c;hpb=0e5eacb11e6745871c9521e2d5e72da44f65e0f2;p=freeside.git

diff --git a/FS/FS/svc_Tower_Mixin.pm b/FS/FS/svc_Tower_Mixin.pm
index 3da07c1cd..dab096ddc 100644
--- a/FS/FS/svc_Tower_Mixin.pm
+++ b/FS/FS/svc_Tower_Mixin.pm
@@ -37,7 +37,13 @@ sub tower_sector_sql {
       my $in = join(',', map { /^(\d+)$/ ? $1 : () } @$value);
       my @orwhere;
       push @orwhere, "tower_sector.$field IN ($in)" if $in;
-      push @orwhere, "tower_sector.$field IS NULL" if grep /^none$/, @$value;
+      if ( grep /^none$/, @$value ) {
+        # then allow this field to be null
+        push @orwhere, "tower_sector.$field IS NULL";
+        # and if this field is the sector, also allow the default sector
+        # on the tower
+        push @orwhere, "sectorname = '_default'" if $field eq 'sectornum';
+      }
       push @where, '( '.join(' OR ', @orwhere).' )';
     }
     elsif ( $value =~ /^(\d+)$/ ) {