diff options
author | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
commit | c82d349f864e6bd9f96fd1156903bc1f7193a203 (patch) | |
tree | e117a87533656110b6acd56fc0ca64289892a9f5 /bin/payment-faker | |
parent | 74e058c8a010ef6feb539248a550d0bb169c1e94 (diff) |
This commit was manufactured by cvs2svn to create tag 'TORRUS_1_0_9'.TORRUS_1_0_9
Diffstat (limited to 'bin/payment-faker')
-rwxr-xr-x | bin/payment-faker | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/bin/payment-faker b/bin/payment-faker deleted file mode 100755 index 03316e1c0..000000000 --- a/bin/payment-faker +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/perl - -use Date::Parse; -use FS::UID qw(adminsuidsetup); -use FS::Record qw(qsearch); -use FS::cust_pay; -use FS::cust_credit; - -my $user; -$user = shift or die "usage: payment-faker $user"; -adminsuidsetup($user); - -for $month ( 1 .. 11 ) { - - print "month $month\n"; - - system(qq!freeside-daily -d "$month/1/2006" $user!); - - foreach my $cust_main ( qsearch('cust_main', {} ) ) { - next unless $cust_main->balance > 0; - my $item = ''; - if ( rand() > .95 ) { - $item = new FS::cust_credit { - 'amount' => $cust_main->balance, - '_date' => str2time("$month/1/2006"), - 'reason' => 'testing', - }; - } else { - - if ( rand() > .5 ) { - $payby = 'BILL'; - $payinfo = int(rand(10000)); - } else { - $payby = 'CARD'; - $payinfo = '4111111111111111'; - } - - $item = new FS::cust_pay { - 'paid' => $cust_main->balance, - '_date' => str2time("$month/1/2006"), - 'payby' => $payby, - 'payinfo' => $payinfo, - }; - } - - $item->custnum($cust_main->custnum); - my $error = $item->insert; - die $error if $error; - $cust_main->apply_payments; - $cust_main->apply_credits; - - } - -} |