summaryrefslogtreecommitdiff
path: root/FS/FS/svc_broadband.pm
diff options
context:
space:
mode:
authorjeff <jeff>2008-06-28 19:25:24 +0000
committerjeff <jeff>2008-06-28 19:25:24 +0000
commita1871d3d13c1dafa93b956762c0d23728d261da7 (patch)
treeecd799ff28ca27d5e2ef07a615bcac49621dd391 /FS/FS/svc_broadband.pm
parent7588be4eb948426b972d0238dcdbb1537dc6a72a (diff)
agent virtualize address blocks and routers
Diffstat (limited to 'FS/FS/svc_broadband.pm')
-rwxr-xr-xFS/FS/svc_broadband.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/FS/FS/svc_broadband.pm b/FS/FS/svc_broadband.pm
index d123524..fa90437 100755
--- a/FS/FS/svc_broadband.pm
+++ b/FS/FS/svc_broadband.pm
@@ -220,6 +220,24 @@ sub check {
if($self->speed_up < 0) { return 'speed_up must be positive'; }
if($self->speed_down < 0) { return 'speed_down must be positive'; }
+ my $cust_svc = $self->svcnum
+ ? qsearchs('cust_svc', { 'svcnum' => $self->svcnum } )
+ : '';
+ my $cust_pkg;
+ if ($cust_svc) {
+ $cust_pkg = $cust_svc->cust_pkg;
+ }else{
+ $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $self->pkgnum } );
+ return "Invalid pkgnum" unless $cust_pkg;
+ }
+
+ if ($cust_pkg) {
+ my $addr_agentnum = $self->addr_block->agentnum;
+ if ($addr_agentnum && $addr_agentnum != $cust_pkg->cust_main->agentnum) {
+ return "Address block does not service this customer";
+ }
+ }
+
if (not($self->ip_addr) or $self->ip_addr eq '0.0.0.0') {
my $next_addr = $self->addr_block->next_free_addr;
if ($next_addr) {
@@ -290,6 +308,9 @@ sub allowed_routers {
The business with sb_field has been 'fixed', in a manner of speaking.
+allowed_routers isn't agent virtualized because part_svc isn't agent
+virtualized
+
=head1 SEE ALSO
FS::svc_Common, FS::Record, FS::addr_block,