'priority' => 99, #don't get in the way of provisioning jobs
};
my $error = $queue->insert( 'custnum'=>$custnum, %args );
-
+ die $error if $error;
}
} else {
if ( $disable_bill ) {
$cust_main->collect( %args, 'debug' => $debug );
} else {
- $cust_main->bill_and_collect( %args, 'debug' => $debug );
+ my $error = $cust_main->bill_and_collect( %args, 'fatal' => 'return',
+ 'debug' => $debug, );
+ if ( $error ) {
+ $log->error($error);
+ warn $error; #die $error;
+ }
}
}
# with today's date, regardless of the pretend date used to pre-generate
# the invoices.
#
-# -p: Only process customers with the specified payby (I<CARD>, I<DCRD>, I<CHEK>, I<DCHK>, I<BILL>, I<COMP>, I<LECB>)
-#
# -a: Only process customers with the specified agentnum
#
# -v: enable debugging
push @search, "( cust_main.archived != 'Y' OR archived IS NULL )"; #disable?
- push @search, "cust_main.payby = '". $opt{'p'}. "'"
- if $opt{'p'};
push @search, "cust_main.agentnum IN ( ". $opt{'a'}. " ) "
if $opt{'a'};