354f969d4cfcd4ca7f7233bbc9fd5def47abd55b
[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 sub eventtable_hashref {
9   { 'cust_bill' => 1 };
10 }
11
12 sub option_fields {
13   (
14     'modenum' => {  label => 'Invoice mode',
15                     type  => 'select-invoice_mode',
16                  },
17     # totally unnecessary, since the invoice mode can set notice_name and lpr,
18     # but for compatibility...
19     'notice_name' => 'Reminder name',
20     #'notes'      => { 'label' => 'Reminder notes' },  # invoice mode does this
21     'lpr'         => 'Optional alternate print command',
22   );
23 }
24
25 sub default_weight { 50; }
26
27 sub do_action {
28   my( $self, $cust_bill ) = @_;
29
30   $cust_bill->set('mode' => $self->option('modenum'));
31   $cust_bill->send({
32     'notice_name' => $self->option('notice_name'),
33     'lpr'         => $self->option('lpr'),
34   });
35 }
36
37 1;