<%
-#<!-- $Id: cust_main.cgi,v 1.10 2001-10-30 15:39:27 ivan Exp $ -->
+#<!-- $Id: cust_main.cgi,v 1.13 2001-11-21 03:40:03 ivan Exp $ -->
use vars qw( $cgi $custnum $action $cust_main $p1 @agents $agentnum
$last $first $ss $company $address1 $address2 $city $zip
$cust_main->state( $conf->config('statedefault') || 'CA' )
unless $cust_main->state || $cust_main->country ne 'US';
foreach ( sort {
- $a->country eq $countrydefault <=> $b->country eq $countrydefault
- or $a->country cmp $b->country
- or $a->state cmp $b->state
- or $a->county cmp $b->county
+ ( $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->state eq $_->state
print qq!<TR><TD><INPUT TYPE="checkbox" NAME="invoicing_list_POST" VALUE="POST"!;
@invoicing_list = $cust_main->invoicing_list;
print qq! CHECKED!
- if ! @invoicing_list || grep { $_ eq 'POST' } @invoicing_list;
+ if ( ! @invoicing_list && ! $conf->exists('postalinvoicedefault') )
+ || grep { $_ eq 'POST' } @invoicing_list;
print qq!>Postal mail invoice</TD></TR>!;
$invoicing_list = join(', ', grep { $_ ne 'POST' } @invoicing_list );
print qq!<TR><TD>Email invoice <INPUT TYPE="text" NAME="invoicing_list" VALUE="$invoicing_list"></TD></TR>!;