summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2010-10-18 02:46:33 +0000
committerivan <ivan>2010-10-18 02:46:33 +0000
commite2cff16135741b166473d18f828ad54f57037dae (patch)
treeda581e8d4b67f70dcd9b4000bb79e576831b7bd6 /FS
parentf3b1e139720b2262516ee3690b1d4b2b9941b500 (diff)
suspend_bill package option to continue recurring billing while suspended and part_pkg-default_suspend_bill conf option to set it by default, RT#10148
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm7
-rw-r--r--FS/FS/cust_main/Billing.pm17
-rw-r--r--FS/FS/part_pkg/flat.pm5
3 files changed, 19 insertions, 10 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index b3e54778b..55495e362 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -3991,6 +3991,13 @@ and customer address. Include units.',
'type' => 'text',
},
+ {
+ 'key' => 'part_pkg-default_suspend_bill',
+ 'section' => 'billing',
+ 'description' => 'Default the "Continue recurring billing while suspended" flag to on for new package definitions.',
+ 'type' => 'checkbox',
+ },
+
{ key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
{ key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
{ key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm
index b588dc5cb..10734bf34 100644
--- a/FS/FS/cust_main/Billing.pm
+++ b/FS/FS/cust_main/Billing.pm
@@ -856,15 +856,14 @@ sub _make_lines {
my $recur = 0;
my $unitrecur = 0;
my $sdate;
- if ( ! $cust_pkg->get('susp')
- and ! $cust_pkg->get('start_date')
- and ( $part_pkg->getfield('freq') ne '0'
- && ( $cust_pkg->getfield('bill') || 0 ) <= $time
- )
- || ( $part_pkg->plan eq 'voip_cdr'
- && $part_pkg->option('bill_every_call')
- )
- || ( $options{cancel} )
+ if ( ! $cust_pkg->start_date
+ and ( ! $cust_pkg->susp || $part_pkg->option('suspend_bill') )
+ and
+ ( $part_pkg->freq ne '0' && ( $cust_pkg->bill || 0 ) <= $time )
+ || ( $part_pkg->plan eq 'voip_cdr'
+ && $part_pkg->option('bill_every_call')
+ )
+ || $options{cancel}
) {
# XXX should this be a package event? probably. events are called
diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm
index c52f96e12..ee54c09ec 100644
--- a/FS/FS/part_pkg/flat.pm
+++ b/FS/FS/part_pkg/flat.pm
@@ -135,6 +135,9 @@ tie my %contract_years, 'Tie::IxHash', (
'with the customer\'s other packages',
'type' => 'checkbox',
},
+ 'suspend_bill' => { 'name' => 'Continue recurring billing while suspended',
+ 'type' => 'checkbox',
+ },
'unsuspend_adjust_bill' =>
{ 'name' => 'Adjust next bill date forward when '.
'unsuspending',
@@ -153,7 +156,7 @@ tie my %contract_years, 'Tie::IxHash', (
expire_months adjourn_months
contract_end_months
start_1st sync_bill_date
- unsuspend_adjust_bill
+ suspend_bill unsuspend_adjust_bill
),
@usage_fieldorder, @usage_recharge_fieldorder,
qw( externalid ),