X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_bill_pay_batch.pm;h=a9d07d3a8fcf0d7d6bca803cc6a958279c6de3fd;hp=30fb74432168cde9adad76597de38f2aa13ecaea;hb=8d0e8149e7b19ad8543ac6c8c663be63dbc34762;hpb=5e05724a635a22776f1b973f5d7e77989da4e048 diff --git a/FS/FS/cust_bill_pay_batch.pm b/FS/FS/cust_bill_pay_batch.pm index 30fb74432..a9d07d3a8 100644 --- a/FS/FS/cust_bill_pay_batch.pm +++ b/FS/FS/cust_bill_pay_batch.pm @@ -1,10 +1,8 @@ package FS::cust_bill_pay_batch; +use base qw( FS::Record ); use strict; -use vars qw( @ISA ); -use FS::Record qw( qsearch qsearchs ); - -@ISA = qw(FS::Record); +use FS::Record qw( dbh ); =head1 NAME @@ -106,6 +104,24 @@ sub check { =back +=cut + + +sub _upgrade_schema { + my ($class, %opts) = @_; + + my $sql = ' + DELETE FROM cust_bill_pay_batch WHERE NOT EXISTS + ( SELECT 1 FROM cust_pay_batch WHERE cust_pay_batch.paybatchnum = cust_bill_pay_batch.paybatchnum ) + '; + + my $sth = dbh->prepare($sql) or die dbh->errstr; + $sth->execute or die $sth->errstr; + ''; + +} + + =head1 BUGS Just hangs there.