4 use FS::UID qw(adminsuidsetup);
6 use FS::Record qw(qsearch qsearchs);
10 &untaint_argv; #what it sounds like (eww)
11 my $user = shift or die &usage;
15 foreach my $cust_main (
16 grep { ! scalar($_->invoicing_list) }
17 qsearch( 'cust_main', {} )
20 my @cust_pkg = $cust_main->ncancelled_pkgs;
21 foreach my $cust_pkg ( @cust_pkg ) {
22 foreach my $cust_svc ( $cust_pkg->cust_svc ) {
23 my $svc_acct = qsearchs( 'svc_acct', { 'svcnum' => $cust_svc->svcnum } );
24 push @dest, $svc_acct->svcnum if $svc_acct;
27 push @dest, 'POST' unless @dest;
28 $cust_main->invoicing_list(\@dest);
32 foreach $_ ( $[ .. $#ARGV ) { #untaint @ARGV
33 $ARGV[$_] =~ /^(.*)$/ || die "Illegal arguement \"$ARGV[$_]\"";
39 die "Usage:\n\n freeside-setinvoice user\n";