This commit was generated by cvs2svn to compensate for changes in r11022,
[freeside.git] / FS / FS / part_event / Action / cust_bill_send_csv_ftp.pm
1 package FS::part_event::Action::cust_bill_send_csv_ftp;
2
3 use strict;
4 use base qw( FS::part_event::Action );
5
6 sub description { 'Upload CSV invoice data to an FTP server'; }
7
8 sub deprecated { 1; }
9
10 sub eventtable_hashref {
11   { 'cust_bill' => 1 };
12 }
13
14 sub option_fields {
15   (
16     'ftpformat'   => { label   => 'Format',
17                        type    =>'select',
18                        options => ['default', 'billco'],
19                        option_labels => { 'default' => 'Default',
20                                           'billco'  => 'Billco',
21                                         },
22                      },
23     'ftpserver'   => 'FTP server',
24     'ftpusername' => 'FTP username',
25     'ftppassword' => 'FTP password',
26     'ftpdir'      => 'FTP directory',
27   );
28 }
29
30 sub default_weight { 50; }
31
32 sub do_action {
33   my( $self, $cust_bill ) = @_;
34
35   #my $cust_main = $self->cust_main($cust_bill);
36   my $cust_main = $cust_bill->cust_main;
37
38   $cust_bill->send_csv(
39     'protocol'   => 'ftp',
40     'server'     => $self->option('ftpserver'),
41     'username'   => $self->option('ftpusername'),
42     'password'   => $self->option('ftppassword'),
43     'dir'        => $self->option('ftpdir'),
44     'format'     => $self->option('ftpformat'),
45   );
46
47   '';
48 }
49
50 1;