projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
91a5fe4
)
msgcat error for credit card expiration (closes: Bug#407)
author
ivan
<ivan>
Wed, 24 Apr 2002 09:03:37 +0000
(09:03 +0000)
committer
ivan
<ivan>
Wed, 24 Apr 2002 09:03:37 +0000
(09:03 +0000)
FS/FS/cust_main.pm
patch
|
blob
|
history
bin/populate-msgcat
patch
|
blob
|
history
diff --git
a/FS/FS/cust_main.pm
b/FS/FS/cust_main.pm
index
6fefe0d
..
4a6a952
100644
(file)
--- a/
FS/FS/cust_main.pm
+++ b/
FS/FS/cust_main.pm
@@
-683,11
+683,10
@@
sub check {
} else {
$self->paydate =~ /^(\d{1,2})[\/\-](\d{2}(\d{2})?)$/
or return "Illegal expiration date: ". $self->paydate;
} else {
$self->paydate =~ /^(\d{1,2})[\/\-](\d{2}(\d{2})?)$/
or return "Illegal expiration date: ". $self->paydate;
- if ( length($2) == 4 ) {
- $self->paydate("$2-$1-01");
- } else {
- $self->paydate("20$2-$1-01");
- }
+ my $y = length($2) == 4 ? $2 : "20$2";
+ $self->paydate("$y-$1-01");
+ my($nowm,$nowy)=(localtime(time))[4,5]; $nowm++; $nowy+=1900;
+ return gettext('expired_card') if $y<$nowy || ( $y==$nowy && $1<$nowm );
}
if ( $self->payname eq '' ) {
}
if ( $self->payname eq '' ) {
diff --git
a/bin/populate-msgcat
b/bin/populate-msgcat
index
64fa59a
..
506cf5f
100755
(executable)
--- a/
bin/populate-msgcat
+++ b/
bin/populate-msgcat
@@
-102,6
+102,10
@@
sub messages {
#'en_US' => '',
},
#'en_US' => '',
},
+ 'expired_card' => {
+ 'en_US' => 'Expired card',
+ },
+
);
}
);
}