[freeside-commits] freeside/FS/FS cust_main.pm,1.442,1.443
Ivan,,,
ivan at wavetail.420.am
Fri Jul 17 15:26:40 PDT 2009
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv30598/FS/FS
Modified Files:
cust_main.pm
Log Message:
commit pkgpart exclusion for billing run, RT#5495
Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.442
retrieving revision 1.443
diff -u -d -r1.442 -r1.443
--- cust_main.pm 17 Jul 2009 01:44:24 -0000 1.442
+++ cust_main.pm 17 Jul 2009 22:26:38 -0000 1.443
@@ -2331,6 +2331,9 @@
=back
+Options are passed to the B<bill> and B<collect> methods verbatim, so all
+options of those methods are also available.
+
=cut
sub bill_and_collect {
@@ -2448,6 +2451,10 @@
$cust_main->bill( pkg_list => [$pkg1, $pkg2] );
+=item not_pkgpart
+
+A hashref of pkgparts to exclude from this billing run.
+
=item invoice_time
Used in conjunction with the I<time> option, this option specifies the date of for the generated invoices. Other calculations, such as whether or not to generate the invoice in the first place, are not affected.
@@ -2472,6 +2479,8 @@
my $time = $options{'time'} || time;
my $invoice_time = $options{'invoice_time'} || $time;
+ $options{'not_pkgpart'} ||= {};
+
#put below somehow?
local $SIG{HUP} = 'IGNORE';
local $SIG{INT} = 'IGNORE';
@@ -2497,8 +2506,10 @@
my %taxlisthash;
my @precommit_hooks = ();
- $options{ pkg_list } ||= [ $self->ncancelled_pkgs ]; #param checks?
- foreach my $cust_pkg ( @{ $options{ pkg_list } } ) {
+ $options{'pkg_list'} ||= [ $self->ncancelled_pkgs ]; #param checks?
+ foreach my $cust_pkg ( @{ $options{'pkg_list'} } ) {
+
+ next if $options{'not_pkgpart'}->{$cust_pkg->pkgpart};
warn " bill package ". $cust_pkg->pkgnum. "\n" if $DEBUG > 1;
More information about the freeside-commits
mailing list