${r}Contact name (last, first) |
-END
-
- print < ,
-
-END
-
- print <
- Company | |
- ${r}Address | |
- | |
- ${r}City | | ${r}State |
-END
-
- #false laziness with regular state
- $cust_main->ship_country( $countrydefault ) unless $cust_main->ship_country;
-
- $cust_main->ship_state( $conf->config('statedefault') || 'CA' )
- unless $cust_main->ship_state || $cust_main->ship_country ne 'US';
-
- my($ship_county_html, $ship_state_html, $ship_country_html) =
- FS::cust_main_county::regionselector( $cust_main->ship_county,
- $cust_main->ship_state,
- $cust_main->ship_country,
- 'ship_',
- 'changed(this)', );
-
- print "$ship_county_html $ship_state_html";
-
- print qq! | ${r}Zip | | !;
-
- my($ship_daytime,$ship_night,$ship_fax)=(
- $cust_main->ship_daytime,
- $cust_main->ship_night,
- $cust_main->ship_fax,
- );
-
- print <${r}Country | $ship_country_html |
- $daytime_label | |
- $night_label | |
- Fax | |
-END
-
- print "${r}required fields ";
+$m->comp('/elements/handle_uri_query', 'secure'=>1);
-}
+if ( $cgi->param('error') ) {
-# billing info
-
-sub expselect {
- my $prefix = shift;
- 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";
+ $same = ($cgi->param('same') || '') eq 'Y';
+ # false laziness w/ edit/process/cust_main.cgi
+ my %locations;
+ for my $pre (qw(bill ship)) {
+ my %hash;
+ foreach my $locfield ( FS::cust_main->location_fields ) {
+ # don't search on lat/long, string values can cause qsearchs to die
+ next if grep {$_ eq $locfield} qw(latitude longitude);
+ $hash{$locfield} = scalar($cgi->param($pre.'_'.$locfield));
+ }
+ $hash{'custnum'} = $cgi->param('custnum');
+ $locations{$pre} = qsearchs('cust_location', \%hash)
+ || FS::cust_location->new( \%hash );
+ # now set lat/long, for redisplay of entered values
+ foreach my $locfield ( qw(latitude longitude) ) {
+ my $locvalue = scalar($cgi->param($pre.'_'.$locfield));
+ $locations{$pre}->set($locfield,$locvalue);
}
}
-
- my $return = qq! |