projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
FS RT #30362 - added configuration option to disable package modification in selfservice
[freeside.git]
/
FS
/
FS
/
rate.pm
diff --git
a/FS/FS/rate.pm
b/FS/FS/rate.pm
index
49ac938
..
b2d121c
100644
(file)
--- a/
FS/FS/rate.pm
+++ b/
FS/FS/rate.pm
@@
-35,10
+35,18
@@
FS::Record. The following fields are currently supported:
=over 4
=over 4
-=item ratenum - primary key
+=item ratenum
+
+primary key
=item ratename
=item ratename
+Rate name
+
+=item agentnum
+
+Optional agent (see L<FS::agent>) for agent-virtualized rates.
+
=back
=head1 METHODS
=back
=head1 METHODS
@@
-254,15
+262,13
@@
and replace methods.
=cut
=cut
-# the check method should currently be supplied - FS::Record contains some
-# data checking routines
-
sub check {
my $self = shift;
my $error =
$self->ut_numbern('ratenum')
|| $self->ut_text('ratename')
sub check {
my $self = shift;
my $error =
$self->ut_numbern('ratenum')
|| $self->ut_text('ratename')
+ #|| $self->ut_foreign_keyn('agentnum', 'agent', 'agentnum')
;
return $error if $error;
;
return $error if $error;
@@
-389,6
+395,16
@@
sub rate_detail {
qsearch( 'rate_detail', { 'ratenum' => $self->ratenum } );
}
qsearch( 'rate_detail', { 'ratenum' => $self->ratenum } );
}
+=item agent
+
+=cut
+
+sub agent {
+ my $self = shift;
+ eval "use FS::agent";
+ die $@ if $@;
+ qsearchs( 'agent', { 'agentnum' => $self->agentnum } );
+}
=back
=back