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=8a8bef315e1d9bb6eb6bec4018a478f334e7af2f;hb=8d0e8149e7b19ad8543ac6c8c663be63dbc34762;hpb=32072dbf59a054529f5304574c0f56f9567d14d0 diff --git a/FS/FS/cust_bill_pay_batch.pm b/FS/FS/cust_bill_pay_batch.pm index 8a8bef315..a9d07d3a8 100644 --- a/FS/FS/cust_bill_pay_batch.pm +++ b/FS/FS/cust_bill_pay_batch.pm @@ -2,6 +2,7 @@ package FS::cust_bill_pay_batch; use base qw( FS::Record ); use strict; +use FS::Record qw( dbh ); =head1 NAME @@ -103,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.