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;