summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2011-03-07 01:36:27 +0000
committerivan <ivan>2011-03-07 01:36:27 +0000
commit77611d0838f839fb9f85279799717c7fbdb55fe9 (patch)
tree1b502671f1e4405ff3b5584d54ac4ee41bd8ad95
parent27d8db899a726117329d45af3af149e881856bac (diff)
when bill_usage_on_cancel config is set, fix billing setup on cancellation of unbilled packages, RT#11651
-rw-r--r--FS/FS/cust_main/Billing.pm28
1 files changed, 15 insertions, 13 deletions
diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm
index 4346893..0dfaa49 100644
--- a/FS/FS/cust_main/Billing.pm
+++ b/FS/FS/cust_main/Billing.pm
@@ -820,19 +820,21 @@ sub _make_lines {
my $setup = 0;
my $unitsetup = 0;
- if ( $options{'resetup'}
- || ( ! $cust_pkg->setup
- && ( ! $cust_pkg->start_date
- || $cust_pkg->start_date <= $time
- )
- && ( ! $conf->exists('disable_setup_suspended_pkgs')
- || ( $conf->exists('disable_setup_suspended_pkgs') &&
- ! $cust_pkg->getfield('susp')
- )
- )
- )
- and !$options{recurring_only}
- )
+ if ( ! $options{recurring_only}
+ and ! $options{cancel}
+ and ( $options{'resetup'}
+ || ( ! $cust_pkg->setup
+ && ( ! $cust_pkg->start_date
+ || $cust_pkg->start_date <= $time
+ )
+ && ( ! $conf->exists('disable_setup_suspended_pkgs')
+ || ( $conf->exists('disable_setup_suspended_pkgs') &&
+ ! $cust_pkg->getfield('susp')
+ )
+ )
+ )
+ )
+ )
{
warn " bill setup\n" if $DEBUG > 1;