projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
connection charge handling which comports with history of module
[freeside.git]
/
FS
/
FS
/
type_pkgs.pm
diff --git
a/FS/FS/type_pkgs.pm
b/FS/FS/type_pkgs.pm
index
5b3b11c
..
6503755
100644
(file)
--- a/
FS/FS/type_pkgs.pm
+++ b/
FS/FS/type_pkgs.pm
@@
-35,6
+35,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,17
+82,12
@@
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 } );
-
$self->SUPER::check;
}
$self->SUPER::check;
}
@@
-105,13
+102,20
@@
sub part_pkg {
qsearchs( 'part_pkg', { 'pkgpart' => $self->pkgpart } );
}
qsearchs( 'part_pkg', { 'pkgpart' => $self->pkgpart } );
}
+=item agent_type
+
+Returns the FS::agent_type object associated with this record.
+
=cut
=cut
-=back
+sub agent_type {
+ my $self = shift;
+ qsearchs( 'agent_type', { 'typenum' => $self->typenum } );
+}
-=
head1 VERSION
+=
cut
-$Id: type_pkgs.pm,v 1.3 2003-08-05 00:20:48 khoff Exp $
+=back
=head1 BUGS
=head1 BUGS