summaryrefslogtreecommitdiff
path: root/FS/FS/part_pkg.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-09-10 22:19:29 -0700
committerIvan Kohler <ivan@freeside.biz>2013-09-10 22:19:29 -0700
commit65d0561c4d456c2d600acb03a675549d098f5776 (patch)
treecab9aa4bcf2c0fdfbc2ffa37c9cb129d6fe8e372 /FS/FS/part_pkg.pm
parentf417eee294482e6a7bc4ad60c916b84ffd662112 (diff)
improve performance of package ordering, RT#24955, fallout from future start dates, RT#20686
Diffstat (limited to 'FS/FS/part_pkg.pm')
-rw-r--r--FS/FS/part_pkg.pm27
1 files changed, 5 insertions, 22 deletions
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm
index 15c29c4..e187425 100644
--- a/FS/FS/part_pkg.pm
+++ b/FS/FS/part_pkg.pm
@@ -1089,32 +1089,15 @@ sub can_discount { 0; }
# whether the plan allows changing the start date
sub can_start_date { 1; }
-# the default start date; takes an FS::cust_main as an argument
-sub default_start_date {
+# the delay start date if present
+sub delay_start_date {
my $self = shift;
- my $cust_main = shift;
- my $conf = FS::Conf->new;
- if ( $self->delay_start ) {
- my $delay = $self->delay_start;
+ my $delay = $self->delay_start or return '';
- my ($mday,$mon,$year) = (localtime(time))[3,4,5];
- my $start_date = timelocal(0,0,0,$mday,$mon,$year) + 86400 * $delay;
- return $start_date;
+ my ($mday,$mon,$year) = (localtime(time))[3,4,5];
+ timelocal(0,0,0,$mday,$mon,$year) + 86400 * $delay;
- } elsif ( $conf->exists('order_pkg-no_start_date') ) {
-
- return '';
-
- } elsif ( $cust_main ) {
-
- return $cust_main->next_bill_date;
-
- } else {
-
- return '';
-
- }
}
sub can_currency_exchange { 0; }