X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_cable.pm;h=5d281135b1a10959ab598754331da7730a82e076;hb=18092846de81204c8be139ce47fd41191e5606c2;hp=596f69995730edfca73c0ff7efbc52717737098a;hpb=c472510ffbe145ae090981bc1b0be9b644de6a37;p=freeside.git diff --git a/FS/FS/svc_cable.pm b/FS/FS/svc_cable.pm index 596f69995..5d281135b 100644 --- a/FS/FS/svc_cable.pm +++ b/FS/FS/svc_cable.pm @@ -1,5 +1,7 @@ package FS::svc_cable; -use base qw( FS::svc_Common ); #qw( FS::device_Common FS::svc_Common ); +use base qw( FS::svc_MAC_Mixin + FS::svc_Common + ); #FS::device_Common use strict; use Tie::IxHash; @@ -84,7 +86,7 @@ sub table_info { $p ? $p->provider : ''; }, }, - #XXX "Circuit ID/Order number" + 'ordernum' => 'Order number', #XXX "Circuit ID/Order number" 'modelnum' => { label => 'Model', type => 'select-cable_model', disable_inventory => 1, @@ -115,6 +117,22 @@ sub table_info { }; } +=item label + +Returns the MAC address and serial number. + +=cut + +sub label { + my $self = shift; + my @label = (); + push @label, 'MAC:'. $self->mac_addr_pretty + if $self->mac_addr; + push @label, 'Serial#'. $self->serialnum + if $self->serialnum; + return join(', ', @label); +} + =item insert Adds this record to the database. If there is an error, returns the error, @@ -142,7 +160,8 @@ sub check { my $error = $self->ut_numbern('svcnum') - || $self->ut_foreign_key('providernum', 'cable_provider', 'providernum') + || $self->ut_foreign_keyn('providernum', 'cable_provider', 'providernum') + || $self->ut_alphan('ordernum') || $self->ut_foreign_key('modelnum', 'cable_model', 'modelnum') || $self->ut_alpha('serialnum') || $self->ut_mac_addr('mac_addr')