X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=9820c3c42125cf507650b6d76bce206ed80fcfd7;hb=87c7db6a14d2276b72c85a8423e3995f20255b6a;hp=99ff0cd29eda0560f8da9f9ac1982595af22e572;hpb=e6f429e42da71c71b6416727216302a87a254fde;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 99ff0cd29..9820c3c42 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"}|; @@ -245,7 +249,8 @@ sub order_links { if (@{ $form->{"all_$form->{vc}"} }) { $form->{ $form->{vc} } = qq|$form->{$form->{vc}}--$form->{"$form->{vc}_id"}|; - map { $form->{"select$form->{vc}"} .= "\n" } (@{ $form->{"all_$form->{vc}"} }); } @@ -255,7 +260,7 @@ sub order_links { $form->{defaultcurrency} = $curr[0]; $form->{currency} = $form->{defaultcurrency} unless $form->{currency}; - map { $form->{selectcurrency} .= "\n" } @curr; $form->{taxincluded} = $taxincluded if ($form->{id}); @@ -266,7 +271,7 @@ sub order_links { map { $form->{selectdepartment} .= - "\n" } (@{ $form->{all_departments} }); } @@ -275,13 +280,15 @@ sub order_links { # sales staff if (@{ $form->{all_employees} }) { $form->{selectemployee} = ""; - map { $form->{selectemployee} .= "\n" } (@{ $form->{all_employees} }); } # forex $form->{forex} = $form->{exchangerate}; + $form->{salesman_id} = $salesman_id if ($editing); + $lxdebug->leave_sub(); } @@ -410,6 +417,9 @@ sub form_header { #quote select[customer|vendor] Bug 133 $form->{"select$form->{vc}"} = $form->quote($form->{"select$form->{vc}"}); + #substitute \n and \r to \s (bug 543) + $form->{"select$form->{vc}"} =~ s/[\n\r]/ /g; + my @old_project_ids = ($form->{"globalproject_id"}); map({ push(@old_project_ids, $form->{"project_id_$_"}) if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"})); @@ -418,9 +428,11 @@ 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); + my %labels; + my @values = (undef); foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { push(@values, $item->{"cp_id"}); $labels{$item->{"cp_id"}} = $item->{"cp_name"} . @@ -456,6 +468,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 +929,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"} |
$intnotes | | . $locale->text('Payment Terms') . qq| | -