Bug 511
[kivitendo-erp.git] / bin / mozilla / io.pl
index 0c7b973..5f39393 100644 (file)
@@ -198,9 +198,11 @@ sub display_row {
     . qq|</th>|;
 ############## ENDE Neueintrag ##################
 
-  $form->{"show_details"} =
-    !defined($form->{"show_details"}) ? 1 :
-    $form->{"show_details"} ? 1 : 0;
+  $myconfig{"show_form_details"} = 1
+    unless (defined($myconfig{"show_form_details"}));
+  $form->{"show_details"} = $myconfig{"show_form_details"}
+    unless (defined($form->{"show_details"}));
+  $form->{"show_details"} = $form->{"show_details"} ? 1 : 0;
   my $show_details_new = 1 - $form->{"show_details"};
   my $show_details_checked = $form->{"show_details"} ? "checked" : "";
 
@@ -1793,7 +1795,7 @@ sub print_form {
   $language_saved = $form->{language_id};
   $payment_id_saved = $form->{payment_id};
 
-  &{"$form->{vc}_details"};
+  &{"$form->{vc}_details"}();
 
   $form->{language_id} = $language_saved;
   $form->{payment_id} = $payment_id_saved;
@@ -2014,14 +2016,14 @@ sub print_form {
 
 sub customer_details {
   $lxdebug->enter_sub();
-  IS->customer_details(\%myconfig, \%$form);
+  IS->customer_details(\%myconfig, \%$form, @_);
   $lxdebug->leave_sub();
 }
 
 sub vendor_details {
   $lxdebug->enter_sub();
 
-  IR->vendor_details(\%myconfig, \%$form);
+  IR->vendor_details(\%myconfig, \%$form, @_);
 
   $lxdebug->leave_sub();
 }
@@ -2049,8 +2051,17 @@ sub ship_to {
   map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
     qw(exchangerate creditlimit creditremaining);
 
+  my @shipto_vars =
+    qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry
+       shiptocontact shiptophone shiptofax shiptoemail
+       shiptodepartment_1 shiptodepartment_2);
+
+  my @addr_vars =
+    (qw(name department_1 department_2 street zipcode city country
+        contact email phone fax));
+
   # get details for name
-  &{"$form->{vc}_details"};
+  &{"$form->{vc}_details"}(@addr_vars);
 
   $number =
     ($form->{vc} eq 'customer')
@@ -2131,12 +2142,12 @@ sub ship_to {
        </tr>
        <tr>
          <th align=right nowrap>| . $locale->text('Phone') . qq|</th>
-         <td>$form->{"$form->{vc}phone"}</td>
+         <td>$form->{phone}</td>
          <td><input name=shiptophone size=20 value="$form->{shiptophone}"></td>
        </tr>
        <tr>
          <th align=right nowrap>| . $locale->text('Fax') . qq|</th>
-         <td>$form->{"$form->{vc}fax"}</td>
+         <td>$form->{fax}</td>
          <td><input name=shiptofax size=20 value="$form->{shiptofax}"></td>
        </tr>
        <tr>
@@ -2153,8 +2164,7 @@ sub ship_to {
 |;
 
   # delete shipto
-  map { delete $form->{$_} }
-    qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax shiptoemail shiptodepartment_1 shiptodepartment_2 header);
+  map({ delete $form->{$_} } (@shipto_vars, qw(header)));
   $form->{title} = $title;
 
   foreach $key (keys %$form) {