summaryrefslogtreecommitdiff
path: root/FS/FS/cust_pay.pm
diff options
context:
space:
mode:
authorivan <ivan>2010-07-10 06:23:43 +0000
committerivan <ivan>2010-07-10 06:23:43 +0000
commit4b34c0c3dfc664793e5345c629e26c100e94aa22 (patch)
tree62da067807e411100115218819e940f4ecc90677 /FS/FS/cust_pay.pm
parent5314dc3ad97f18e97629c83917c68df7402d1e55 (diff)
fix payinfo N/A upgrade, RT#8809
Diffstat (limited to 'FS/FS/cust_pay.pm')
-rw-r--r--FS/FS/cust_pay.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm
index 53db722..f15c85b 100644
--- a/FS/FS/cust_pay.pm
+++ b/FS/FS/cust_pay.pm
@@ -179,7 +179,7 @@ sub insert {
$error = $self->SUPER::insert;
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
- return "error inserting $self: $error";
+ return "error inserting cust_pay: $error";
}
if ( $self->invnum ) {
@@ -192,11 +192,11 @@ sub insert {
$error = $cust_bill_pay->insert(%options);
if ( $error ) {
if ( $ignore_noapply ) {
- warn "warning: error inserting $cust_bill_pay: $error ".
+ warn "warning: error inserting cust_bill_pay: $error ".
"(ignore_noapply flag set; inserting cust_pay record anyway)\n";
} else {
$dbh->rollback if $oldAutoCommit;
- return "error inserting $cust_bill_pay: $error";
+ return "error inserting cust_bill_pay: $error";
}
}
}
@@ -756,13 +756,18 @@ sub _upgrade_data { #class method
# payinfo N/A upgrade
###
+ #XXX remove the 'N/A (tokenized)' part (or just this entire thing)
+
my @na_cust_pay = qsearch( {
'table' => 'cust_pay',
- 'hashref' => { 'payinfo' => 'N/A' },
- 'extra_sql' => "AND payby IN ( 'CARD', 'CHEK' )",
+ 'hashref' => {}, #could be encrypted# { 'payinfo' => 'N/A' },
+ 'extra_sql' => "WHERE ( payinfo = 'N/A' OR paymask = 'N/AA' OR paymask = 'N/A (tokenized)' ) AND payby IN ( 'CARD', 'CHEK' )",
} );
foreach my $na ( @na_cust_pay ) {
+
+ next unless $na->payinfo eq 'N/A';
+
my $cust_pay_pending =
qsearchs('cust_pay_pending', { 'paynum' => $na->paynum } );
$na->$_($cust_pay_pending->$_) for qw( payinfo paymask );