- my @a = qw(name department_1 department_2 street zipcode city country contact phone fax email);
-
- my $shipto = 1;
-
- # if there is no shipto fill it in from billto
- foreach my $item (@a) {
- if ($form->{"shipto$item"}) {
- $shipto = 0;
- last;
- }
- }
-
- if ($shipto) {
- if ( $form->{formname} eq 'purchase_order'
- || $form->{formname} eq 'request_quotation') {
- $form->{shiptoname} = $defaults->company;
- $form->{shiptostreet} = $defaults->address;
- } else {
- map { $form->{"shipto$_"} = $form->{$_} } @a;
- }
- }
-