[freeside-commits] branch FREESIDE_4_BRANCH updated. 8984b12a616569e3bd467728f5db45b38c6e5609

Mitch Jackson mitch at freeside.biz
Sat May 26 12:44:23 PDT 2018


The branch, FREESIDE_4_BRANCH has been updated
       via  8984b12a616569e3bd467728f5db45b38c6e5609 (commit)
       via  281b8770237d7686cbf19634fc3f4b0c42a6944e (commit)
      from  5af5a63aac322198361ebb0c1e2dd68ae8ed47c8 (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 8984b12a616569e3bd467728f5db45b38c6e5609
Author: Mitch Jackson <mitch at freeside.biz>
Date:   Mon Feb 19 23:07:11 2018 -0600

    RT# 79549 Requre a Rate Plan to use voip_cdr Price Plan

diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm
index 1fb3bec84..587a8c530 100644
--- a/FS/FS/part_pkg/voip_cdr.pm
+++ b/FS/FS/part_pkg/voip_cdr.pm
@@ -363,8 +363,8 @@ tie my %accountcode_tollfree_field, 'Tie::IxHash',
   'validate' => sub {
     # Validation function for FS::part_pkg::check_options()
     my $options = shift;
-    return "Please select a rate plan for price plan VoIP/telco CDR rating (standard)"
-      unless $options->{ratenum};
+    return "Please choose a Rate Plan for use with selected Rating Method"
+      if $options->{rating_method} eq 'prefix' &&  !$options->{ratenum};
     return;
   },
 );

commit 281b8770237d7686cbf19634fc3f4b0c42a6944e
Author: Mitch Jackson <mitch at freeside.biz>
Date:   Fri Feb 16 18:13:27 2018 -0600

    RT# 79549 Requre a Rate Plan to use voip_cdr Price Plan

diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm
index 4492c4023..c08820518 100644
--- a/FS/FS/part_pkg.pm
+++ b/FS/FS/part_pkg.pm
@@ -786,11 +786,17 @@ sub check {
 
 =item check_options
 
-For a passed I<$options> hashref, validates any options that
-have 'validate' subroutines defined in the info hash, 
-then validates the entire hashref if the price plan has 
-its own 'validate' subroutine defined in the info hash 
-(I<$options> values might be altered.)  
+Pass an I<$options> hashref that contains the values to be
+inserted or updated for any FS::part_pkg::MODULE.pm.
+
+For each key in I<$options>, validates the value by calling
+the 'validate' subroutine defined for that option e.g.
+FS::part_pkg::MODULE::plan_info()->{$KEY}->{validate}.  The
+option validation function is only called when the hashkey for
+that option exists in I<$options>.
+
+Then the module validation function is called, from
+FS::part_pkg::MODULE::plan_info()->{validate}
 
 Returns error message, or empty string if valid.
 
@@ -2596,4 +2602,3 @@ schema.html from the base documentation.
 =cut
 
 1;
-
diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm
index 8085c1995..1fb3bec84 100644
--- a/FS/FS/part_pkg/voip_cdr.pm
+++ b/FS/FS/part_pkg/voip_cdr.pm
@@ -360,6 +360,13 @@ tie my %accountcode_tollfree_field, 'Tie::IxHash',
                      )
                   ],
   'weight' => 41,
+  'validate' => sub {
+    # Validation function for FS::part_pkg::check_options()
+    my $options = shift;
+    return "Please select a rate plan for price plan VoIP/telco CDR rating (standard)"
+      unless $options->{ratenum};
+    return;
+  },
 );
 
 sub price_info {
@@ -724,4 +731,3 @@ sub hide_svc_detail {
 
 
 1;
-

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

Summary of changes:
 FS/FS/part_pkg.pm          | 17 +++++++++++------
 FS/FS/part_pkg/voip_cdr.pm |  8 +++++++-
 2 files changed, 18 insertions(+), 7 deletions(-)




More information about the freeside-commits mailing list