X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_event%2FCondition%2Finvoice_has_not_been_sent.pm;h=df78bf7286197d194d2bc4365ee766b6e97d126a;hb=690d877102bcbddb20806995c549ed35b7b36647;hp=882762dfe95fb1b8fc80c4c2062ef58c367a7d78;hpb=6981e02e3ba3c08a39faffd09f4a93d680b916ee;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;