[freeside-commits] branch master updated. 29620c88292178979a0ebf1827caf14b3d471536

Mark Wells mark at 420.am
Thu Aug 7 14:03:58 PDT 2014


The branch, master has been updated
       via  29620c88292178979a0ebf1827caf14b3d471536 (commit)
      from  2feeba5b4b1abee57667bbe6be5e9daf24d5a447 (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 29620c88292178979a0ebf1827caf14b3d471536
Author: Mark Wells <mark at freeside.biz>
Date:   Thu Aug 7 14:03:32 2014 -0700

    minor bugfixes, #24047

diff --git a/FS/FS/Report/FCC_477.pm b/FS/FS/Report/FCC_477.pm
index 0f3dfb1..599b9e0 100644
--- a/FS/FS/Report/FCC_477.pm
+++ b/FS/FS/Report/FCC_477.pm
@@ -247,6 +247,17 @@ sub join_optionname_int {
     " ON (part_pkg.pkgpart = t_$name.pkgpart)";
 }
 
+sub dbaname {
+  # Returns an sql expression for the DBA name
+  "COALESCE( deploy_zone.dbaname,
+     (SELECT value FROM conf WHERE conf.name = 'company_name'
+                             AND (conf.agentnum = deploy_zone.agentnum
+                                  OR conf.agentnum IS NULL)
+                             ORDER BY conf.agentnum IS NOT NULL DESC
+                             LIMIT 1)
+     ) AS dbaname"
+}
+
 sub active_on {
   # Returns a condition to limit packages to those that were setup before a 
   # certain date, and not canceled before that date.
@@ -299,7 +310,7 @@ sub fbd_sql {
 
   my @select = (
     'censusblock',
-    'COALESCE(dbaname, agent.agent)',
+    dbaname(),
     'technology',
     'CASE WHEN is_consumer IS NOT NULL THEN 1 ELSE 0 END',
     'adv_speed_down',
@@ -319,7 +330,7 @@ sub fbd_sql {
   );
   push @where, "agentnum = $agentnum" if $agentnum;
 
-  my $order_by = 'censusblock, dbaname, technology, is_consumer, is_business';
+  my $order_by = 'censusblock, agentnum, technology, is_consumer, is_business';
 
   "SELECT ".join(', ', @select) . "
   FROM $from
diff --git a/bin/convert-477-options b/bin/convert-477-options
index 99a6ea5..8225a22 100755
--- a/bin/convert-477-options
+++ b/bin/convert-477-options
@@ -129,7 +129,7 @@ for my $part_pkg (qsearch('part_pkg', { freq => {op => '!=', value => '0'}})) {
 
   my %fcc_opts = @fcc_opts;
   #print map {"\t$_\t".$fcc_opts{$_}."\n"} keys %fcc_opts;
-  my $error = $part_pkg->process_fcc_options(\%fcc_opts);
+  my $error = $part_pkg->set_fcc_options(\%fcc_opts);
   if ( $error ) {
     die "$error\n";
   }

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

Summary of changes:
 FS/FS/Report/FCC_477.pm |   15 +++++++++++++--
 bin/convert-477-options |    2 +-
 2 files changed, 14 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list