From 29347e1d34d5468994af6e219f00582e525688ae Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 3 Nov 2009 03:13:46 +0000 Subject: (start of) reconcile breakage from stale accounts, RT#6407 --- FS/FS/Cron/breakage.pm | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 FS/FS/Cron/breakage.pm (limited to 'FS/FS/Cron') diff --git a/FS/FS/Cron/breakage.pm b/FS/FS/Cron/breakage.pm new file mode 100644 index 0000000..6312667 --- /dev/null +++ b/FS/FS/Cron/breakage.pm @@ -0,0 +1,41 @@ +package FS::Cron::breakage; + +use strict; +use base 'Exporter'; +use vars qw( @EXPORT_OK ); +use FS::Conf; +use FS::Record qw(qsearch); +use FS::agent; +#use FS::cust_main; + +@EXPORT_OK = qw ( reconcile_breakage ); + +#freeside-daily %opt +# -v: enable debugging +# -l: debugging level + +sub reconcile_breakage { + return; + #nothing yet + + my $conf = new FS::Conf; + + foreach my $agent (qsearch('agent', {})) { + + my $days = $conf->config('breakage-days', $agent->agentnum) + or next; + + #find customers w/a balance older than $days (and no activity since) + + # - do a one time charge in the total amount of old unapplied payments. + # 'pkg' => 'Breakage', #or whatever. + # 'setuptax' => 'Y', + # 'classnum' => scalar($conf->config('breakage-pkg_class')), + # - use the new $cust_main->charge( 'bill_now' => 1 ) option to generate an invoice, etc. + # - apply_payments_and_credits + + } + +} + +1; -- cgit v1.1