[freeside-commits] freeside/FS/FS cust_pkg.pm,1.179.2.3,1.179.2.4

Mark Wells mark at wavetail.420.am
Tue Dec 7 16:36:29 PST 2010


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv20065/FS/FS

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	cust_pkg.pm 
Log Message:
fix incorrect bill dates from prorate, RT#10830

Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.179.2.3
retrieving revision 1.179.2.4
diff -u -w -d -r1.179.2.3 -r1.179.2.4
--- cust_pkg.pm	7 Dec 2010 22:26:59 -0000	1.179.2.3
+++ cust_pkg.pm	8 Dec 2010 00:36:27 -0000	1.179.2.4
@@ -3329,10 +3329,22 @@
 sub _upgrade_data {  # class method
   my ($class, %opts) = @_;
   $class->_upgrade_otaker(%opts);
-  my $sql =('UPDATE cust_pkg SET contract_end = NULL WHERE contract_end = -1');
+  my @statements = (
+    # RT#10139, bug resulting in contract_end being set when it shouldn't
+  'UPDATE cust_pkg SET contract_end = NULL WHERE contract_end = -1',
+    # RT#10830, bad calculation of prorate date near end of year
+    # the date range for bill is December 2009, and we move it forward
+    # one year if it's before the previous bill date (which it should 
+    # never be)
+  'UPDATE cust_pkg SET bill = bill + (365*24*60*60) WHERE bill < last_bill
+  AND bill > 1259654400 AND bill < 1262332800 AND (SELECT plan FROM part_pkg 
+  WHERE part_pkg.pkgpart = cust_pkg.pkgpart) = \'prorate\'',
+  );
+  foreach my $sql (@statements) {
   my $sth = dbh->prepare($sql);
   $sth->execute or die $sth->errstr;
 }
+}
 
 =back
 



More information about the freeside-commits mailing list