sqlradacct hour update
[freeside.git] / FS / bin / freeside-daily
index 22bf2c9..17ee798 100755 (executable)
@@ -30,7 +30,7 @@ foreach $cust_main ( @cust_main ) {
 
   # $^T not $time because -d is for pre-printing invoices
   foreach my $cust_pkg (
-    grep { $_->expire && $_->expire >= $^T } $cust_main->ncancelled_pkgs
+    grep { $_->expire && $_->expire <= $^T } $cust_main->ncancelled_pkgs
   ) {
     my $error = $cust_pkg->cancel;
     warn "Error cancelling expired pkg ". $cust_pkg->pkgnum. " for custnum ".
@@ -50,6 +50,7 @@ foreach $cust_main ( @cust_main ) {
 }
 
 if ( driver_name eq 'Pg' ) {
+  dbh->{AutoCommit} = 1; #so we can vacuum
   foreach my $statement ( 'vacuum', 'vacuum analyze' ) {
     my $sth = dbh->prepare($statement) or die dbh->errstr;
     $sth->execute or die $sth->errstr;