From f83b4aff417ab78fc4bc242298fe25924f1ee072 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 19 Jan 2007 10:27:50 +0000 Subject: [PATCH] =?utf8?q?Einkaufs-/Verkausfmasken:=20Wenn=20man=20auf=20"?= =?utf8?q?Liefeadresse"=20dr=C3=BCckt,=20dann=20werden=20jetzt=20nur=20noc?= =?utf8?q?h=20die=20Lieferadressdaten=20vom=20Kunden/Lieferanten=20aus=20d?= =?utf8?q?er=20Datenbank=20geholt.=20Damit=20werden=20die=20bisher=20einge?= =?utf8?q?gebenen=20Bemerkungen=20in=20der=20Maske=20nicht=20mehr=20=C3=BC?= =?utf8?q?berschrieben,=20und=20die=20internen=20Bemerkungen=20werden=20ni?= =?utf8?q?cht=20mehr=20in=20die=20normalen=20Bemerkungen=20kopiert.=20Fix?= =?utf8?q?=20f=C3=BCr=20Bug=20507.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/IR.pm | 9 ++++++++- SL/IS.pm | 9 ++++++++- bin/mozilla/io.pl | 14 +++++++++----- 3 files changed, 25 insertions(+), 7 deletions(-) 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) { -- 2.20.1