X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fsvc_Tower_Mixin.pm;h=d6776791c5ef79faddf5a21e5cecc6190c60123b;hp=2555b9e506ce3100a82d7bbd87754b8c28a3590d;hb=ff27c3f36240aee48ed50153dd5d8fe3ac3f2443;hpb=32072dbf59a054529f5304574c0f56f9567d14d0 diff --git a/FS/FS/svc_Tower_Mixin.pm b/FS/FS/svc_Tower_Mixin.pm index 2555b9e50..d6776791c 100644 --- a/FS/FS/svc_Tower_Mixin.pm +++ b/FS/FS/svc_Tower_Mixin.pm @@ -27,7 +27,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+)$/ ) {