From 7070356f09267ce78440bff9f36d7ce6cfcd1802 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 16 Jan 2014 01:46:47 -0800 Subject: don't allow a start date for packages definitions with prorate_defer_bill, RT#25650 --- FS/FS/part_pkg/flat.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'FS') diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm index 757e1ceb6..f3a2b85a5 100644 --- a/FS/FS/part_pkg/flat.pm +++ b/FS/FS/part_pkg/flat.pm @@ -253,7 +253,15 @@ sub is_free_options { sub is_prepaid { 0; } #no, we're postpaid -sub can_start_date { ! shift->option('start_1st', 1) } +sub can_start_date { + my $self = shift; + my %opt = @_; + + ! $self->option('start_1st', 1) && ( ! $self->option('sync_bill_date',1) + || ! $self->option('prorate_defer_bill',1) + || ! $opt{'num_ncancelled_pkgs'} + ); +} sub can_discount { 1; } -- cgit v1.2.1