summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorjeff <jeff>2008-09-26 03:56:40 +0000
committerjeff <jeff>2008-09-26 03:56:40 +0000
commit379126e33ddb448bd6d66a296f5b4f6afd37bf7a (patch)
tree45ac9248a9028b57680702aa8710daa342dcd43c /FS
parente090a93a6ea4df4a8abc4a7cb5f461e5f2753a2a (diff)
push out event triggered suspensions
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/AccessRight.pm1
-rw-r--r--FS/FS/cust_main.pm2
-rw-r--r--FS/FS/part_bill_event.pm5
3 files changed, 8 insertions, 0 deletions
diff --git a/FS/FS/AccessRight.pm b/FS/FS/AccessRight.pm
index 27486da35..856a5f523 100644
--- a/FS/FS/AccessRight.pm
+++ b/FS/FS/AccessRight.pm
@@ -112,6 +112,7 @@ assigned to users and/or groups.
'Unsuspend customer package',
'Cancel customer package immediately',
'Cancel customer package later',
+ 'Delay suspension events',
'Add on-the-fly cancel reason', #NEW
'Add on-the-fly suspend reason', #NEW
'Edit customer package invoice details', #NEW
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 697f478ff..c0cdfba0a 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -227,6 +227,8 @@ Card Verification Value, "CVV2" (also known as CVC2 or CID), the 3 or 4 digit nu
=item spool_cdr - Enable individual CDR spooling, empty or `Y'
+=item dundate - a suggestion to events (see L<FS::part_bill_event">) to delay until this unix timestamp
+
=back
=head1 METHODS
diff --git a/FS/FS/part_bill_event.pm b/FS/FS/part_bill_event.pm
index 683f48423..7d0011764 100644
--- a/FS/FS/part_bill_event.pm
+++ b/FS/FS/part_bill_event.pm
@@ -4,6 +4,8 @@ use strict;
use vars qw( @ISA $DEBUG @EXPORT_OK );
use FS::Record qw( dbh qsearch qsearchs );
use FS::Conf;
+use FS::cust_main;
+use FS::cust_bill;
@ISA = qw( FS::Record );
@EXPORT_OK = qw( due_events );
@@ -234,6 +236,9 @@ sub due_events {
sort { $a->seconds <=> $b->seconds
|| $a->weight <=> $b->weight
|| $a->eventpart <=> $b->eventpart }
+ grep { ref($record) ne 'FS::cust_bill' || $_->eventcode !~ /honor_dundate/
+ || $event_time > $record->cust_main->dundate
+ }
grep { $_->seconds <= ( $interval )
&& ! qsearch( 'cust_bill_event', {
'invnum' => $record->get($record->dbdef_table->primary_key),