[freeside-commits] branch master updated. 9ab7745327a6e244ddd25fe8178532a4161fa722

Jonathan Prykop jonathan at 420.am
Thu Jan 29 18:40:22 PST 2015


The branch, master has been updated
       via  9ab7745327a6e244ddd25fe8178532a4161fa722 (commit)
       via  69d3ce315e8d44adef35eb32f805ceaa9b91598c (commit)
      from  f79a7ca7e5b3e484646190e15f995b9779089ff0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9ab7745327a6e244ddd25fe8178532a4161fa722
Merge: 69d3ce3 f79a7ca
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Thu Jan 29 20:38:40 2015 -0600

    Merge branch 'master' of git.freeside.biz:/home/git/freeside


f79a7ca7e5b3e484646190e15f995b9779089ff0

commit 69d3ce315e8d44adef35eb32f805ceaa9b91598c
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Thu Jan 29 20:38:23 2015 -0600

    RT#15413 (Duplicate rating prefixes)

diff --git a/httemplate/browse/rate_region.html b/httemplate/browse/rate_region.html
index 962841d..bbe2136 100644
--- a/httemplate/browse/rate_region.html
+++ b/httemplate/browse/rate_region.html
@@ -40,7 +40,7 @@ if ( driver_name =~ /^Pg/ ) {
                    "   THEN npa ".
                    "   ELSE npa || '-' || nxx ".
                    " END";
-  my $prefixes_sql = "SELECT $prefix_sql $fromwhere AND npa IS NOT NULL";
+  my $prefixes_sql = "SELECT $prefix_sql $fromwhere AND npa IS NOT NULL ORDER BY npa";
   $select .= "( SELECT '+'||countrycode $fromwhere LIMIT 1 ) AS ccode, 
               ARRAY_TO_STRING( ARRAY($prefixes_sql), ', ' ) AS prefixes";
 } elsif ( driver_name =~ /^mysql/i ) {
diff --git a/httemplate/edit/process/rate_region.cgi b/httemplate/edit/process/rate_region.cgi
index 87d634a..1b27102 100755
--- a/httemplate/edit/process/rate_region.cgi
+++ b/httemplate/edit/process/rate_region.cgi
@@ -25,6 +25,8 @@ my $new = new FS::rate_region ( {
 
 my $countrycode = $cgi->param('countrycode');
 my @npa = split(/\s*,\s*/, $cgi->param('npa'));
+my %npa = map { $_, 1 } @npa; #removing duplicates
+ at npa = sort keys %npa;
 $npa[0] = '' unless @npa;
 my @rate_prefix = map {
                         #my($npa,$nxx) = split('-', $_);

f79a7ca7e5b3e484646190e15f995b9779089ff0

-----------------------------------------------------------------------

Summary of changes:
 httemplate/browse/rate_region.html      |    2 +-
 httemplate/edit/process/rate_region.cgi |    2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list