From: Moritz Bunkus Date: Wed, 4 Apr 2007 08:25:23 +0000 (+0000) Subject: Bei Einkaufs- und Verkaufsmasken ermöglichen, dass kein Ansprechpartner ausgewählt... X-Git-Tag: release-2.4.3^2~531 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=9caaa245e1bc3309a7d8f198228dbfd9d4555bee;p=kivitendo-erp.git Bei Einkaufs- und Verkaufsmasken ermöglichen, dass kein Ansprechpartner ausgewählt wird. --- diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 785c3d5d9..e91c47b29 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1738,6 +1738,7 @@ sub print_form { $language_saved = $form->{language_id}; $payment_id_saved = $form->{payment_id}; $salesman_id_saved = $form->{salesman_id}; + $cp_id_saved = $form->{cp_id}; &{"$form->{vc}_details"}(); @@ -1748,6 +1749,13 @@ sub print_form { $form->{"cc"} = $saved_cc if ($saved_cc); $form->{"bcc"} = $saved_bcc if ($saved_bcc); + if (!$cp_id_saved) { + # No contact was selected. Delete all contact variables because + # IS->customer_details() and IR->vendor_details() get the default + # contact anyway. + map({ delete($form->{$_}); } grep(/^cp_/, keys(%{ $form }))); + } + my ($language_tc, $output_numberformat, $output_dateformat, $output_longdates); if ($form->{"language_id"}) { ($language_tc, $output_numberformat, $output_dateformat, $output_longdates) = diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index d72ca7ed8..e052258e6 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -277,7 +277,8 @@ sub form_header { "all" => 0, "old_id" => \@old_project_ids }); - my (%labels, @values); + my %labels; + my @values = (undef); foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { push(@values, $item->{"cp_id"}); $labels{$item->{"cp_id"}} = $item->{"cp_name"} . diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 8c1249334..fef4a3edf 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -371,7 +371,8 @@ sub form_header { "old_id" => \@old_project_ids }, "employees" => "ALL_SALESMEN"); - my (%labels, @values); + my %labels; + my @values = (undef); foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { push(@values, $item->{"cp_id"}); $labels{$item->{"cp_id"}} = $item->{"cp_name"} . diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index f55d5a7cc..3fbc753b1 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -427,7 +427,8 @@ sub form_header { "old_id" => \@old_project_ids }, "employees" => "ALL_SALESMEN"); - my (%labels, @values); + my %labels; + my @values = (undef); foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { push(@values, $item->{"cp_id"}); $labels{$item->{"cp_id"}} = $item->{"cp_name"} .