summaryrefslogtreecommitdiff
path: root/FS/FS/phone_avail.pm
diff options
context:
space:
mode:
authorlevinse <levinse>2011-01-11 15:49:12 +0000
committerlevinse <levinse>2011-01-11 15:49:12 +0000
commit66102a014ef61f1873c2bb6fc2374cab7793134c (patch)
tree228781550069177c0ecc6afe3844c2794a9e5b18 /FS/FS/phone_avail.pm
parent7934ac2de21debc15ce89405ed0f4c061c4f0236 (diff)
Vitelity DID selection improvements, RT4868
Diffstat (limited to 'FS/FS/phone_avail.pm')
-rw-r--r--FS/FS/phone_avail.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/FS/FS/phone_avail.pm b/FS/FS/phone_avail.pm
index 92286ab..677195d 100644
--- a/FS/FS/phone_avail.pm
+++ b/FS/FS/phone_avail.pm
@@ -195,6 +195,21 @@ sub process_batch_import {
}
+sub flush { # evil direct SQL
+ my $opt = shift;
+
+ if ( $opt->{'ratecenter'} =~ /^[\w\s]+$/
+ && $opt->{'state'} =~ /^[A-Z][A-Z]$/
+ && $opt->{'exportnum'} =~ /^\d+$/) {
+ my $sth = dbh->prepare('delete from phone_avail where exportnum = ? '.
+ ' and state = ? and name = ?');
+ $sth->execute($opt->{'exportnum'},$opt->{'state'},$opt->{'ratecenter'})
+ or die $sth->errstr;
+ }
+
+ '';
+}
+
# Used by FS::Upgrade to migrate to a new database.
sub _upgrade_data {
my ($class, %opts) = @_;