X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIR.pm;h=d79e0fd5d9a10ebe68bc3c04111df7059358bf50;hb=8815371268e0e1f627835d5f8344f04730cbf0af;hp=5a4a2d7f90f082232e649dab167650af7f4ba79a;hpb=fe3df36071968d9f22c33f40adfc87717a578b1b;p=kivitendo-erp.git diff --git a/SL/IR.pm b/SL/IR.pm index 5a4a2d7f9..d79e0fd5d 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -112,7 +112,7 @@ sub post_invoice { $form->{"inventory_accno_$i"} = $form->{"expense_accno_$i"}; } - if ($form->{"qty_$i"} != 0) { + if ($form->{"id_$i"}) { # get item baseunit $query = qq|SELECT p.unit @@ -1222,7 +1222,7 @@ sub retrieve_item { sub vendor_details { $main::lxdebug->enter_sub(); - my ($self, $myconfig, $form) = @_; + my ($self, $myconfig, $form, @wanted_vars) = @_; # connect to database my $dbh = $form->dbconnect($myconfig); @@ -1249,6 +1249,14 @@ sub vendor_details { # remove id and taxincluded before copy back delete @$ref{qw(id taxincluded)}; + + @wanted_vars = grep({ $_ } @wanted_vars); + if (scalar(@wanted_vars) > 0) { + my %h_wanted_vars; + map({ $h_wanted_vars{$_} = 1; } @wanted_vars); + map({ delete($ref->{$_}) unless ($h_wanted_vars{$_}); } keys(%{$ref})); + } + map { $form->{$_} = $ref->{$_} } keys %$ref; $sth->finish;