X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Finventory_item.pm;h=9a58a6463526fa71ddfbfe1b93f04a406e0e0f2c;hp=39a0dff4b802f6c1fbfb9e4248f4aa4f9f449471;hb=3adb46fccf9f631e188ea5383bd147b340477639;hpb=f1cd7f98b487e74aa60b6c41d3377cc60f7ac25a diff --git a/FS/FS/inventory_item.pm b/FS/FS/inventory_item.pm index 39a0dff4b..9a58a6463 100644 --- a/FS/FS/inventory_item.pm +++ b/FS/FS/inventory_item.pm @@ -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). -=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, L, L, schema.html from the base +L, L, L, schema.html from the base documentation. =cut