[freeside-commits] freeside/FS/FS cust_pkg.pm, 1.139.2.11, 1.139.2.12
Ivan,,,
ivan at wavetail.420.am
Tue Mar 9 22:53:01 PST 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv32418
Modified Files:
Tag: FREESIDE_1_9_BRANCH
cust_pkg.pm
Log Message:
oops, move start_1st and expire_months handling from check to insert, so it doesn't get triggered on edit, RT#7347
Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.139.2.11
retrieving revision 1.139.2.12
diff -u -w -d -r1.139.2.11 -r1.139.2.12
--- cust_pkg.pm 9 Mar 2010 02:43:40 -0000 1.139.2.11
+++ cust_pkg.pm 10 Mar 2010 06:52:59 -0000 1.139.2.12
@@ -251,6 +251,26 @@
sub insert {
my( $self, %options ) = @_;
+ if ( $self->part_pkg->option('start_1st') && !$self->start_date ) {
+ my ($sec,$min,$hour,$mday,$mon,$year) = (localtime(time) )[0,1,2,3,4,5];
+ $mon += 1 unless $mday == 1;
+ until ( $mon < 12 ) { $mon -= 12; $year++; }
+ $self->start_date( timelocal_nocheck(0,0,0,1,$mon,$year) );
+ }
+
+ my $expire_months = $self->part_pkg->option('expire_months');
+ if ( $expire_months && !$self->expire ) {
+ my $start = $self->start_date || $self->setup || time;
+
+ #false laziness w/part_pkg::add_freq
+ my ($sec,$min,$hour,$mday,$mon,$year) = (localtime($start) )[0,1,2,3,4,5];
+ $mon += $expire_months;
+ until ( $mon < 12 ) { $mon -= 12; $year++; }
+
+ #$self->expire( timelocal_nocheck($sec,$min,$hour,$mday,$mon,$year) );
+ $self->expire( timelocal_nocheck(0,0,0,$mday,$mon,$year) );
+ }
+
local $SIG{HUP} = 'IGNORE';
local $SIG{INT} = 'IGNORE';
local $SIG{QUIT} = 'IGNORE';
@@ -530,26 +550,6 @@
}
- if ( $self->part_pkg->option('start_1st') && !$self->start_date ) {
- my ($sec,$min,$hour,$mday,$mon,$year) = (localtime(time) )[0,1,2,3,4,5];
- $mon += 1 unless $mday == 1;
- until ( $mon < 12 ) { $mon -= 12; $year++; }
- $self->start_date( timelocal_nocheck(0,0,0,1,$mon,$year) );
- }
-
- my $expire_months = $self->part_pkg->option('expire_months');
- if ( $expire_months && !$self->expire ) {
- my $start = $self->start_date || $self->setup || time;
-
- #false laziness w/part_pkg::add_freq
- my ($sec,$min,$hour,$mday,$mon,$year) = (localtime($start) )[0,1,2,3,4,5];
- $mon += $expire_months;
- until ( $mon < 12 ) { $mon -= 12; $year++; }
-
- #$self->expire( timelocal_nocheck($sec,$min,$hour,$mday,$mon,$year) );
- $self->expire( timelocal_nocheck(0,0,0,$mday,$mon,$year) );
- }
-
$self->otaker(getotaker) unless $self->otaker;
$self->otaker =~ /^(\w{1,32})$/ or return "Illegal otaker";
$self->otaker($1);
More information about the freeside-commits
mailing list