X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=254a23bf3ba977a2e939e1265897a03f2e7b3b7b;hb=71196b75e9beb984ead25c605ab91443269de88d;hp=3b9e3b33707acfceba317c60ed7e2e856c6dd255;hpb=ea274593a0c4b6ffbeb88882cd53fd22c9e480e0;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 3b9e3b337..254a23bf3 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| | @@ -892,7 +921,7 @@ sub form_footer { $tax .= qq||
---|---|
$form->{"${item}_description"} | - . $form->{"${item}_rate"} * 100 .qq|% | + . $form->{"${item}_rate"} * 100 .qq|%$form->{"${item}_total"} |
Enthaltene $form->{"${item}_description"} | - . $form->{"${item}_rate"} * 100 .qq|% | + . $form->{"${item}_rate"} * 100 .qq|%$form->{"${item}_total"} |