X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FIC.pm;h=dc86484b39f7050e52ffec23f8194fd091d1ae25;hb=c9d5cc7f38af8db81fcfd11fac6cda62935d41c3;hp=d7c015360d0437062b1e4fea28f2e0812aa16c21;hpb=5c25bb6b8235a594f6de2d8a2f78521b534625c0;p=kivitendo-erp.git diff --git a/SL/IC.pm b/SL/IC.pm index d7c015360..dc86484b3 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -72,6 +72,8 @@ sub get_part { # copy to $form variables map { $form->{$_} = $ref->{$_} } (keys %{$ref}); + $form->{mtime} = $form->{itime} if !$form->{mtime}; + $form->{lastmtime} = $form->{mtime}; $form->{onhand} *= 1; # part or service item @@ -1721,7 +1723,8 @@ sub prepare_parts_for_printing { my %data = selectall_as_map($form, $dbh, $query, 'id', \@columns, @part_ids); - map { $form->{TEMPLATE_ARRAYS}{$_} = [] } (qw(make model), @columns); + my %template_arrays; + map { $template_arrays{$_} = [] } (qw(make model), @columns); foreach my $i (1 .. $rowcount) { my $id = $form->{"${prefix}${i}"}; @@ -1729,16 +1732,16 @@ sub prepare_parts_for_printing { next if (!$id); foreach (@columns) { - push @{ $form->{TEMPLATE_ARRAYS}{$_} }, $data{$id}->{$_}; + push @{ $template_arrays{$_} }, $data{$id}->{$_}; } - push @{ $form->{TEMPLATE_ARRAYS}{make} }, []; - push @{ $form->{TEMPLATE_ARRAYS}{model} }, []; + push @{ $template_arrays{make} }, []; + push @{ $template_arrays{model} }, []; next if (!$makemodel{$id}); foreach my $ref (@{ $makemodel{$id} }) { - map { push @{ $form->{TEMPLATE_ARRAYS}{$_}->[-1] }, $ref->{$_} } qw(make model); + map { push @{ $template_arrays{$_}->[-1] }, $ref->{$_} } qw(make model); } } @@ -1749,9 +1752,10 @@ sub prepare_parts_for_printing { my $id = $form->{"${prefix}${i}"}; next unless $id; - push @{ $form->{TEMPLATE_ARRAYS}{part_type} }, $parts_by_id{$id}->type; + push @{ $template_arrays{part_type} }, $parts_by_id{$id}->type; } + return %template_arrays; $main::lxdebug->leave_sub(); }