X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_event%2FCondition%2Fonce.pm;h=f1645828b6bfa84dd1be5f449d56555ffecc1733;hp=d004814ffb33da8ed0600603c1843d996f37220d;hb=2322f0123062b8cf2f52aed0a63bb4634cdbaef1;hpb=a0f5ae295297e1b17ab89640346fc06cfb1e5892 diff --git a/FS/FS/part_event/Condition/once.pm b/FS/FS/part_event/Condition/once.pm index d004814ff..f1645828b 100644 --- a/FS/FS/part_event/Condition/once.pm +++ b/FS/FS/part_event/Condition/once.pm @@ -43,11 +43,12 @@ sub condition_sql { my %tablenum = %{ FS::part_event->eventtable_pkey_sql }; - "0 = ( SELECT COUNT(*) FROM cust_event - WHERE cust_event.eventpart = part_event.eventpart - AND cust_event.tablenum = $tablenum{$table} - AND status != 'failed' - ) + "NOT EXISTS ( SELECT 1 FROM cust_event + WHERE cust_event.eventpart = part_event.eventpart + AND cust_event.tablenum = $tablenum{$table} + AND status != 'failed' + LIMIT 1 + ) "; }