event refactor, landing on HEAD!
[freeside.git] / FS / FS / part_event / Action / cust_bill_send_alternate.pm
1 package FS::part_event::Action::cust_bill_send_alternate;
2
3 use strict;
4 use base qw( FS::part_event::Action );
5
6 sub description {
7   'Send invoice (email/print/fax) with alternate template';
8 }
9
10 sub eventtable_hashref {
11   { 'cust_bill' => 1 };
12 }
13
14 sub option_fields {
15   (
16     'templatename' => { label    => 'Template',
17                         type     => 'select-invoice_template',
18                       },
19   );
20 }
21
22 sub default_weight {
23   50;
24 }
25
26 sub do_action {
27   my( $self, $cust_bill ) = @_;
28
29   #my $cust_main = $self->cust_main($cust_bill);
30   my $cust_main = $cust_bill->cust_main;
31
32   $cust_bill->send( $self->option('templatename') );
33 }
34
35 1;