[freeside-commits] freeside/FS/FS/part_event Condition.pm,1.6,1.7

Ivan,,, ivan at wavetail.420.am
Sat Sep 18 20:02:12 PDT 2010


Update of /home/cvs/cvsroot/freeside/FS/FS/part_event
In directory wavetail.420.am:/tmp/cvs-serv31158/part_event

Modified Files:
	Condition.pm 
Log Message:
another (hopefully significant) billing optimization, RT#6802

Index: Condition.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_event/Condition.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -d -r1.6 -r1.7
--- Condition.pm	20 Aug 2009 09:55:58 -0000	1.6
+++ Condition.pm	19 Sep 2010 03:02:09 -0000	1.7
@@ -306,6 +306,28 @@
    )";
 }
 
+#c.f. part_event_condition_option.pm / part_event_condition_option_option
+#used for part_event/Condition/payby.pm
+sub condition_sql_option_option {
+  my( $class, $option ) = @_;
+
+  ( 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'
+     )";
+
+  "( SELECT optionname FROM part_event_condition_option_option
+       WHERE optionnum = $optionnum
+   )";
+
+}
+
+
 =item condition_sql_option_age_from OPTION FROM_TIMESTAMP
 
 This is a class method that returns an SQL fragment that will retreive a



More information about the freeside-commits mailing list