X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/dccb820ac74462367f37c2d7d4afab8b214a37ad..f217d072d76183bc07723dcc29503b732bd2022d:/SL/Controller/Inventory.pm diff --git a/SL/Controller/Inventory.pm b/SL/Controller/Inventory.pm index 132463872..6940b2eb5 100644 --- a/SL/Controller/Inventory.pm +++ b/SL/Controller/Inventory.pm @@ -394,7 +394,7 @@ sub make_row_result { $row->{outcorrection}->{data} - $row->{incorrection}->{data}; $row->{averconsumed}->{data} = $row->{consumed}->{data}*30/$days ; map { $row->{$_}->{data} = $form->format_amount($myconfig,$row->{$_}->{data},2); } $self->getnumcolumns(); - $row->{partnumber}->{link} = 'controller.pl?action=Part/edit&part.id' . $partid; + $row->{partnumber}->{link} = 'controller.pl?action=Part/edit&part.id=' . $partid; } sub action_stock { @@ -574,7 +574,7 @@ sub action_save_stocktaking { stocktaking_cutoff_date => $::form->{cutoff_date_as_date}, }); 1; - } or do { $transfer_error = $EVAL_ERROR->error; } + } or do { $transfer_error = ref($EVAL_ERROR) eq 'SL::X::FormError' ? $EVAL_ERROR->error : $EVAL_ERROR; } }); return $self->js->flash('error', $transfer_error)->render() @@ -722,7 +722,7 @@ sub sanitize_target { my ($self) = @_; $self->warehouse($self->warehouses->[0]) if !$self->warehouse || !$self->warehouse->id; - $self->bin ($self->warehouse->bins->[0]) if !$self->bin || !$self->bin->id; + $self->bin ($self->warehouse->bins_sorted_naturally->[0]) if !$self->bin || !$self->bin->id; # foreach my $warehouse ( $self->warehouses ) { # $warehouse->{BINS} = []; # foreach my $bin ( $self->bins ) { @@ -768,7 +768,7 @@ sub build_warehouse_select { } sub build_bin_select { - select_tag('bin_id', [ $_[0]->warehouse->bins ], + select_tag('bin_id', $_[0]->warehouse->bins_sorted_naturally, title_key => 'description', default => $_[0]->bin->id, ); @@ -812,7 +812,7 @@ grouped_ids as ( from last_inventories group by trans_id order by max(itime) - desc limit 10 + desc limit 20 ) select unnest(ids) from grouped_ids @@ -867,8 +867,9 @@ sub prepare_stocktaking_report { my $callback = $self->stocktaking_models->get_callback; - my $report = SL::ReportGenerator->new(\%::myconfig, $::form); - $self->{report} = $report; + my $report = SL::ReportGenerator->new(\%::myconfig, $::form); + $report->{title} = t8('Stocktaking Journal'); + $self->{report} = $report; my @columns = qw(itime employee ean partnumber part qty unit bin chargenumber comment cutoff_date); my @sortable = qw(itime employee ean partnumber part qty bin chargenumber comment cutoff_date);