X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/a819e20cbfcbfb99eb5a34a5f15e22c58d61fdc9..e1cb00366d40cc3a1b07e065b51ad39c84baf7e6:/SL/WH.pm diff --git a/SL/WH.pm b/SL/WH.pm index 51c27c976..91ac12707 100644 --- a/SL/WH.pm +++ b/SL/WH.pm @@ -467,7 +467,7 @@ sub get_warehouse_report { my $dbh = $form->get_standard_dbh($myconfig); # filters - my (@filter_ary, @filter_vars, @wh_bin_filter_ary, @wh_bin_filter_vars, $columns, $group_by); + my (@filter_ary, @filter_vars, @wh_bin_filter_ary, @wh_bin_filter_vars); delete $form->{include_empty_bins} unless ($form->{l_warehousedescription} || $form->{l_bindescription}); @@ -569,14 +569,13 @@ sub get_warehouse_report { my $query = qq|SELECT $select_clause - $columns FROM inventory i LEFT JOIN parts p ON i.parts_id = p.id LEFT JOIN bin b ON i.bin_id = b.id LEFT JOIN warehouse w ON i.warehouse_id = w.id $joins WHERE $where_clause - GROUP BY $group_clause $group_by + GROUP BY $group_clause ORDER BY $sort_spec|; my $sth = prepare_execute_query($form, $dbh, $query, @filter_vars); @@ -603,7 +602,7 @@ sub get_warehouse_report { @all_fields = keys %{ $ref } unless (@all_fields); } - $ref->{stock_value} *= $ref->{qty}; + $ref->{stock_value} = ($ref->{stock_value} || 0) * $ref->{qty}; push @contents, $ref; }