use object copy when billing on cancel to avoid very weird side effects ( including...
authorjeff <jeff>
Mon, 28 Sep 2009 15:55:12 +0000 (15:55 +0000)
committerjeff <jeff>
Mon, 28 Sep 2009 15:55:12 +0000 (15:55 +0000)
FS/FS/cust_pkg.pm

index e7f8484..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"