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;
$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,
};
}
+=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,
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')