[freeside-commits] freeside/FS/FS cust_pkg.pm,1.125,1.126

Ivan,,, ivan at wavetail.420.am
Wed Apr 8 15:42:36 PDT 2009


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv24290

Modified Files:
	cust_pkg.pm 
Log Message:
fix 'agent X can't purchase pkgpart YY' error w/agent packages, RT#5119

Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -d -r1.125 -r1.126
--- cust_pkg.pm	30 Mar 2009 06:10:18 -0000	1.125
+++ cust_pkg.pm	8 Apr 2009 22:42:33 -0000	1.126
@@ -480,10 +480,10 @@
     unless ( $disable_agentcheck ) {
       my $agent =
         qsearchs( 'agent', { 'agentnum' => $self->cust_main->agentnum } );
-      my $pkgpart_href = $agent->pkgpart_hashref;
-      return "agent ". $agent->agentnum.
+      return "agent ". $agent->agentnum. ':'. $agent->agent.
              " can't purchase pkgpart ". $self->pkgpart
-        unless $pkgpart_href->{ $self->pkgpart };
+        unless $agent->pkgpart_hashref->{ $self->pkgpart }
+            || $agent->agentnum == $self->part_pkg->agentnum;
     }
 
     $error = $self->ut_foreign_key('pkgpart', 'part_pkg', 'pkgpart' );



More information about the freeside-commits mailing list