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 my $invoice_send_actions = join "', '", (FS::part_event::invoice_send_actions());
25 my $extra_sql = " AND action in ('".$invoice_send_actions."')";
27 my $event = qsearchs( {
28 'table' => 'cust_event',
29 'addl_from' => 'LEFT JOIN part_event USING ( eventpart )',
31 'tablenum' => $cust_bill->{Hash}->{invnum},
32 'eventtable' => 'cust_bill',
35 'order_by' => " LIMIT 1",
36 'extra_sql' => $extra_sql,