summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2002-02-22 22:13:00 +0000
committerivan <ivan>2002-02-22 22:13:00 +0000
commit55e8ec50af441be65887fae5ffb866941620fe54 (patch)
tree8cd9ed047be58bfeeb8d648bd44ebfedca71a4f9
parenteca2a638625ac22a64b9807d9c4c7ee9a5090ebb (diff)
billing vs. shipping states weren't sorted in the same order. UI glitch only
-rwxr-xr-xhttemplate/edit/cust_main.cgi9
1 files changed, 8 insertions, 1 deletions
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
index 41643a37f..2798d5dde 100755
--- a/httemplate/edit/cust_main.cgi
+++ b/httemplate/edit/cust_main.cgi
@@ -170,6 +170,7 @@ print <<END;
<TR><TH ALIGN="right">${r}City</TH><TD><INPUT TYPE="text" NAME="city" VALUE="$city"></TD><TH ALIGN="right">${r}State/Country</TH><TD><SELECT NAME="state" SIZE="1">
END
+#false laziness with ship_state
my $countrydefault = $conf->config('countrydefault') || 'US';
$cust_main->country( $countrydefault ) unless $cust_main->country;
$cust_main->state( $conf->config('statedefault') || 'CA' )
@@ -265,11 +266,17 @@ END
<TR><TH ALIGN="right">${r}City</TH><TD><INPUT TYPE="text" NAME="ship_city" VALUE="$ship_city" onChange="changed(this)"></TD><TH ALIGN="right">${r}State/Country</TH><TD><SELECT NAME="ship_state" SIZE="1" onChange="changed(this)">
END
+ #false laziness with regular state
$cust_main->ship_country( $conf->config('countrydefault') || 'US' )
unless $cust_main->ship_country;
$cust_main->ship_state( $conf->config('statedefault') || 'CA' )
unless $cust_main->ship_state || $cust_main->ship_country ne 'US';
- foreach ( qsearch('cust_main_county',{}) ) {
+ foreach ( sort {
+ ( $b->country eq $countrydefault ) <=> ( $a->country eq $countrydefault )
+ or $a->country cmp $b->country
+ or $a->state cmp $b->state
+ or $a->county cmp $b->county
+ } qsearch('cust_main_county',{}) ) {
print "<OPTION";
print " SELECTED" if ( $cust_main->ship_state eq $_->state
&& $cust_main->ship_county eq $_->county