fix dev operation @ localhost, RT#13852
[freeside.git] / FS / FS / part_event / Action / cust_bill_spool_csv.pm
1 package FS::part_event::Action::cust_bill_spool_csv;
2
3 use strict;
4 use base qw( FS::part_event::Action );
5
6 sub description { 'Spool CSV invoice data'; }
7
8 sub deprecated { 1; }
9
10 sub eventtable_hashref {
11   { 'cust_bill' => 1 };
12 }
13
14 sub option_fields {
15   (
16     'spoolformat'       => { label   => 'Format',
17                              type    => 'select',
18                              options => ['default', 'billco'],
19                              option_labels => { 'default' => 'Default',
20                                                 'billco'  => 'Billco',
21                                               },
22                            },
23     'spoolbalanceover'  => { label =>
24                                'If balance (this invoice and previous) over',
25                              type  => 'money',
26                            },
27     'spoolagent_spools' => { label => 'Individual per-agent spools',
28                              type  => 'checkbox',
29                              value => '1',
30                            },
31   );
32 }
33
34 sub default_weight { 50; }
35
36 sub do_action {
37   my( $self, $cust_bill ) = @_;
38
39   #my $cust_main = $self->cust_main($cust_bill);
40   my $cust_main = $cust_bill->cust_main;
41
42   $cust_bill->spool_csv(
43     'format'       => $self->option('spoolformat'),
44     'balanceover'  => $self->option('spoolbalanceover'),
45     'agent_spools' => $self->option('spoolagent_spools'),
46   );
47 }
48
49 1;