fix warning
[freeside.git] / FS / FS / cust_main / Billing.pm
index ca0f8e5..395e629 100644 (file)
@@ -798,9 +798,9 @@ sub calculate_taxes {
   #move the cust_tax_exempt_pkg records to the cust_bill_pkgs we will commit
   my %packagemap = map { $_->pkgnum => $_ } @$cust_bill_pkg;
   foreach my $tax ( keys %$taxlisthash ) {
-    foreach ( @{ $taxlisthash->{$tax} }[1 ... scalar(@{ $taxlisthash->{$tax} })] ) {
-      next unless ref($_) eq 'FS::cust_bill_pkg';
-     
+    foreach ( @{ $taxlisthash->{$tax} }[1 .. scalar(@{ $taxlisthash->{$tax}}) - 1] ) {
+      next unless ref($_) eq 'FS::cust_bill_pkg'; #IS needed for CCH tax-on-tax
+
       my @cust_tax_exempt_pkg = splice( @{ $_->_cust_tax_exempt_pkg } );
 
       next unless @cust_tax_exempt_pkg; #just avoiding the prob when irrelevant?
@@ -1751,8 +1751,9 @@ sub due_cust_event {
 
   #???
   #my $DEBUG = $opt{'debug'}
+  $opt{'debug'} ||= 0; # silence some warnings
   local($DEBUG) = $opt{'debug'}
-    if defined($opt{'debug'}) && $opt{'debug'} > $DEBUG;
+    if $opt{'debug'} > $DEBUG;
   $DEBUG = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG;
 
   warn "$me due_cust_event called with options ".