[freeside-commits] branch master updated. be4541cfd9ed7c985ffe1b3ef3a38be0e19460d9

Ivan ivan at 420.am
Tue Mar 20 16:38:10 PDT 2012


The branch, master has been updated
       via  be4541cfd9ed7c985ffe1b3ef3a38be0e19460d9 (commit)
      from  c6e2c0a41e2195ff3907c447eb52409b03d04273 (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 be4541cfd9ed7c985ffe1b3ef3a38be0e19460d9
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Mar 20 16:37:45 2012 -0700

    fix multiple services w/cust_bill_has_service condition, RT#17035

diff --git a/FS/FS/part_event/Condition.pm b/FS/FS/part_event/Condition.pm
index b969cf6..3275197 100644
--- a/FS/FS/part_event/Condition.pm
+++ b/FS/FS/part_event/Condition.pm
@@ -355,11 +355,35 @@ sub condition_sql_option_option {
      )";
 
   "( SELECT optionname FROM part_event_condition_option_option
-       WHERE optionnum = $optionnum
+       WHERE optionnum IN $optionnum
    )";
 
 }
 
+#used for part_event/Condition/cust_bill_has_service.pm
+#a little false laziness w/above and condition_sql_option_integer
+sub condition_sql_option_option_integer {
+  my( $class, $option, $driver_name ) = @_;
+
+  ( my $condname = $class ) =~ s/^.*:://;
+
+  my $optionnum = 
+    "( SELECT optionnum FROM part_event_condition_option
+        WHERE part_event_condition_option.eventconditionnum =
+              cond_$condname.eventconditionnum
+          AND part_event_condition_option.optionname  = '$option'
+          AND part_event_condition_option.optionvalue = 'HASH'
+     )";
+
+  my $integer = ($driver_name =~ /^mysql/) ? 'UNSIGNED INTEGER' : 'INTEGER';
+
+  my $optionname = "CAST(optionname AS $integer)";
+
+  "( SELECT $optionname FROM part_event_condition_option_option
+       WHERE optionnum IN $optionnum
+   )";
+
+}
 
 =item condition_sql_option_age_from OPTION FROM_TIMESTAMP
 

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

Summary of changes:
 FS/FS/part_event/Condition.pm |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)




More information about the freeside-commits mailing list