X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=98e68d2bbb9d49702f5c49891fb227c28ca330fe;hb=644c68bae03521cec693800af0a19b9ab4e0ed9c;hp=ee8eddf17c07924b9880aad6eeca873b20eba555;hpb=2b89ec9756dc1d3525b6163fe4cf4f38af83f9d8;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index ee8eddf17..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 @@ -236,7 +240,7 @@ sub order_links { if ($taxzone_id) { $form->{taxzone_id} = $taxzone_id; } - $form->{intnotes} = $intnotes; + $form->{intnotes} = $intnotes if $intnotes; ($form->{ $form->{vc} }) = split /--/, $form->{ $form->{vc} }; $form->{"old$form->{vc}"} = qq|$form->{$form->{vc}}--$form->{"$form->{vc}_id"}|; @@ -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('Project Number') . qq| | @@ -891,7 +920,8 @@ sub form_footer { $tax .= qq|||
---|---|---|
$form->{"${item}_description"} | +$form->{"${item}_description"} | + . $form->{"${item}_rate"} * 100 .qq|% | $form->{"${item}_total"} |
Enthaltene $form->{"${item}_description"} | +Enthaltene $form->{"${item}_description"} | + . $form->{"${item}_rate"} * 100 .qq|% | $form->{"${item}_total"} |
$intnotes | | . $locale->text('Payment Terms') . qq| | -