projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git]
/
FS
/
FS
/
type_pkgs.pm
diff --git
a/FS/FS/type_pkgs.pm
b/FS/FS/type_pkgs.pm
index
efba60d
..
d06050e
100644
(file)
--- a/
FS/FS/type_pkgs.pm
+++ b/
FS/FS/type_pkgs.pm
@@
-1,12
+1,7
@@
package FS::type_pkgs;
package FS::type_pkgs;
+use base qw( FS::Record );
use strict;
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
=head1 NAME
@@
-35,6
+30,8
@@
FS::Record. The following fields are currently supported:
=over 4
=over 4
+=item typepkgnum - primary key
+
=item typenum - Agent type, see L<FS::agent_type>
=item pkgpart - Billing item definition, see L<FS::part_pkg>
=item typenum - Agent type, see L<FS::agent_type>
=item pkgpart - Billing item definition, see L<FS::part_pkg>
@@
-80,39
+77,27
@@
sub check {
my $self = shift;
my $error =
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 $error if $error;
- return "Unknown typenum"
- unless qsearchs( 'agent_type', { 'typenum' => $self->typenum } );
-
- return "Unknown pkgpart"
- unless qsearchs( 'part_pkg', { 'pkgpart' => $self->pkgpart } );
-
- ''; #no error
+ $self->SUPER::check;
}
=item part_pkg
Returns the FS::part_pkg object associated with this record.
}
=item part_pkg
Returns the FS::part_pkg object associated with this record.
-=
cut
+=
item agent_type
-sub part_pkg {
- my $self = shift;
- qsearchs( 'part_pkg', { 'pkgpart' => $self->pkgpart } );
-}
+Returns the FS::agent_type object associated with this record.
=cut
=back
=cut
=back
-=head1 VERSION
-
-$Id: type_pkgs.pm,v 1.2 2002-10-04 12:57:06 ivan Exp $
-
=head1 BUGS
=head1 SEE ALSO
=head1 BUGS
=head1 SEE ALSO