use strict;
use vars qw(@ISA $conf);
-use NetAddr::IP;
+
+use base qw(FS::svc_Radius_Mixin FS::svc_Tower_Mixin FS::svc_Common);
+{ no warnings 'redefine'; use NetAddr::IP; }
use FS::Record qw( qsearchs qsearch dbh );
use FS::svc_Common;
use FS::cust_svc;
use FS::part_svc_router;
use FS::tower_sector;
-@ISA = qw( FS::svc_Radius_Mixin FS::svc_Common );
-
$FS::UID::callback{'FS::svc_broadband'} = sub {
$conf = new FS::Conf;
};
=item routernum - arrayref
+=item sectornum - arrayref
+
+=item towernum - arrayref
+
=item order_by
=back
push @where, "addr_block.routernum = $1";
}
}
+
+ #sector and tower, as above
+ my @where_sector = $class->tower_sector_sql($params);
+ if ( @where_sector ) {
+ push @where, @where_sector;
+ push @from, 'LEFT JOIN tower_sector USING ( sectornum )';
+ }
#svcnum
if ( $params->{'svcnum'} =~ /^(\d+)$/ ) {
if ( $cust_pkg && ! $self->latitude && ! $self->longitude ) {
my $l = $cust_pkg->cust_location_or_main;
if ( $l->ship_latitude && $l->ship_longitude ) {
- $self->latitude = $l->ship_latitude;
- $self->longitude = $l->ship_longitude;
+ $self->latitude( $l->ship_latitude );
+ $self->longitude( $l->ship_longitude );
} elsif ( $l->latitude && $l->longitude ) {
- $self->latitude = $l->latitude;
- $self->longitude = $l->longitude;
+ $self->latitude( $l->latitude );
+ $self->longitude( $l->longitude );
}
}
new NetAddr::IP ($self->ip_addr);
}
-=item tower_sector
-
-=cut
-
-sub tower_sector {
- my $self = shift;
- return '' unless $self->sectornum;
- qsearchs('tower_sector', { sectornum => $self->sectornum });
-}
-
=item addr_block
Returns the FS::addr_block record (i.e. the address block) for this broadband service.