X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_pay.pm;h=ff8226c8d606b40a45b9ceb708389424f2815c53;hb=7b125e587a4d1ee0aca692e23ea7897f671855ae;hp=c55dd48b756a99f13c79119f534c9aef76c8c651;hpb=649cb6a173a4278f3c4e0c960ce5b71422329222;p=freeside.git diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm index c55dd48b7..ff8226c8d 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 cust_pay: $error"; + return "error inserting $self: $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"; } } } @@ -659,7 +659,7 @@ Returns an SQL fragment to retreive the unapplied amount. =cut sub unapplied_sql { - my ($class, $start, $end) = @_; + my ($class, $start, $end) = shift; my $bill_start = $start ? "AND cust_bill_pay._date <= $start" : ''; my $bill_end = $end ? "AND cust_bill_pay._date > $end" : ''; my $refund_start = $start ? "AND cust_pay_refund._date <= $start" : ''; @@ -693,10 +693,6 @@ sub _upgrade_data { #class method warn "$me upgrading $class\n" if $DEBUG; - ## - # otaker/ivan upgrade - ## - #not the most efficient, but hey, it only has to run once my $where = "WHERE ( otaker IS NULL OR otaker = '' OR otaker = 'ivan' ) ". @@ -752,43 +748,6 @@ 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' => {}, #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 } ); - unless ( $cust_pay_pending ) { - warn " *** WARNING: not-yet recoverable N/A card for payment ". - $na->paynum. " (no cust_pay_pending)\n"; - next; - } - $na->$_($cust_pay_pending->$_) for qw( payinfo paymask ); - my $error = $na->replace; - if ( $error ) { - warn " *** WARNING: Error updating payinfo for payment paynum ". - $na->paynun. ": $error\n"; - next; - } - - } - - ### - # otaker->usernum upgrade - ### - $class->_upgrade_otaker(%opts); }