4 use vars qw($opt_s $opt_u $opt_p $opt_e);
6 use FS::UID qw(adminsuidsetup);
7 use FS::Record qw(qsearch qsearchs);
12 my $user = shift or die &usage;
15 my $export_x = shift or die &usage;
17 if ( $export_x =~ /^(\d+)$/ ) {
18 @part_export = qsearchs('part_export', { exportnum=>$1 } )
19 or die "exportnum $export_x not found\n";
21 @part_export = qsearch('part_export', { exporttype=>$export_x } )
22 or die "no exports of type $export_x found\n";
29 my $cust_svc = qsearchs('cust_svc', { svcnum=>$opt_s } )
30 or die "svcnum $opt_s not found\n";
31 push @svc_x, $cust_svc->svc_x;
33 my $svc_x = qsearchs('svc_acct', { username=>$opt_u } )
34 or die "username $opt_u not found\n";
37 push @svc_x, map { $_->svc_x } qsearch('cust_svc', { svcpart=>$opt_p } );
38 die "no services with svcpart $opt_p found\n" unless @svc_x;
42 die &usage unless grep { $_ eq $opt_e } qw( insert replace delete suspend unsuspend );
43 my $method = 'export_' . $opt_e;
45 foreach my $part_export ( @part_export ) {
46 foreach my $svc_x ( @svc_x ) {
47 my $error = $part_export->$method($svc_x,$svc_x);
54 return "Usage:\n\n freeside-reexport user exportnum|exporttype [ -s svcnum | -u username | -p svcpart ] [ -e insert|replace|delete|suspend|unsuspend ]\n";
59 freeside-reexport - Command line tool to re-trigger export jobs for existing services
63 freeside-reexport user exportnum|exporttype [ -s svcnum | -u username | -p svcpart ] [ -e insert|replace|delete|suspend|unsuspend ]
67 Re-queues the export job for the specified exportnum or exporttype(s) and
68 specified service (selected by svcnum, username or svcpart). Optionally
69 specify the phase of export using the -e flag (default is insert.)
73 L<freeside-sqlradius-reset>, L<FS::part_export>