summaryrefslogtreecommitdiff
path: root/FS/bin/freeside-apply-credits
blob: ea6a7bdd0e53aef921206f8eb67820b12008b18f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl -Tw

use strict;
use vars qw( $user $cust_main @customers );
use FS::UID qw(adminsuidsetup);
use FS::Record qw(qsearch);
use FS::cust_main;

$user = shift or die &usage;
&adminsuidsetup( $user );

my @customers = qsearch('cust_main', {} );
die "No customers" unless (scalar(@customers) > 0);

foreach $cust_main (@customers) {
  print "Applying credits for customer #". $cust_main->custnum;
  $cust_main->apply_credits;
}