[freeside-commits] freeside/FS/FS rate_prefix.pm,1.2,1.3

Ivan,,, ivan at wavetail.420.am
Sun Jan 4 16:26:56 PST 2009


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv7561/FS/FS

Modified Files:
	rate_prefix.pm 
Log Message:
add rate copying, RT#4431

Index: rate_prefix.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/rate_prefix.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- rate_prefix.pm	27 Feb 2005 11:18:45 -0000	1.2
+++ rate_prefix.pm	5 Jan 2009 00:26:54 -0000	1.3
@@ -2,7 +2,7 @@
 
 use strict;
 use vars qw( @ISA );
-use FS::Record qw( qsearch qsearchs );
+use FS::Record qw( qsearch qsearchs dbh );
 use FS::rate_region;
 
 @ISA = qw(FS::Record);
@@ -127,6 +127,27 @@
 
 =back
 
+=head1 CLASS METHODS
+
+=over 4
+
+=item all_countrycodes
+
+Returns a list of all countrycodes listed in rate_prefix
+
+=cut
+
+sub all_countrycodes { 
+  #my $class = shift;
+  my $sql =
+    "SELECT DISTINCT(countrycode) FROM rate_prefix ORDER BY countrycode";
+  my $sth = dbh->prepare($sql) or die  dbh->errstr;
+  $sth->execute                or die $sth->errstr;
+  map $_->[0], @{ $sth->fetchall_arrayref };
+}
+
+=back
+
 =head1 BUGS
 
 =head1 SEE ALSO



More information about the freeside-commits mailing list