summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2002-04-22 20:47:21 +0000
committerivan <ivan>2002-04-22 20:47:21 +0000
commit6fa9f6fe4cd0b090ea1f0b6236a00241070d0bdc (patch)
treeccdba2fa7c3cf6c3891866d695f552c218bc3235 /FS
parentffe9f4473c5c9c7cb7caeaa5b39160d7b3e8d137 (diff)
- check agentnum ability to order packages in FS::cust_pkg, not signup server
- order by recur price in signup-alternate template
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_pkg.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 0fc21478a..b7633c196 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -139,7 +139,13 @@ sub insert {
my $error = $self->ut_number('custnum');
return $error if $error;
- return "Unknown customer ". $self->custnum unless $self->cust_main;
+ my $cust_main = $self->cust_main;
+ return "Unknown customer ". $self->custnum unless $cust_main;
+
+ my $agent = qsearchs( 'agent', { 'agentnum' => $cust_main->agentnum } );
+ my $pkgpart_href = $agent->pkgpart_hashref;
+ return "agent ". $agent->agentnum. " can't purchase pkgpart ". $self->pkgpart
+ unless $pkgpart_href->{ $self->{pkgpart} };
$self->SUPER::insert;
@@ -695,7 +701,7 @@ sub order {
=head1 VERSION
-$Id: cust_pkg.pm,v 1.18 2002-04-20 02:06:38 ivan Exp $
+$Id: cust_pkg.pm,v 1.19 2002-04-22 20:47:21 ivan Exp $
=head1 BUGS