X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Freg_code_pkg.pm;h=f438f6745a321555e8c3c50bd9bfee9f781dd2c6;hp=598497c466e6da04ddebfb0ea045531c614de24f;hb=a36e0f8a0f69349dafaa16d1d2d57dfb6e5dbc85;hpb=55a68e4aabe10db4d9c3ab1bb8befd2f9f4b9008 diff --git a/FS/FS/reg_code_pkg.pm b/FS/FS/reg_code_pkg.pm index 598497c46..f438f6745 100644 --- a/FS/FS/reg_code_pkg.pm +++ b/FS/FS/reg_code_pkg.pm @@ -1,12 +1,7 @@ package FS::reg_code_pkg; +use base qw(FS::Record); use strict; -use vars qw( @ISA ); -use FS::Record qw(qsearchs); -use FS::reg_code; -use FS::part_pkg; - -@ISA = qw(FS::Record); =head1 NAME @@ -35,6 +30,8 @@ supported: =over 4 +=item codepkgnum - primary key + =item codenum - registration code (see L) =item pkgpart - package definition (see L) @@ -47,7 +44,8 @@ supported: =item new HASHREF -Creates a new example. To add the example to the database, see L<"insert">. +Creates a new registration code. To add the registration code to the database, +see L<"insert">. Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the I method. @@ -99,7 +97,8 @@ sub check { my $self = shift; my $error = - $self->ut_foreign_key('codenum', 'reg_code', 'codenum') + $self->ut_numbern('codepkgnum') + || $self->ut_foreign_key('codenum', 'reg_code', 'codenum') || $self->ut_foreign_key('pkgpart', 'part_pkg', 'pkgpart') ; return $error if $error; @@ -111,13 +110,6 @@ sub check { Returns the package definition (see L) -=cut - -sub part_pkg { - my $self = shift; - qsearchs('part_pkg', { 'pkgpart' => $self->pkgpart } ); -} - =back =head1 BUGS