Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / FS / FS / cust_main / Packages.pm
index d7a1e92..ead97f2 100644 (file)
@@ -197,7 +197,7 @@ sub order_pkg {
         map { $_ => $cust_pkg->$_() }
           qw( pkgbatch
               start_date order_date expire adjourn contract_end
-              refnum discountnum waive_setup
+              refnum setup_discountnum recur_discountnum waive_setup
             )
     });
     $error = $self->order_pkg('cust_pkg'    => $pkg,
@@ -574,6 +574,21 @@ sub active_pkgs {
        $self->unsuspended_pkgs;
 }
 
+=item ncancelled_active_pkgs
+
+Returns all non-cancelled packages (see L<FS::cust_pkg>) for this customer that
+are active (recurring).
+
+=cut
+
+sub ncancelled_active_pkgs {
+  my $self = shift; 
+  grep { my $part_pkg = $_->part_pkg;
+         $part_pkg->freq ne '' && $part_pkg->freq ne '0';
+       }
+       $self->ncancelled_pkgs;
+}
+
 =item billing_pkgs
 
 Returns active packages, and also any suspended packages which are set to