[freeside-commits] freeside/FS/FS/part_event/Condition once.pm, 1.2, 1.3

Ivan,,, ivan at wavetail.420.am
Mon Oct 1 17:19:01 PDT 2007


Update of /home/cvs/cvsroot/freeside/FS/FS/part_event/Condition
In directory wavetail:/tmp/cvs-serv18153/part_event/Condition

Modified Files:
	once.pm 
Log Message:
proper fix for once.pm bug?  hopefully it works :)

Index: once.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_event/Condition/once.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- once.pm	26 Sep 2007 19:24:40 -0000	1.2
+++ once.pm	2 Oct 2007 00:18:59 -0000	1.3
@@ -16,7 +16,7 @@
 }
 
 sub condition {
-  my($self, $object) = @_;
+  my($self, $object, %opt) = @_;
 
   my $obj_pkey = $object->primary_key;
   my $tablenum = $object->$obj_pkey();
@@ -24,7 +24,12 @@
   my @existing = qsearch( 'cust_event', {
     'eventpart' => $self->eventpart,
     'tablenum'  => $tablenum,
-    'status'    => { op=>'NOT IN', value=>"('failed','new')" },
+    #'status'    => { op=>'NOT IN', value=>"('failed','new')" },
+    'status'    => { op=>'!=', value=>'failed' },
+    'addl_sql'  => ( $opt{'cust_event'}->eventnum =~ /^(\d+)$/
+                       ? " AND eventnum != $1 "
+                       : ''
+                   ),
   } );
 
   ! scalar(@existing);



More information about the freeside-commits mailing list