summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2002-02-27 21:57:24 +0000
committerivan <ivan>2002-02-27 21:57:24 +0000
commit49bc2dac92d2bb60e000088449b27aa380cc3490 (patch)
tree8f99fd58b786e9472f34785c6bc8a5b58584ea97 /FS
parent69f252e5353483662c81b1d6d0e750ae08577649 (diff)
better debugging
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_main.pm10
-rwxr-xr-xFS/bin/freeside-daily6
2 files changed, 12 insertions, 4 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index b6d3075e8..7445e35bb 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -1102,7 +1102,7 @@ sub collect {
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 '';
@@ -1140,10 +1140,16 @@ sub collect {
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.
diff --git a/FS/bin/freeside-daily b/FS/bin/freeside-daily
index 8d839cb21..e6f02df33 100755
--- a/FS/bin/freeside-daily
+++ b/FS/bin/freeside-daily
@@ -9,12 +9,14 @@ use FS::Record qw(qsearch qsearchs);
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', {} )