X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_pay_pending.pm;h=7469720f483590647f9e058281aa869ea41f7bdc;hb=106d0163556c31a3b2cf9c065ec6d9d6ded0ce64;hp=ad39b10d79e3b14bb41b7e42948bf567d79607a0;hpb=c648976f0b7975f2328ebd7ba8c711fad0ca4195;p=freeside.git diff --git a/FS/FS/cust_pay_pending.pm b/FS/FS/cust_pay_pending.pm index ad39b10d7..7469720f4 100644 --- a/FS/FS/cust_pay_pending.pm +++ b/FS/FS/cust_pay_pending.pm @@ -2,7 +2,7 @@ package FS::cust_pay_pending; use strict; use vars qw( @ISA @encrypted_fields ); -use FS::Record qw( qsearch qsearchs ); +use FS::Record qw( qsearch qsearchs dbh ); #dbh for _upgrade_data use FS::payby; use FS::payinfo_Mixin; use FS::cust_main; @@ -215,6 +215,21 @@ sub check { $self->SUPER::check; } +# _upgrade_data +# +# Used by FS::Upgrade to migrate to a new database. + +sub _upgrade_data { #class method + my ($class, %opts) = @_; + + my $sql = + "DELETE FROM cust_pay_pending WHERE status = 'new' AND _date < ".(time-600); + + my $sth = dbh->prepare($sql) or die dbh->errstr; + $sth->execute or die $sth->errstr; + +} + =back =head1 BUGS