RT# 37817 - added a declaration to cust bill event actions that send out invoices
[freeside.git] / FS / FS / part_event / Action / cust_bill_send_reminder.pm
1 package FS::part_event::Action::cust_bill_send_reminder;
2
3 use strict;
4 use base qw( FS::part_event::Action );
5
6 sub description { 'Send invoice (email/print/fax) reminder'; }
7
8 ## declaring that this action will send out an invoice
9 sub will_send_invoice { 1; }
10
11 sub eventtable_hashref {
12   { 'cust_bill' => 1 };
13 }
14
15 sub option_fields {
16   (
17     'modenum' => {  label => 'Invoice mode',
18                     type  => 'select-invoice_mode',
19                  },
20     # totally unnecessary, since the invoice mode can set notice_name and lpr,
21     # but for compatibility...
22     'notice_name' => 'Reminder name',
23     #'notes'      => { 'label' => 'Reminder notes' },  # invoice mode does this
24     'lpr'         => 'Optional alternate print command',
25   );
26 }
27
28 sub default_weight { 50; }
29
30 sub do_action {
31   my( $self, $cust_bill ) = @_;
32
33   $cust_bill->set('mode' => $self->option('modenum'));
34   $cust_bill->send({
35     'notice_name' => $self->option('notice_name'),
36     'lpr'         => $self->option('lpr'),
37   });
38 }
39
40 1;