X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/dcab2b89a7ffeabf3f5360366ea7d94ffe564f9d..7e2bf6ca0b5a77130cec0b01cfe263cd04f7e64d:/SL/Form.pm diff --git a/SL/Form.pm b/SL/Form.pm index cc65716b4..d43e51fb1 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1469,6 +1469,7 @@ sub add_shipto { my $shipto; my @values; + foreach my $item (qw(name department_1 department_2 street zipcode city country contact phone fax email)) { if ($self->{"shipto$item"}) { @@ -1476,6 +1477,7 @@ sub add_shipto { } push(@values, $self->{"shipto${item}"}); } + if ($shipto) { if ($self->{shipto_id}) { my $query = qq|UPDATE shipto set @@ -1504,8 +1506,10 @@ sub add_shipto { shiptocontact = ? AND shiptophone = ? AND shiptofax = ? AND - shiptoemail = ?|; - my $insert_check = selectfirst_hashref_query($self, $dbh, $query, @values); + shiptoemail = ? AND + module = ? AND + trans_id = ?|; + my $insert_check = selectfirst_hashref_query($self, $dbh, $query, @values, $module, $id); if(!$insert_check){ $query = qq|INSERT INTO shipto (trans_id, shiptoname, shiptodepartment_1, shiptodepartment_2,