X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_pay.pm;h=f15c85b870c5837a0fca4a1e0b949a992a0f243a;hb=4b34c0c3dfc664793e5345c629e26c100e94aa22;hp=53db722ddcb755dae6a7b58878ad3b7349196943;hpb=78fe7364c8d54eb76a908f900326a673d7d1e1fc;p=freeside.git diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm index 53db722dd..f15c85b87 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 );