From 3fa7c14e5c734c4f650d3cb2663b6cedc62a673c Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 17 Apr 2009 19:20:00 +0000 Subject: backport freeside-daily -m and cust_main::bill_and_collect to 1.7, RT#4412 --- FS/bin/freeside-daily | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'FS/bin/freeside-daily') diff --git a/FS/bin/freeside-daily b/FS/bin/freeside-daily index 13079b4f9..d42e5248b 100755 --- a/FS/bin/freeside-daily +++ b/FS/bin/freeside-daily @@ -6,7 +6,7 @@ use FS::UID qw(adminsuidsetup); &untaint_argv; #what it sounds like (eww) use vars qw(%opt); -getopts("p:a:d:vl:sy:nm", \%opt); +getopts("p:a:d:vl:sy:nmk", \%opt); my $user = shift or die &usage; adminsuidsetup $user; @@ -16,15 +16,21 @@ bill(%opt); #what to do about the below when using -m? that is the question. -use FS::Cron::notify qw(notify_flat_delay); -notify_flat_delay(%opt); - +#you don't want to skip this, besides, it should be cheap use FS::Cron::expire_user_pref qw(expire_user_pref); expire_user_pref(); -use FS::Cron::vacuum qw(vacuum); -vacuum(); +unless ( $opt{k} ) { + + use FS::Cron::notify qw(notify_flat_delay); + notify_flat_delay(%opt); + + use FS::Cron::vacuum qw(vacuum); + vacuum(); +} + +#you can skip this just by not having the config use FS::Cron::backup qw(backup_scp); backup_scp(); @@ -42,7 +48,7 @@ sub untaint_argv { } sub usage { - die "Usage:\n\n freeside-daily [ -d 'date' ] user [ custnum custnum ... ]\n"; + die "Usage:\n\n freeside-daily [ -d 'date' ] [ -y days ] [ -p 'payby' ] [ -a agentnum ] [ -s ] [ -v ] [ -l level ] [ -m ] [ -k ] user [ custnum custnum ... ]\n"; } ### @@ -55,7 +61,7 @@ freeside-daily - Run daily billing and invoice collection events. =head1 SYNOPSIS - freeside-daily [ -d 'date' ] [ -y days ] [ -p 'payby' ] [ -a agentnum ] [ -s ] [ -v ] [ -l level ] [ -m ] user [ custnum custnum ... ] + freeside-daily [ -d 'date' ] [ -y days ] [ -p 'payby' ] [ -a agentnum ] [ -s ] [ -v ] [ -l level ] [ -m ] [ -k ] user [ custnum custnum ... ] =head1 DESCRIPTION @@ -89,6 +95,8 @@ the bill and collect methods of a cust_main object. See L. -m: Experimental multi-process mode uses the job queue for multi-process and/or multi-machine billing. + -k: skip notify_flat_delay and vacuum + user: From the mapsecrets file - see config.html from the base documentation custnum: if one or more customer numbers are specified, only bills those -- cgit v1.2.1 From f8f8613866ba3df9a571922046978623943ccb14 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 25 Apr 2009 22:42:40 +0000 Subject: add dry run to multi-process mode for testing, RT#4412 --- FS/bin/freeside-daily | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'FS/bin/freeside-daily') diff --git a/FS/bin/freeside-daily b/FS/bin/freeside-daily index d42e5248b..bda42f025 100755 --- a/FS/bin/freeside-daily +++ b/FS/bin/freeside-daily @@ -6,7 +6,7 @@ use FS::UID qw(adminsuidsetup); &untaint_argv; #what it sounds like (eww) use vars qw(%opt); -getopts("p:a:d:vl:sy:nmk", \%opt); +getopts("p:a:d:vl:sy:nmrk", \%opt); my $user = shift or die &usage; adminsuidsetup $user; @@ -61,7 +61,7 @@ freeside-daily - Run daily billing and invoice collection events. =head1 SYNOPSIS - freeside-daily [ -d 'date' ] [ -y days ] [ -p 'payby' ] [ -a agentnum ] [ -s ] [ -v ] [ -l level ] [ -m ] [ -k ] user [ custnum custnum ... ] + freeside-daily [ -d 'date' ] [ -y days ] [ -p 'payby' ] [ -a agentnum ] [ -s ] [ -v ] [ -l level ] [ -m ] [ -r ] [ -k ] user [ custnum custnum ... ] =head1 DESCRIPTION @@ -95,6 +95,8 @@ the bill and collect methods of a cust_main object. See L. -m: Experimental multi-process mode uses the job queue for multi-process and/or multi-machine billing. + -r: Multi-process mode dry run option + -k: skip notify_flat_delay and vacuum user: From the mapsecrets file - see config.html from the base documentation -- cgit v1.2.1 From d8e19d73efa750780648146fd45fe701c70c3465 Mon Sep 17 00:00:00 2001 From: mark Date: Wed, 24 Jun 2009 09:07:21 +0000 Subject: Move expiration alerts into FS::Cron::alert_expiration --- FS/bin/freeside-daily | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'FS/bin/freeside-daily') diff --git a/FS/bin/freeside-daily b/FS/bin/freeside-daily index bda42f025..acf795087 100755 --- a/FS/bin/freeside-daily +++ b/FS/bin/freeside-daily @@ -14,6 +14,10 @@ adminsuidsetup $user; use FS::Cron::bill qw(bill); bill(%opt); +# Send alerts about upcoming credit card expiration. +use FS::Cron::alert_expiration qw(alert_expiration); +alert_expiration(%opt); + #what to do about the below when using -m? that is the question. #you don't want to skip this, besides, it should be cheap -- cgit v1.2.1 From 45a4c5ad153a132ab392d71ca7cffbd08ff3c9c2 Mon Sep 17 00:00:00 2001 From: mark Date: Fri, 26 Jun 2009 06:55:07 +0000 Subject: Add expiration alerts to freeside-daily routine --- FS/bin/freeside-daily | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'FS/bin/freeside-daily') diff --git a/FS/bin/freeside-daily b/FS/bin/freeside-daily index acf795087..271c436c6 100755 --- a/FS/bin/freeside-daily +++ b/FS/bin/freeside-daily @@ -3,6 +3,7 @@ use strict; use Getopt::Std; use FS::UID qw(adminsuidsetup); +use FS::Conf; &untaint_argv; #what it sounds like (eww) use vars qw(%opt); @@ -16,7 +17,8 @@ bill(%opt); # Send alerts about upcoming credit card expiration. use FS::Cron::alert_expiration qw(alert_expiration); -alert_expiration(%opt); +my $conf = new FS::Conf; +alert_expiration(%opt) if($conf->exists('alert_expiration')); #what to do about the below when using -m? that is the question. -- cgit v1.2.1 From 1b8a2cc3b3697f3921e26a31691acfabacc1efd6 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 17 Jul 2009 22:26:38 +0000 Subject: commit pkgpart exclusion for billing run, RT#5495 --- FS/bin/freeside-daily | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'FS/bin/freeside-daily') diff --git a/FS/bin/freeside-daily b/FS/bin/freeside-daily index 271c436c6..119f93a59 100755 --- a/FS/bin/freeside-daily +++ b/FS/bin/freeside-daily @@ -7,7 +7,7 @@ use FS::Conf; &untaint_argv; #what it sounds like (eww) use vars qw(%opt); -getopts("p:a:d:vl:sy:nmrk", \%opt); +getopts("p:a:d:vl:sy:nmrkg:", \%opt); my $user = shift or die &usage; adminsuidsetup $user; @@ -31,8 +31,9 @@ unless ( $opt{k} ) { use FS::Cron::notify qw(notify_flat_delay); notify_flat_delay(%opt); - use FS::Cron::vacuum qw(vacuum); - vacuum(); + #Pg 8.1+ auto-vaccums, 7.4 w/postgresql-contrib + #use FS::Cron::vacuum qw(vacuum); + #vacuum(); } @@ -93,6 +94,9 @@ the bill and collect methods of a cust_main object. See L. -a: Only process customers with the specified agentnum + -g: Don't process the provided pkgpart (or pkgparts, specified as a comma- + separated list). + -s: re-charge setup fees -v: enable debugging -- cgit v1.2.1 From 56a2965996454a0649d43ecbc062beda61106e21 Mon Sep 17 00:00:00 2001 From: jeff Date: Wed, 12 Aug 2009 14:58:50 +0000 Subject: internalize billco-upload and automate the transfer to the provider RT#5902 --- FS/bin/freeside-daily | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'FS/bin/freeside-daily') diff --git a/FS/bin/freeside-daily b/FS/bin/freeside-daily index 119f93a59..728fa969a 100755 --- a/FS/bin/freeside-daily +++ b/FS/bin/freeside-daily @@ -15,6 +15,10 @@ adminsuidsetup $user; use FS::Cron::bill qw(bill); bill(%opt); +#you can skip this just by not having the config +use FS::Cron::upload qw(upload); +upload(%opt); + # Send alerts about upcoming credit card expiration. use FS::Cron::alert_expiration qw(alert_expiration); my $conf = new FS::Conf; -- cgit v1.2.1