summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2002-10-10 16:29:00 +0000
committerivan <ivan>2002-10-10 16:29:00 +0000
commit608d25c3da1680cb3d6e85dd6e9a7348d410cff3 (patch)
tree4437d42f63f314bb8f7b35b41731ff346df6b833
parent44edc0945209db9c3e3ff665ff8dd0d5e0a20b10 (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"!.