diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2013-06-05 13:26:18 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2013-06-05 13:26:18 -0700 |
| commit | 77222877e31c59d9e9b45efb0655bc57d6448bb5 (patch) | |
| tree | 7552fd0675a2b1d9330f38de0d3f49d9c4ec2bd3 /FS | |
| parent | d32f4c43b0fde5c18b8c2ee8f3d4cb9c6861a403 (diff) | |
fix intro periods getting re-added on package change when delay_setup is on, RT#23440
Diffstat (limited to 'FS')
| -rw-r--r-- | FS/FS/cust_pkg.pm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index 95b39ba4c..cc3eb7107 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -242,7 +242,8 @@ The following options are available: =item change -If set true, supresses any referral credit to a referring customer. +If set true, supresses actions that should only be taken for new package +orders. (Currently this includes: intro periods when delay_setup is on.) =item options @@ -283,8 +284,12 @@ sub insert { } } - my $free_days = $part_pkg->option('free_days',1); - if ( $free_days && $part_pkg->option('delay_setup',1) ) { #&& !$self->start_date + if ( ! $options{'change'} + && ( my $free_days = $part_pkg->option('free_days',1) ) + && $part_pkg->option('delay_setup',1) + #&& ! $self->start_date + ) + { my ($mday,$mon,$year) = (localtime(time) )[3,4,5]; #my $start_date = ($self->start_date || timelocal(0,0,0,$mday,$mon,$year)) + 86400 * $free_days; my $start_date = timelocal(0,0,0,$mday,$mon,$year) + 86400 * $free_days; |
