X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=98e68d2bbb9d49702f5c49891fb227c28ca330fe;hb=644c68bae03521cec693800af0a19b9ab4e0ed9c;hp=be1428672926ab66533c46cf404723c5177c7b29;hpb=615121a5115247f50140fb7f892fa2b43947e20a;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index be1428672..98e68d2bb 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -120,19 +120,19 @@ sub edit { # editing without stuff to edit? try adding it first if ($form->{rowcount}) { - map { $id++ if $form->{"id_$_"} } (1 .. $form->{rowcount}); + map { $id++ if $form->{"multi_id_$_"} } (1 .. $form->{rowcount}); if (!$id) { # reset rowcount undef $form->{rowcount}; &add; + $lxdebug->leave_sub(); return; } - } else { - if (!$form->{id}) { - &add; - return; - } + } elsif (!$form->{id}) { + &add; + $lxdebug->leave_sub(); + return; } if ($form->{print_and_save}) { @@ -167,6 +167,8 @@ sub order_links { # set jscalendar $form->{jscalendar} = $jscalendar; + my $editing = $form->{id}; + OE->retrieve(\%myconfig, \%$form); if ($form->{payment_id}) { @@ -179,6 +181,8 @@ sub order_links { $taxzone_id = $form->{taxzone_id}; } + $salesman_id = $form->{salesman_id} if ($editing); + # if multiple rowcounts (== collective order) then check if the # there were more than one customer (in that case OE::retrieve removes @@ -282,6 +286,8 @@ sub order_links { # forex $form->{forex} = $form->{exchangerate}; + $form->{salesman_id} = $salesman_id if ($editing); + $lxdebug->leave_sub(); } @@ -418,7 +424,8 @@ sub form_header { "shipto" => "ALL_SHIPTO", "projects" => { "key" => "ALL_PROJECTS", "all" => 0, - "old_id" => \@old_project_ids }); + "old_id" => \@old_project_ids }, + "employees" => "ALL_SALESMEN"); my (%labels, @values); foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { @@ -456,6 +463,25 @@ sub form_header { '-labels' => \%labels, '-default' => $form->{"globalproject_id"})); + $salesman = ""; + if ($form->{type} =~ /^sales_/) { + %labels = (); + @values = (""); + foreach my $item (@{ $form->{ALL_SALESMEN} }) { + push(@values, $item->{id}); + $labels{$item->{id}} = $item->{name} ne "" ? $item->{name} : $item->{login}; + } + + $salesman = + qq| + | . $locale->text('Salesman') . qq| + | . + NTI($cgi->popup_menu('-name' => 'salesman_id', '-default' => $form->{salesman_id}, + '-values' => \@values, '-labels' => \%labels)) + . qq| + |; + } + $form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate}); @@ -803,6 +829,7 @@ print qq| $openclosed $employee + $salesman $ordnumber @@ -967,7 +994,7 @@ sub form_footer { -
| . $locale->text('Project Number') . qq|$intnotes
| . $locale->text('Payment Terms') . qq|
@@ -1726,7 +1753,7 @@ sub orders { $subtotalamount += $oe->{amount}; $column_data{ids} = - qq||; + qq||; $column_data{id} = "$oe->{id}"; $column_data{transdate} = "$oe->{transdate} "; $column_data{reqdate} = "$oe->{reqdate} ";