diff options
-rw-r--r-- | FS/FS/cust_pkg.pm | 6 | ||||
-rw-r--r-- | FS/FS/part_pkg_link.pm | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index 0cb620932..7678a0295 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -935,7 +935,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"; diff --git a/FS/FS/part_pkg_link.pm b/FS/FS/part_pkg_link.pm index 2460e995d..aee0131d2 100644 --- a/FS/FS/part_pkg_link.pm +++ b/FS/FS/part_pkg_link.pm @@ -260,11 +260,6 @@ sub check { ") must be an integer multiple of main package period."; } } - if (( $src_pkg->option('delay_cancel',1) && !$dst_pkg->option('delay_cancel',1) ) || - ( $dst_pkg->option('delay_cancel',1) && !$src_pkg->option('delay_cancel',1) ) - ) { - return "Supplemental package must have same value as main package for automatic suspension on cancel."; - } } $self->SUPER::check; |