X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main%2FPackages.pm;h=ead97f2c37ecc83983dd493710543eed2eca8e96;hb=80c2d997c5c983344c530ecbb46f94f1c299b35f;hp=d7a1e928a841a5c2aa853b2681791b766691196f;hpb=6da8d320d8792e6b70ec5cf1a40088f87f4762e5;p=freeside.git diff --git a/FS/FS/cust_main/Packages.pm b/FS/FS/cust_main/Packages.pm index d7a1e928a..ead97f2c3 100644 --- a/FS/FS/cust_main/Packages.pm +++ b/FS/FS/cust_main/Packages.pm @@ -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) 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