summaryrefslogtreecommitdiff
path: root/FS/FS
diff options
context:
space:
mode:
authorivan <ivan>2005-11-18 03:48:30 +0000
committerivan <ivan>2005-11-18 03:48:30 +0000
commitee0e5cbfd357b5943f08ee26e4894a88d1ea9d40 (patch)
tree0dce4711bcd34e4ae5fae61577751560b71f68e8 /FS/FS
parenta9997b03e204c6b81967c566fe7d6b4d1f5f67e8 (diff)
allow expired cards to remain on file; only check edits for an expired card when the # has changed
Diffstat (limited to 'FS/FS')
-rw-r--r--FS/FS/cust_main.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 54d56988e..f9031d792 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -2,7 +2,7 @@ package FS::cust_main;
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 @@ $me = '[FS::cust_main]';
$import = 0;
$skip_fuzzyfiles = 0;
+$ignore_expired_card = 0;
@encrypted_fields = ('payinfo', 'paycvv');
@@ -926,6 +927,11 @@ sub replace {
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 @@ sub check {
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 @@ sub check {
$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)$/ &&