X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fpart_event%2FCondition%2Finvoice_has_not_been_sent.pm;h=df78bf7286197d194d2bc4365ee766b6e97d126a;hb=39fe6499bd38e6e7c468f549b1d4919a7cf2c44d;hp=882762dfe95fb1b8fc80c4c2062ef58c367a7d78;hpb=d5988a9f7a3617de33da3058f2e9f1151b24420e;p=freeside.git diff --git a/FS/FS/part_event/Condition/invoice_has_not_been_sent.pm b/FS/FS/part_event/Condition/invoice_has_not_been_sent.pm index 882762dfe..df78bf728 100644 --- a/FS/FS/part_event/Condition/invoice_has_not_been_sent.pm +++ b/FS/FS/part_event/Condition/invoice_has_not_been_sent.pm @@ -21,15 +21,19 @@ sub eventtable_hashref { sub condition { my($self, $cust_bill, %opt) = @_; + my $invoice_send_actions = join "', '", (FS::part_event::invoice_send_actions()); + my $extra_sql = " AND action in ('".$invoice_send_actions."')"; + my $event = qsearchs( { 'table' => 'cust_event', 'addl_from' => 'LEFT JOIN part_event USING ( eventpart )', 'hashref' => { - 'tablenum' => $cust_bill->{Hash}->{invnum}, - 'eventtable' => 'cust_bill', - 'status' => 'done', - }, + 'tablenum' => $cust_bill->{Hash}->{invnum}, + 'eventtable' => 'cust_bill', + 'status' => 'done', + }, 'order_by' => " LIMIT 1", + 'extra_sql' => $extra_sql, } ); return 0 if $event;