summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2002-10-10 16:28:58 +0000
committerivan <ivan>2002-10-10 16:28:58 +0000
commitf5571d9d6c79d04e65f8da92be923c3f3ae5c54a (patch)
treeb60073e59228083370536280830b0783e4f9982b
parent0288a8d21086022a4b867aa5a8853bec47171ec2 (diff)
expiration date bugfix for HIDE
-rwxr-xr-xhttemplate/edit/cust_main.cgi18
1 files changed, 8 insertions, 10 deletions
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
index a76cd36d1..38d8d2b7e 100755
--- a/httemplate/edit/cust_main.cgi
+++ b/httemplate/edit/cust_main.cgi
@@ -357,16 +357,14 @@ if ( $payby_default eq 'HIDE' ) {
}
#false laziness w/expselect
- my( $m, $y ) = (0, 0);
- if ( scalar(@_) ) {
- my $date = shift || '01-2000';
- if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format
- ( $m, $y ) = ( $2, $1 );
- } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
- ( $m, $y ) = ( $1, $3 );
- } else {
- die "unrecognized expiration date format: $date";
- }
+ my( $m, $y );
+ my $date = $cust_main->paydate || '12-2037';
+ if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format
+ ( $m, $y ) = ( $2, $1 );
+ } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
+ ( $m, $y ) = ( $1, $3 );
+ } else {
+ die "unrecognized expiration date format: $date";
}
print qq!<INPUT TYPE="hidden" NAME="${payby}_month" VALUE="$m"!.