die unless ref($self->warehouse) eq 'SL::DB::Warehouse';
if ( $self->warehouse->id and @{$self->warehouse->bins} ) {
- $self->bin($self->warehouse->bins->[0]);
+ $self->bin($self->warehouse->bins_sorted->[0]);
$self->js
->html('#bin', $self->build_bin_select)
->focus('#part_bin_id');
}
sub build_bin_select {
- select_tag('part.bin_id', [ $_[0]->warehouse->bins ],
+ select_tag('part.bin_id', [ @{ $_[0]->warehouse->bins_sorted } ],
title_key => 'description',
default => $_[0]->bin->id,
);