sales tax districts, #15089
[freeside.git] / FS / FS / cust_main / Billing.pm
index eb5bd0b..850ffaa 100644 (file)
@@ -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<pkg_list> 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