| ${r}Contact name (last, first)
 | END
print < , 
END
print < | SS# |  | | Company |  |  | ${r}Address |  | 
|---|
 |  |  |  !;
($daytime,$night,$fax)=(
  $cust_main->daytime,
  $cust_main->night,
  $cust_main->fax,
);
print <| ${r}City |  | ${r}State/Country |  | ${r}Zip |  | 
|---|
 Day Phone |  | | Night Phone |  |  END
print "$r required fields| Fax |  |  ";
# service address
if ( defined $cust_main->dbdef_table->column('ship_last') ) {
  print "\n", <
  function changed(what) {
    what.form.same.checked = false;
  }
  function samechanged(what) {
    if ( what.checked ) {
END
print "      what.form.ship_$_.value = what.form.$_.value;\n"
  for (qw( last first company address1 address2 city zip daytime night fax ));
print <
END
  print '
 Service address ',
        '(ship_last ) {
    print ' CHECKED';
    foreach (
      qw( last first company address1 address2 city state zip daytime night fax)
    ) {
      $cust_main->set("ship_$_", $cust_main->get($_) );
    }
  }
  print '>same as billing address)
 ';
  my($ship_last,$ship_first,$ship_company,$ship_address1,$ship_address2,$ship_city,$ship_zip)=(
    $cust_main->ship_last,
    $cust_main->ship_first,
    $cust_main->ship_company,
    $cust_main->ship_address1,
    $cust_main->ship_address2,
    $cust_main->ship_city,
    $cust_main->ship_zip,
  );
  print &itable("#cccccc"), <
 ${r}Contact name (last, first)
 | END
  print < , 
  
END
  print < | Company |  |  | ${r}Address |  | 
|---|
 |  |  |  !;
  my($ship_daytime,$ship_night,$ship_fax)=(
    $cust_main->ship_daytime,
    $cust_main->ship_night,
    $cust_main->ship_fax,
  );
  print <| ${r}City |  | ${r}State/Country |  | ${r}Zip |  | 
|---|
 Day Phone |  | | Night Phone |  |  END
  print "$r required fields| Fax |  |  ";
}
# 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";
    }
  }
  my $return = qq!
 |  |