RT# 37817 - Updated to set condition to check for invoice sending action
authorChristopher Burger <burgerc@freeside.biz>
Fri, 4 Jan 2019 16:41:34 +0000 (11:41 -0500)
committerChristopher Burger <burgerc@freeside.biz>
Sun, 6 Jan 2019 17:42:30 +0000 (12:42 -0500)
FS/FS/part_event/Condition/invoice_has_not_been_sent.pm

index 882762d..f80508a 100644 (file)
@@ -21,15 +21,19 @@ sub eventtable_hashref {
 sub condition {
   my($self, $cust_bill, %opt) = @_;
 
+  ## search actions for invoice send events.
+  my $extra_sql = " AND (action LIKE 'cust_bill_send%' OR action LIKE 'cust_bill_email%')";
+
   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;