table of FTP targets for invoice spool upload, #17620
[freeside.git] / FS / FS / part_event / Action / cust_bill_spool_csv.pm
index 1504a4f..24c26ff 100644 (file)
@@ -2,6 +2,7 @@ package FS::part_event::Action::cust_bill_spool_csv;
 
 use strict;
 use base qw( FS::part_event::Action );
+use FS::Misc;
 
 sub description { 'Spool CSV invoice data'; }
 
@@ -15,11 +16,7 @@ sub option_fields {
   (
     'spoolformat'       => { label   => 'Format',
                              type    => 'select',
-                             options => ['default', 'billco', 'oneline'],
-                             option_labels => { 'default' => 'Default',
-                                                'billco'  => 'Billco',
-                                                'oneline' => 'One line',
-                                              },
+                             options => [ FS::Misc::spool_formats() ],
                            },
     'spoolbalanceover'  => { label =>
                                'If balance (this invoice and previous) over',
@@ -29,6 +26,13 @@ sub option_fields {
                              type  => 'checkbox',
                              value => '1',
                            },
+    'ftp_targetnum'     => { label    => 'Upload spool to FTP target',
+                             type     => 'select-table',
+                             table    => 'ftp_target',
+                             name_col => 'label',
+                             empty_label => '(do not upload)',
+                             order_by => 'targetnum',
+                           },
   );
 }
 
@@ -44,6 +48,7 @@ sub do_action {
     'format'       => $self->option('spoolformat'),
     'balanceover'  => $self->option('spoolbalanceover'),
     'agent_spools' => $self->option('spoolagent_spools'),
+    'ftp_targetnum'=> $self->option('ftp_targetnum'),
   );
 }