projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT# 79737 - fixed error in code
[freeside.git]
/
FS
/
FS
/
cust_main
/
Billing_Batch.pm
diff --git
a/FS/FS/cust_main/Billing_Batch.pm
b/FS/FS/cust_main/Billing_Batch.pm
index
f91c5fb
..
38d100e
100644
(file)
--- a/
FS/FS/cust_main/Billing_Batch.pm
+++ b/
FS/FS/cust_main/Billing_Batch.pm
@@
-65,12
+65,7
@@
sub batch_card {
&& !($options{payby} && $options{payinfo} && $options{paydate} && $options{payname});
#false laziness with Billing_Realtime
&& !($options{payby} && $options{payinfo} && $options{paydate} && $options{payname});
#false laziness with Billing_Realtime
- my @cust_payby = qsearch({
- 'table' => 'cust_payby',
- 'hashref' => { 'custnum' => $self->custnum, },
- 'extra_sql' => " AND payby IN ( 'CARD', 'CHEK' ) ",
- 'order_by' => 'ORDER BY weight ASC',
- });
+ my @cust_payby = $self->cust_payby('CARD','CHEK');
# batch can't try out every one like realtime, just use first one
my $cust_payby = $cust_payby[0];
# batch can't try out every one like realtime, just use first one
my $cust_payby = $cust_payby[0];
@@
-94,7
+89,7
@@
sub batch_card {
#this needs to handle mysql as well as Pg, like svc_acct.pm
#(make it into a common function if folks need to do batching with mysql)
$dbh->do("LOCK TABLE pay_batch IN SHARE ROW EXCLUSIVE MODE")
#this needs to handle mysql as well as Pg, like svc_acct.pm
#(make it into a common function if folks need to do batching with mysql)
$dbh->do("LOCK TABLE pay_batch IN SHARE ROW EXCLUSIVE MODE")
- or
return
"Cannot lock pay_batch: " . $dbh->errstr;
+ or
die
"Cannot lock pay_batch: " . $dbh->errstr;
my %pay_batch = (
'status' => 'O',
my %pay_batch = (
'status' => 'O',
@@
-119,7
+114,7
@@
sub batch_card {
} );
foreach (qw( address1 address2 city state zip country latitude longitude
} );
foreach (qw( address1 address2 city state zip country latitude longitude
- payby payinfo paydate payname ))
+ payby payinfo paydate payname
paycode
))
{
$options{$_} = '' unless exists($options{$_});
}
{
$options{$_} = '' unless exists($options{$_});
}
@@
-145,7
+140,9
@@
sub batch_card {
'payinfo' => $options{payinfo} || $cust_payby->payinfo,
'exp' => $options{paydate} || $cust_payby->paydate,
'payname' => $options{payname} || $cust_payby->payname,
'payinfo' => $options{payinfo} || $cust_payby->payinfo,
'exp' => $options{paydate} || $cust_payby->paydate,
'payname' => $options{payname} || $cust_payby->payname,
+ 'paytype' => $options{paytype} || $cust_payby->paytype,
'amount' => $amount, # consolidating
'amount' => $amount, # consolidating
+ 'paycode' => $options{paycode} || $cust_payby->paycode,
} );
$cust_pay_batch->paybatchnum($old_cust_pay_batch->paybatchnum)
} );
$cust_pay_batch->paybatchnum($old_cust_pay_batch->paybatchnum)
@@
-160,7
+157,8
@@
sub batch_card {
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
- die $error;
+ #die $error;
+ return $error; # e.g. "Illegal zip" ala RT#75998
}
my $unapplied = $self->total_unapplied_credits
}
my $unapplied = $self->total_unapplied_credits