UI for per-city taxes (setup and assigning to customers/package locations), RT#5852
[freeside.git] / FS / FS / cust_pkg.pm
index 4e57fbf..e839eb9 100644 (file)
@@ -603,8 +603,9 @@ sub cancel {
   #resolved by performing a change package instead (which unprovisions) and
   #later cancelling
   if ( !$options{nobill} && !$date && $conf->exists('bill_usage_on_cancel') ) {
+      my $copy = $self->new({$self->hash});
       my $error =
-        $self->cust_main->bill( pkg_list => [ $self ], cancel => 1 );
+        $copy->cust_main->bill( pkg_list => [ $copy ], cancel => 1 );
       warn "Error billing during cancel, custnum ".
         #$self->cust_main->custnum. ": $error"
         ": $error"
@@ -2476,7 +2477,7 @@ sub search_sql {
 
     @pkgpart = grep /^(\d+)$/, @pkgpart;
 
-    push @where, 'pkgpart IN ('. join(',', @pkgpart). ')';
+    push @where, 'pkgpart IN ('. join(',', @pkgpart). ')' if scalar(@pkgpart);
 
   } elsif ( $params->{'pkgpart'} =~ /^(\d+)$/ ) {
     push @where, "pkgpart = $1";