X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main%2FBilling.pm;h=850ffaa3a985492f7c96d36c7ed97a02db95d52b;hb=074464a707b2c8b83cc50cd0bb067660ef4d0f9f;hp=eb5bd0ba0a95c9380a4108fcf6b349d20910beff;hpb=d492bb51af64fc85678cd73e8dfe6dd2cdcf8748;p=freeside.git diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm index eb5bd0ba0..850ffaa3a 100644 --- a/FS/FS/cust_main/Billing.pm +++ b/FS/FS/cust_main/Billing.pm @@ -253,8 +253,9 @@ charges, etc. =item freq_override If set, then override the normal frequency and look for a part_pkg_discount -to take at that frequency. This will exclude any packages that aren't billed -on a monthly cycle. +to take at that frequency. This is appropriate only when the normal +frequency for all packages is monthly, and is an error otherwise. Use +C to limit the set of packages included in billing. =item time @@ -381,7 +382,7 @@ sub bill { next if $options{'not_pkgpart'}->{$cust_pkg->pkgpart}; - warn " bill package ". $cust_pkg->pkgnum. "\n" if $DEBUG > 1; + warn " bill package ". $cust_pkg->pkgnum. "\n" if $DEBUG; #? to avoid use of uninitialized value errors... ? $cust_pkg->setfield('bill', '') @@ -419,11 +420,17 @@ sub bill { 'real_pkgpart' => $real_pkgpart, 'options' => \%options, ); - # Stop if anything goes wrong, or if we're not incrementing - # the bill date. + + # Stop if anything goes wrong last if $error; + + # or if we're not incrementing the bill date. last if ($cust_pkg->getfield('bill') || 0) == $next_bill; + $next_bill = $cust_pkg->getfield('bill') || 0; + + #stop if -o was passed to freeside-daily + last if $options{'one_recur'}; } if ($error) { $dbh->rollback if $oldAutoCommit && !$options{no_commit}; @@ -1158,7 +1165,7 @@ sub _handle_taxes { } else { - my @loc_keys = qw( city county state country ); + my @loc_keys = qw( district city county state country ); my %taxhash; if ( $conf->exists('tax-pkg_address') && $cust_pkg->locationnum ) { my $cust_location = $cust_pkg->cust_location; @@ -1175,7 +1182,7 @@ sub _handle_taxes { my @taxes = (); my %taxhash_elim = %taxhash; - my @elim = qw( city county state ); + my @elim = qw( district city county state ); do { #first try a match with taxclass