summaryrefslogtreecommitdiff
path: root/bin/cust_main-bill_now-profile
blob: b6d75974ec6d2dc6d86e88258cad6da5c68aa9d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl -w

use strict;

use DBIx::Profile;

use FS::UID qw( adminsuidsetup );
#use FS::Schema qw( dbdef );
use FS::Record qw(qsearchs);
use FS::cust_main;

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

my $custnum = shift or die &usage;
my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
  or die "unknown custnum $custnum\n";

$FS::cust_main::DEBUG = 3;
$cust_main->bill_and_collect( debug=>3, check_freq=>'1d' );

print "\n";
print $dbh->sprintProfile;
#$dbh->printProfile;

sub usage {
  die "Usage:\n  cust_main-bill_now user custnum\n";
}

1;