[freeside-commits] freeside/FS/FS/ClientAPI MasonComponent.pm, 1.3, 1.4

Ivan,,, ivan at wavetail.420.am
Thu Oct 22 05:50:07 PDT 2009


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

Modified Files:
	MasonComponent.pm 
Log Message:
restrict additinal package order option, RT#6029

Index: MasonComponent.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/MasonComponent.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- MasonComponent.pm	22 Aug 2009 00:22:08 -0000	1.3
+++ MasonComponent.pm	22 Oct 2009 12:50:05 -0000	1.4
@@ -59,6 +59,21 @@
            }
       qsearch( 'part_pkg', { 'disabled' => '' }, '', 'ORDER BY pkg' ); # case?
 
+    my $conf = new FS::Conf;
+    if ( $conf->exists('pkg-addon_classnum') ) {
+
+      my %classnum = map  { ( $_->addon_classnum => 1 ) }
+                     grep { $_->freq !~ /^0/ }
+                     map  { $_->part_pkg }
+                          $cust_main->ncancelled_pkgs;
+
+      warn "classnums: ". join(',', keys %classnum). "\n";
+
+      unless ( $classnum{''} ) {
+        @part_pkg = grep $classnum{ $_->classnum }, @part_pkg;
+      }
+    }
+
     my %args = @$argsref;
     $args{part_pkg} = \@part_pkg;
     @$argsref = ( %args );



More information about the freeside-commits mailing list