diff options
author | ivan <ivan> | 2004-01-23 02:53:12 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-01-23 02:53:12 +0000 |
commit | 85be0d954dbe4a2c86841a37dc6a4df690dd5142 (patch) | |
tree | 3028e574d218ceb679a76d809e9a0aefbdaff7d1 | |
parent | c6d6af63486146b83095818513c3c11bdb21360d (diff) |
fix state default and set min year to this year, patch from <matthewd>, thanks!
-rwxr-xr-x | httemplate/edit/cust_main.cgi | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 1909b5438..bfe4a2d4f 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -191,8 +191,10 @@ END my $countrydefault = $conf->config('countrydefault') || 'US'; $cust_main->country( $countrydefault ) unless $cust_main->country; -$cust_main->state( $conf->config('statedefault') || 'CA' ) - unless $cust_main->state || $cust_main->country ne 'US'; +my $statedefault = $conf->config('statedefault') + || ($countrydefault eq 'US' ? 'CA' : ''); +$cust_main->state( $statedefault ) + unless $cust_main->state || $cust_main->country ne $countrydefault; my($county_html, $state_html, $country_html) = FS::cust_main_county::regionselector( $cust_main->county, @@ -343,7 +345,9 @@ sub expselect { $return .= ">$_"; } $return .= qq!</SELECT>/<SELECT NAME="$prefix!. qq!_year" SIZE="1">!; - for ( 2001 .. 2037 ) { + my @t = localtime; + my $thisYear = $t[5] + 1900; + for ( ($thisYear > $y && $y > 0 ? $y : $thisYear) .. 2037 ) { $return .= "<OPTION"; $return .= " SELECTED" if $_ == $y; $return .= ">$_"; |