projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
371e7a9
)
add freeside-overdue
author
ivan
<ivan>
Wed, 26 Dec 2001 15:08:49 +0000
(15:08 +0000)
committer
ivan
<ivan>
Wed, 26 Dec 2001 15:08:49 +0000
(15:08 +0000)
FS/MANIFEST
patch
|
blob
|
history
FS/bin/freeside-overdue
patch
|
blob
|
history
diff --git
a/FS/MANIFEST
b/FS/MANIFEST
index
b7804cc
..
23a27d1
100644
(file)
--- a/
FS/MANIFEST
+++ b/
FS/MANIFEST
@@
-9,6
+9,7
@@
bin/freeside-queued
bin/freeside-apply-credits
bin/freeside-adduser
bin/freeside-setinvoice
bin/freeside-apply-credits
bin/freeside-adduser
bin/freeside-setinvoice
+bin/freeside-overdue
FS.pm
FS/CGI.pm
FS/Conf.pm
FS.pm
FS/CGI.pm
FS/Conf.pm
diff --git
a/FS/bin/freeside-overdue
b/FS/bin/freeside-overdue
index
45d5344
..
65941ce
100755
(executable)
--- a/
FS/bin/freeside-overdue
+++ b/
FS/bin/freeside-overdue
@@
-13,7
+13,7
@@
use FS::UID qw(adminsuidsetup);
&untaint_argv;
my %opt;
&untaint_argv;
my %opt;
-getopts('ed:qpsc', \%opt);
+getopts('ed:qp
l
sc', \%opt);
my $user = shift or die &usage;
adminsuidsetup $user;
my $user = shift or die &usage;
adminsuidsetup $user;
@@
-48,10
+48,15
@@
foreach $cust_main ( qsearch('cust_main',{} ) ) {
$cust_main->balance_date(time-$opt{d} * 86400);
}
$cust_main->balance_date(time-$opt{d} * 86400);
}
+ if ( $opt{l} ) {
+ print "\n\tCharging late fee of \$$opt{l}" unless $opt{q};
+
+ }
+
foreach $cust_pkg ( qsearch( 'cust_pkg',
{ 'custnum' => $cust_main->custnum } ) ) {
foreach $cust_pkg ( qsearch( 'cust_pkg',
{ 'custnum' => $cust_main->custnum } ) ) {
- if ($opt{p} && ! grep { $_ eq 'POST' } $cust_main->invoicing_list ) {
+ if (
$opt{p} && ! grep { $_ eq 'POST' } $cust_main->invoicing_list ) {
print "\n\tAdding postal invoicing" unless $opt{q};
my @invoicing_list = $cust_main->invoicing_list;
push @invoicing_list, 'POST';
print "\n\tAdding postal invoicing" unless $opt{q};
my @invoicing_list = $cust_main->invoicing_list;
push @invoicing_list, 'POST';
@@
-84,7
+89,7
@@
sub untaint_argv {
}
sub usage {
}
sub usage {
- die "Usage:\n\n freeside-overdue [ -e ] [ -d days ] [ -q ] [ -p ] [ -s ] [ -c ] user\n";
+ die "Usage:\n\n freeside-overdue [ -e ] [ -d days ] [ -q ] [ -p ] [ -
l amount ] [ -
s ] [ -c ] user\n";
}
}
@@
-94,7
+99,7
@@
freeside-overdue - Perform actions on overdue and/or expired accounts.
=head1 SYNOPSIS
=head1 SYNOPSIS
- freeside-overdue [ -e ] [ -d days ] [ -q ] [ -p ] [ -s ] [ -c ] user
+ freeside-overdue [ -e ] [ -d days ] [ -q ] [ -p ] [ -
l amount ] [ -
s ] [ -c ] user
=head1 DESCRIPTION
=head1 DESCRIPTION
@@
-109,10
+114,12
@@
Selection options (at least one selection option is required):
Action options:
Action options:
- -q: Be quiet (by default, s
uspend
ed accounts are printed).
+ -q: Be quiet (by default, s
elect
ed accounts are printed).
-p: Add postal invoicing to the relevant customers.
-p: Add postal invoicing to the relevant customers.
+ -l: Add a charge of the given amount to the relevant customers.
+
-s: Suspend accounts.
-c: Cancel accounts.
-s: Suspend accounts.
-c: Cancel accounts.
@@
-123,11
+130,17
@@
Action options:
Example crontab entries:
Example crontab entries:
+# suspend expired accounts
20 4 * * * freeside-overdue -e -s user
20 4 * * * freeside-overdue -e -s user
+
+# quietly add postal invoicing to customers over 30 days past due
20 4 * * * freeside-overdue -d 30 -p -q user
20 4 * * * freeside-overdue -d 30 -p -q user
-20 4 * * * freeside-overdue -d 60 user
-20 4 * * * freeside-overdue -d 90 -s user
-20 4 * * * freeside-overdue -d 120 -c user
+
+# suspend accounts and charge a $10.23 fee for customers over 60 days past due
+20 4 * * * freeside-overdue -d 60 -s -l 10.23 user
+
+# cancel accounts over 90 days past due
+20 4 * * * freeside-overdue -d 90 -c user
=head1 ORIGINAL AUTHORS
=head1 ORIGINAL AUTHORS