Revision 5f543a5e
Von Sven Schöling vor etwa 11 Jahren hinzugefügt
SL/Controller/Inventory.pm | ||
---|---|---|
28 | 28 |
__PACKAGE__->run_before('load_wh_from_form', only => [ qw(stock_in warehouse_changed stock) ]); |
29 | 29 |
__PACKAGE__->run_before('load_bin_from_form', only => [ qw(stock_in stock) ]); |
30 | 30 |
__PACKAGE__->run_before('set_target_from_part', only => [ qw(part_changed) ]); |
31 |
__PACKAGE__->run_before('mini_stock', only => [ qw(stock_in mini_stock) ]); |
|
31 | 32 |
__PACKAGE__->run_before('sanitize_target', only => [ qw(stock_in warehouse_changed part_changed) ]); |
32 | 33 |
__PACKAGE__->run_before('set_layout'); |
33 | 34 |
|
... | ... | |
104 | 105 |
sub action_mini_stock { |
105 | 106 |
my ($self) = @_; |
106 | 107 |
|
107 |
my $stock = $self->part->get_simple_stock; |
|
108 |
my $stock_by_bin = { map { $_->{bin_id} => $_ } @$stock }; |
|
109 |
my $stock_empty = ! grep { $_->{sum} * 1 } @$stock; |
|
110 |
|
|
111 | 108 |
$self->js |
112 |
->html('#stock', $self->render('inventory/_stock', { output => 0 }, stock => $stock_by_bin, stock_empty => $stock_empty ))
|
|
109 |
->html('#stock', $self->render('inventory/_stock', { output => 0 })) |
|
113 | 110 |
->render($self); |
114 | 111 |
} |
115 | 112 |
|
... | ... | |
224 | 221 |
return \@sorted; |
225 | 222 |
} |
226 | 223 |
|
224 |
sub mini_stock { |
|
225 |
my ($self) = @_; |
|
226 |
|
|
227 |
my $stock = $self->part->get_simple_stock; |
|
228 |
$self->{stock_by_bin} = { map { $_->{bin_id} => $_ } @$stock }; |
|
229 |
$self->{stock_empty} = ! grep { $_->{sum} * 1 } @$stock; |
|
230 |
} |
|
231 |
|
|
227 | 232 |
sub show_no_warehouse_error { |
228 | 233 |
my ($self) = @_; |
229 | 234 |
|
Auch abrufbar als: Unified diff
mini_stock auch direkt nach dem einlagern anzeigen.