From: ivan Date: Thu, 10 Oct 2002 16:28:58 +0000 (+0000) Subject: expiration date bugfix for HIDE X-Git-Tag: freeside_1_5_0pre1~194 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=f5571d9d6c79d04e65f8da92be923c3f3ae5c54a expiration date bugfix for HIDE --- 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!