From: Jonathan Prykop Date: Mon, 16 Feb 2015 21:30:37 +0000 (-0600) Subject: RT#14671: Usage for current day when billing outstanding usage (for cancelling custom... X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=598f5364ffaab833463442f910fc9c533975e317;p=freeside.git RT#14671: Usage for current day when billing outstanding usage (for cancelling customers) [better supplemental package handling] --- diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index 079a8657a..69f7bc0a8 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -949,7 +949,11 @@ sub cancel { } foreach my $supp_pkg ( $self->supplemental_pkgs ) { - $error = $supp_pkg->cancel(%options, 'from_main' => 1); + if ($delay_cancel) { + $error = $supp_pkg->suspend(%options, 'from_main' => 1, 'reason' => undef); + } else { + $error = $supp_pkg->cancel(%options, 'from_main' => 1); + } if ( $error ) { $dbh->rollback if $oldAutoCommit; return "canceling supplemental pkg#".$supp_pkg->pkgnum.": $error";