From: Moritz Bunkus Date: Fri, 19 Jan 2007 10:27:50 +0000 (+0000) Subject: Einkaufs-/Verkausfmasken: Wenn man auf "Liefeadresse" drückt, dann werden jetzt nur... X-Git-Tag: release-2.4.1~1^2~5 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=f83b4aff417ab78fc4bc242298fe25924f1ee072;p=kivitendo-erp.git Einkaufs-/Verkausfmasken: Wenn man auf "Liefeadresse" drückt, dann werden jetzt nur noch die Lieferadressdaten vom Kunden/Lieferanten aus der Datenbank geholt. Damit werden die bisher eingegebenen Bemerkungen in der Maske nicht mehr überschrieben, und die internen Bemerkungen werden nicht mehr in die normalen Bemerkungen kopiert. Fix für Bug 507. --- diff --git a/SL/IR.pm b/SL/IR.pm index 5a4a2d7f9..a6f66659e 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -1222,7 +1222,7 @@ sub retrieve_item { sub vendor_details { $main::lxdebug->enter_sub(); - my ($self, $myconfig, $form) = @_; + my ($self, $myconfig, $form, @wanted_vars) = @_; # connect to database my $dbh = $form->dbconnect($myconfig); @@ -1249,6 +1249,13 @@ sub vendor_details { # remove id and taxincluded before copy back delete @$ref{qw(id taxincluded)}; + + 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; diff --git a/SL/IS.pm b/SL/IS.pm index 24f8f0f17..cc8027b9a 100644 --- 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,13 @@ sub customer_details { # remove id and taxincluded before copy back delete @$ref{qw(id taxincluded)}; + + 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; diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index bd248030d..4f36c7818 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -2016,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(); } @@ -2051,8 +2051,13 @@ 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); + # get details for name - &{"$form->{vc}_details"}; + &{"$form->{vc}_details"}(@shipto_vars); $number = ($form->{vc} eq 'customer') @@ -2155,8 +2160,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) {