[freeside-commits] freeside/FS/FS cust_main.pm,1.200,1.201
Ivan,,,
ivan at wavetail.420.am
Thu Nov 17 19:48:33 PST 2005
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv4431
Modified Files:
cust_main.pm
Log Message:
allow expired cards to remain on file; only check edits for an expired card when the # has changed
Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.200
retrieving revision 1.201
diff -u -d -r1.200 -r1.201
--- cust_main.pm 12 Nov 2005 01:22:47 -0000 1.200
+++ cust_main.pm 18 Nov 2005 03:48:30 -0000 1.201
@@ -2,7 +2,7 @@
use strict;
use vars qw( @ISA @EXPORT_OK $DEBUG $me $conf @encrypted_fields
- $import $skip_fuzzyfiles );
+ $import $skip_fuzzyfiles $ignore_expired_card );
use vars qw( $realtime_bop_decline_quiet ); #ugh
use Safe;
use Carp;
@@ -59,6 +59,7 @@
$import = 0;
$skip_fuzzyfiles = 0;
+$ignore_expired_card = 0;
@encrypted_fields = ('payinfo', 'paycvv');
@@ -926,6 +927,11 @@
unless grep { $_ eq getotaker } $conf->config('users-allow_comp');
}
+ local($ignore_expired_card) = 1
+ if $old->payby =~ /^(CARD|DCRD)$/
+ && $self->payby =~ /^(CARD|DCRD)$/
+ && $old->payinfo eq $self->payinfo;
+
my $oldAutoCommit = $FS::UID::AutoCommit;
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
@@ -1281,7 +1287,7 @@
if ( $self->paydate eq '' || $self->paydate eq '-' ) {
return "Expriation date required"
- unless $self->payby =~ /^(BILL|PREPAY|CHEK|LECB|CASH|WEST)$/;
+ unless $self->payby =~ /^(BILL|PREPAY|CHEK|DCHK|LECB|CASH|WEST)$/;
$self->paydate('');
} else {
my( $m, $y );
@@ -1295,7 +1301,9 @@
$self->paydate("$y-$m-01");
my($nowm,$nowy)=(localtime(time))[4,5]; $nowm++; $nowy+=1900;
return gettext('expired_card')
- if !$import && ( $y<$nowy || ( $y==$nowy && $1<$nowm ) );
+ if !$import
+ && !$ignore_expired_card
+ && ( $y<$nowy || ( $y==$nowy && $1<$nowm ) );
}
if ( $self->payname eq '' && $self->payby !~ /^(CHEK|DCHK)$/ &&
More information about the freeside-commits
mailing list