X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Ftype_pkgs.pm;h=8cc2345ff7a33c521324348f1bfc5052ad0dc582;hp=8e0d4ef5655b44a99e7c9beca3f2cf8aeed2bdaa;hb=5372897f367498972c96f5494e142e6e11b29eb8;hpb=6cd87c0d3b5280446301c647fa5f1ec5a593fa3f diff --git a/FS/FS/type_pkgs.pm b/FS/FS/type_pkgs.pm index 8e0d4ef56..8cc2345ff 100644 --- a/FS/FS/type_pkgs.pm +++ b/FS/FS/type_pkgs.pm @@ -1,12 +1,7 @@ package FS::type_pkgs; +use base qw( FS::Record ); use strict; -use vars qw( @ISA ); -use FS::Record qw( qsearchs ); -use FS::agent_type; -use FS::part_pkg; - -@ISA = qw( FS::Record ); =head1 NAME @@ -35,6 +30,8 @@ FS::Record. The following fields are currently supported: =over 4 +=item typepkgnum - primary key + =item typenum - Agent type, see L =item pkgpart - Billing item definition, see L @@ -80,31 +77,32 @@ sub check { my $self = shift; my $error = - $self->ut_number('typenum') - || $self->ut_number('pkgpart') + $self->ut_numbern('typepkgnum') + || $self->ut_foreign_key('typenum', 'agent_type', 'typenum' ) + || $self->ut_foreign_key('pkgpart', 'part_pkg', 'pkgpart' ) ; return $error if $error; - return "Unknown typenum" - unless qsearchs( 'agent_type', { 'typenum' => $self->typenum } ); + $self->SUPER::check; +} - return "Unknown pkgpart" - unless qsearchs( 'part_pkg', { 'pkgpart' => $self->pkgpart } ); +=item part_pkg - ''; #no error -} +Returns the FS::part_pkg object associated with this record. -=back +=item agent_type + +Returns the FS::agent_type object associated with this record. -=head1 VERSION +=cut -$Id: type_pkgs.pm,v 1.1 1999-08-04 09:03:53 ivan Exp $ +=back =head1 BUGS =head1 SEE ALSO -L, L, L, schema.html from the base +L, L, L, schema.html from the base documentation. =cut