[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 163bc5b77d302447d3f1126185af9a798727562e

Ivan ivan at 420.am
Thu Dec 20 02:45:28 PST 2012


The branch, FREESIDE_2_3_BRANCH has been updated
       via  163bc5b77d302447d3f1126185af9a798727562e (commit)
      from  ddc6218aa921664c4a3baa7e0daa81b6fbeaa658 (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 163bc5b77d302447d3f1126185af9a798727562e
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Dec 20 02:45:10 2012 -0800

    use_carrierid now accepts multiple values, RT#20706

diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm
index 08cf4a1..cac5838 100644
--- a/FS/FS/part_pkg/voip_cdr.pm
+++ b/FS/FS/part_pkg/voip_cdr.pm
@@ -144,7 +144,7 @@ tie my %unrateable_opts, 'Tie::IxHash',
                         'type' => 'checkbox',
                       },
 
-    'use_carrierid' => { 'name' => 'Only charge for CDRs where the Carrier ID is set to: ',
+    'use_carrierid' => { 'name' => 'Only charge for CDRs where the Carrier ID is set to any of these (comma-separated) values: ',
                          },
 
     'use_cdrtypenum' => { 'name' => 'Only charge for CDRs where the CDR Type is set to: ',
@@ -923,9 +923,9 @@ sub check_chargable {
     if length($_) && substr($cdr->dst,0,length($_)) eq $_;
   }
 
-  return "carrierid != $opt{'use_carrierid'}"
-    if length($opt{'use_carrierid'})
-    && $cdr->carrierid ne $opt{'use_carrierid'} #ne otherwise 0 matches ''
+  return "carrierid NOT IN ( $opt{'use_carrierid'} )"
+    if $opt{'use_carrierid'} =~ /\S/
+    && !grep { $cdr->carrierid eq $_ } split(/\s*,\s*/, $opt{'use_carrierid'}) #eq otherwise 0 matches ''
     && ! $flags{'da_rewrote'};
 
   # unlike everything else, use_cdrtypenum is applied in FS::svc_x::get_cdrs.

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

Summary of changes:
 FS/FS/part_pkg/voip_cdr.pm |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list