X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_main%2FBilling.pm;h=29f7e8e5413cbfc1a5c5b59f44cbaf8839a4c995;hp=d55cb2f372cfc280afe4bf287c283ccad621270f;hb=7a486dea647f735a9a1d0381443218ad6affe6e1;hpb=43da86c4a7fab275a941650abb11173f4f2930aa diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm index d55cb2f37..29f7e8e54 100644 --- a/FS/FS/cust_main/Billing.pm +++ b/FS/FS/cust_main/Billing.pm @@ -1090,6 +1090,16 @@ sub _make_lines { my %setup_param = ( 'discounts' => \@setup_discounts ); my $setup_billed_currency = ''; my $setup_billed_amount = 0; + # Conditions for setting setup date and charging the setup fee: + # - this is not a recurring-only billing run + # - and the package is not currently being canceled + # - and, unless we're specifically told otherwise via 'resetup': + # - it doesn't already HAVE a setup date + # - or a start date in the future + # - and it's not suspended + # + # The last condition used to check the "disable_setup_suspended" option but + # that's obsolete. We now never set the setup date on a suspended package. if ( ! $options{recurring_only} and ! $options{cancel} and ( $options{'resetup'} @@ -1097,11 +1107,7 @@ sub _make_lines { && ( ! $cust_pkg->start_date || $cust_pkg->start_date <= $cmp_time ) - && ( ! $conf->exists('disable_setup_suspended_pkgs') - || ( $conf->exists('disable_setup_suspended_pkgs') && - ! $cust_pkg->getfield('susp') - ) - ) + && ( ! $cust_pkg->getfield('susp') ) ) ) )