From ddd5391e023f98f8ea30bad9e14ec1905d5b35f4 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 7 Mar 2011 01:36:26 +0000 Subject: [PATCH] when bill_usage_on_cancel config is set, fix billing setup on cancellation of unbilled packages, RT#11651 --- FS/FS/cust_main/Billing.pm | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm index aeb0c51d5..44181eb7c 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; -- 2.11.0