my $dbh = dbh;
my $balance = $self->balance;
- warn "collect: balance $balance" if $Debug;
+ warn "collect customer". $self->custnum. ": balance $balance" if $Debug;
unless ( $balance > 0 ) { #redundant?????
$dbh->rollback if $oldAutoCommit; #hmm
return '';
qsearch('part_bill_event', { 'payby' => $self->payby,
'disabled' => '', } )
) {
- #run callback
+ warn "calling invoice event (". $part_bill_event->eventcode. ")\n"
+ if $Debug;
my $cust_main = $self; #for callback
my $error = eval $part_bill_event->eventcode;
+ if ( $@ ) {
+ warn "fatal error running invoice event (". part_bill_event->eventcode.
+ "): $@";
+ }
+
if ( $error ) {
warn "Error running invoice event (". $part_bill_event->eventcode.
use FS::cust_main;
&untaint_argv; #what it sounds like (eww)
-use vars qw($opt_d);
-getopts("d:");
+use vars qw($opt_d $opt_v);
+getopts("d:v");
my $user = shift or die &usage;
adminsuidsetup $user;
+$FS::cust_main::Debug = 1 if $opt_v;
+
my @cust_main = @ARGV
? map { qsearchs('cust_main', { custnum => $_ } ) } @ARGV
: qsearch('cust_main', {} )