X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_event%2FCondition%2Fonce_percust.pm;h=2773ca0204dc1294e9a4889af949ebf0fed9ba66;hb=d5988a9f7a3617de33da3058f2e9f1151b24420e;hp=67767f91b5b447773d0cec21273aa547ed62379a;hpb=f3e0ac2b009c4edd5692cb587ff709dac2223ebe;p=freeside.git diff --git a/FS/FS/part_event/Condition/once_percust.pm b/FS/FS/part_event/Condition/once_percust.pm index 67767f91b..2773ca020 100644 --- a/FS/FS/part_event/Condition/once_percust.pm +++ b/FS/FS/part_event/Condition/once_percust.pm @@ -52,13 +52,13 @@ sub condition_sql { my $pkey = $pkey{$table}; - "0 = ( SELECT COUNT(*) FROM cust_event - WHERE cust_event.eventpart = part_event.eventpart - AND cust_event.tablenum IN ( - SELECT $pkey FROM $table AS once_percust - WHERE once_percust.custnum = cust_main.custnum ) - AND status != 'failed' - ) + "NOT EXISTS ( SELECT 1 FROM cust_event + WHERE cust_event.eventpart = part_event.eventpart + AND cust_event.tablenum IN ( + SELECT $pkey FROM $table AS once_percust + WHERE once_percust.custnum = cust_main.custnum ) + AND status != 'failed' + ) "; }