projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b18cc96
)
clean up any stray/old cust_pay_pending records causing problems
author
ivan
<ivan>
Fri, 30 May 2008 00:53:04 +0000
(
00:53
+0000)
committer
ivan
<ivan>
Fri, 30 May 2008 00:53:04 +0000
(
00:53
+0000)
FS/FS/Upgrade.pm
patch
|
blob
|
history
FS/FS/cust_pay_pending.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Upgrade.pm
b/FS/FS/Upgrade.pm
index
5c873bf
..
8f3a6e5
100644
(file)
--- a/
FS/FS/Upgrade.pm
+++ b/
FS/FS/Upgrade.pm
@@
-100,6
+100,9
@@
sub upgrade_data {
#populate part_pkg_taxclass for starters
'part_pkg_taxclass' => [],
#populate part_pkg_taxclass for starters
'part_pkg_taxclass' => [],
+ #remove bad pending records
+ 'cust_pay_pending' => [],
+
;
\%hash;
;
\%hash;
diff --git
a/FS/FS/cust_pay_pending.pm
b/FS/FS/cust_pay_pending.pm
index
ad39b10
..
e5d01c0
100644
(file)
--- a/
FS/FS/cust_pay_pending.pm
+++ b/
FS/FS/cust_pay_pending.pm
@@
-215,6
+215,21
@@
sub check {
$self->SUPER::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
=back
=head1 BUGS