X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FPart.pm;h=f589a715a5b61a292e1e758c238aac7b9f05c550;hb=789de0c020f6aa3c289c1c74c3df98f076b3eef6;hp=6092f2962c6ca8d8b8d486485824a1c47d381516;hpb=0c73b206cea0c8f057852e75bd4ee22c19bfdbc3;p=kivitendo-erp.git diff --git a/SL/Controller/Part.pm b/SL/Controller/Part.pm index 6092f2962..f589a715a 100644 --- a/SL/Controller/Part.pm +++ b/SL/Controller/Part.pm @@ -33,7 +33,7 @@ use Rose::Object::MakeMethods::Generic ( all_buchungsgruppen all_payment_terms all_warehouses parts_classification_filter all_languages all_units all_price_factors) ], - 'scalar' => [ qw(warehouse bin) ], + 'scalar' => [ qw(warehouse bin stock_amounts journal) ], ); # safety @@ -263,6 +263,17 @@ sub action_history { history_entries => $history_entries); } +sub action_inventory { + my ($self) = @_; + + $::auth->assert('warehouse_contents'); + + $self->stock_amounts($self->part->get_simple_stock_sql); + $self->journal($self->part->get_mini_journal); + + $_[0]->render('part/_inventory_data', { layout => 0 }); +}; + sub action_update_item_totals { my ($self) = @_; @@ -420,7 +431,7 @@ sub action_multi_items_update_result { my $text = escape($::locale->text('No results.')); $_[0]->render($text, { layout => 0 }); } elsif ($count > $max_count) { - my $text = escpae($::locale->text('Too many results (#1 from #2).', $count, $max_count)); + my $text = escape($::locale->text('Too many results (#1 from #2).', $count, $max_count)); $_[0]->render($text, { layout => 0 }); } else { my $multi_items = $_[0]->multi_items_models->get; @@ -903,6 +914,8 @@ sub init_part { if ( $::form->{part}{id} ) { return SL::DB::Part->new(id => $::form->{part}{id})->load(with => [ qw(makemodels customerprices prices translations partsgroup shop_parts shop_parts.shop) ]); + } elsif ( $::form->{id} ) { + return SL::DB::Part->new(id => $::form->{id})->load; # used by inventory tab } else { die "part_type missing" unless $::form->{part}{part_type}; return SL::DB::Part->new(part_type => $::form->{part}{part_type});