1 package FS::part_event::Condition::invoice_has_not_been_sent;
4 use FS::Record qw( qsearchs );
6 use Time::Local 'timelocal';
8 use base qw( FS::part_event::Condition );
11 'Invoice has not been sent previously';
14 sub eventtable_hashref {
22 my($self, $cust_bill, %opt) = @_;
24 ## search actions for invoice send events.
26 "action LIKE 'cust_bill_send%'",
27 "action LIKE 'cust_bill_email%'",
28 "action LIKE 'cust_bill_print%'",
29 "action LIKE 'cust_bill_fsinc_print%'",
31 my $actions = join ' OR ', @send_actions;
32 my $extra_sql = " AND ($actions)";
34 my $event = qsearchs( {
35 'table' => 'cust_event',
36 'addl_from' => 'LEFT JOIN part_event USING ( eventpart )',
38 'tablenum' => $cust_bill->{Hash}->{invnum},
39 'eventtable' => 'cust_bill',
42 'order_by' => " LIMIT 1",
43 'extra_sql' => $extra_sql,