eliminate some false laziness in FS::Misc::send_email vs. msg_template/email.pm send_...
[freeside.git] / FS / FS / inventory_item.pm
index 39a0dff..9a58a64 100644 (file)
@@ -1,13 +1,7 @@
 package FS::inventory_item;
+use base qw( FS::cust_main_Mixin FS::Record );
 
 use strict;
-use vars qw( @ISA );
-use FS::Record qw( dbh qsearch qsearchs );
-use FS::cust_main_Mixin;
-use FS::inventory_class;
-use FS::cust_svc;
-
-@ISA = qw( FS::cust_main_Mixin FS::Record );
 
 =head1 NAME
 
@@ -111,6 +105,7 @@ sub check {
                                            'Edit global inventory'] )
     || $self->ut_text('item')
     || $self->ut_foreign_keyn('svcnum', 'cust_svc', 'svcnum' )
+    || $self->ut_alphan('svc_field')
   ;
   return $error if $error;
 
@@ -122,25 +117,10 @@ sub check {
 Returns the customer service associated with this inventory item, if the
 item has been used (see L<FS::cust_svc>).
 
-=cut
-
-sub cust_svc {
-  my $self = shift;
-  return '' unless $self->svcnum;
-  qsearchs( 'cust_svc', { 'svcnum' => $self->svcnum } );
-}
-
 =item agent 
 
 Returns the associated agent for this event, if any, as an FS::agent object.
 
-=cut
-
-sub agent {
-  my $self = shift;
-  qsearchs('agent', { 'agentnum' => $self->agentnum } );
-}
-
 =back
 
 =head1 SUBROUTINES
@@ -173,7 +153,7 @@ maybe batch_import should be a regular method in FS::inventory_class
 
 =head1 SEE ALSO
 
-L<inventory_class>, L<cust_svc>, L<FS::Record>, schema.html from the base
+L<FS::inventory_class>, L<FS::cust_svc>, L<FS::Record>, schema.html from the base
 documentation.
 
 =cut