X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_bill_event.pm;h=1d48af9fc3a2c09fe84acb9573f52582b2627cf8;hb=e2d78a94d7806862da7fcea0025cd380d49d5a75;hp=466ff89606e850d3c6231740dc77af74edc6cfb9;hpb=9811b8ce65909a293810ddbcd8c9b5ca963fba01;p=freeside.git diff --git a/FS/FS/part_bill_event.pm b/FS/FS/part_bill_event.pm index 466ff8960..1d48af9fc 100644 --- a/FS/FS/part_bill_event.pm +++ b/FS/FS/part_bill_event.pm @@ -2,6 +2,7 @@ package FS::part_bill_event; use strict; use vars qw( @ISA $DEBUG @EXPORT_OK ); +use Carp qw(cluck confess); use FS::Record qw( dbh qsearch qsearchs ); use FS::Conf; @@ -37,10 +38,10 @@ FS::part_bill_event - Object methods for part_bill_event records =head1 DESCRIPTION -An FS::part_bill_event object represents an invoice event definition - -a callback which is triggered when an invoice is a certain amount of time -overdue. FS::part_bill_event inherits from -FS::Record. The following fields are currently supported: +An FS::part_bill_event object represents a deprecated, old-style invoice event +definition - a callback which is triggered when an invoice is a certain amount +of time overdue. FS::part_bill_event inherits from FS::Record. The following +fields are currently supported: =over 4 @@ -66,6 +67,11 @@ FS::Record. The following fields are currently supported: =back +=head1 NOTE + +Old-style invoice events are only useful for legacy migrations - if you are +looking for current events see L. + =head1 METHODS =over 4 @@ -133,13 +139,16 @@ sub check { my $c = $self->eventcode; + #yay, these regexen will go away with the event refactor + $c =~ /^\s*\$cust_main\->(suspend|cancel|invoicing_list_addpost|bill|collect)\(\);\s*("";)?\s*$/ or $c =~ /^\s*\$cust_bill\->(comp|realtime_(card|ach|lec)|batch_card|send)\((%options)*\);\s*$/ or $c =~ /^\s*\$cust_bill\->send(_if_newest)?\(\'[\w\-\s]+\'\s*(,\s*(\d+|\[\s*\d+(,\s*\d+)*\s*\])\s*,\s*'[\w\@\.\-\+]*'\s*)?\);\s*$/ - or $c =~ /^\s*\$cust_main\->apply_payments; \$cust_main->apply_credits; "";\s*$/ +# or $c =~ /^\s*\$cust_main\->apply_payments; \$cust_main->apply_credits; "";\s*$/ + or $c =~ /^\s*\$cust_main\->apply_payments_and_credits; "";\s*$/ or $c =~ /^\s*\$cust_main\->charge\( \s*\d*\.?\d*\s*,\s*\'[\w \!\@\#\$\%\&\(\)\-\+\;\:\"\,\.\?\/]*\'\s*\);\s*$/ @@ -223,6 +232,10 @@ Requires record and payby, but event_time and extra_sql are optional. sub due_events { my ($record, $payby, $event_time, $extra_sql) = @_; + + #cluck "DEPRECATED: FS::part_bill_event::due_events called on $record"; + confess "DEPRECATED: FS::part_bill_event::due_events called on $record"; + my $interval = 0; if ($record->_date){ $event_time = time unless $event_time; @@ -258,6 +271,10 @@ Should only be performed inside a transaction. sub do_event { my ($self, $object, %options) = @_; + + #cluck "DEPRECATED: FS::part_bill_event::do_event called on $self"; + confess "DEPRECATED: FS::part_bill_event::do_event called on $self"; + warn " calling event (". $self->eventcode. ") for " . $object->table . " " , $object->get($object->dbdef_table->primary_key) . "\n" if $DEBUG > 1; my $oldAutoCommit = $FS::UID::AutoCommit;