Bugfix für einen meiner letzten Commits: Beim Anklicken von "Lieferadresse" blieb...
[kivitendo-erp.git] / SL / IS.pm
index 24f8f0f..1a36e2c 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -391,7 +391,7 @@ sub project_description {
 sub customer_details {
   $main::lxdebug->enter_sub();
 
-  my ($self, $myconfig, $form) = @_;
+  my ($self, $myconfig, $form, @wanted_vars) = @_;
 
   # connect to database
   my $dbh = $form->dbconnect($myconfig);
@@ -416,6 +416,14 @@ sub customer_details {
 
   # remove id and taxincluded before copy back
   delete @$ref{qw(id taxincluded)};
+
+  @wanted_vars = grep({ $_ } @wanted_vars);
+  if (scalar(@wanted_vars) > 0) {
+    my %h_wanted_vars;
+    map({ $h_wanted_vars{$_} = 1; } @wanted_vars);
+    map({ delete($ref->{$_}) unless ($h_wanted_vars{$_}); } keys(%{$ref}));
+  }
+
   map { $form->{$_} = $ref->{$_} } keys %$ref;
   $sth->finish;