RT# 37817 - added a declaration to cust bill event actions that send out invoices
[freeside.git] / FS / FS / part_event / Condition / invoice_has_not_been_sent.pm
index 4868f66..df78bf7 100644 (file)
@@ -21,15 +21,8 @@ sub eventtable_hashref {
 sub condition {
   my($self, $cust_bill, %opt) = @_;
 
-  ## search actions for invoice send events.
-  my @send_actions = (
-    "action LIKE 'cust_bill_send%'",
-    "action LIKE 'cust_bill_email%'",
-    "action LIKE 'cust_bill_print%'",
-    "action LIKE 'cust_bill_fsinc_print%'",
-  );
-  my $actions = join ' OR ', @send_actions;
-  my $extra_sql = " AND ($actions)";
+  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',