From: Werner Hahn Date: Mon, 25 Mar 2019 14:46:33 +0000 (+0100) Subject: OrderController: reorder mit Sort::Naturally damit nach Preis ordentlich X-Git-Tag: release-3.5.4~82 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=90a1b6fad6aeeab84fc96d6511fdf42fff315df5;p=kivitendo-erp.git OrderController: reorder mit Sort::Naturally damit nach Preis ordentlich sortiert wird --- diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index f6afed9a8..656883c07 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -32,6 +32,7 @@ use List::MoreUtils qw(any none pairwise first_index); use English qw(-no_match_vars); use File::Spec; use Cwd; +use Sort::Naturally; use Rose::Object::MakeMethods::Generic ( @@ -909,9 +910,9 @@ sub action_reorder_items { my $method = $sort_keys{$::form->{order_by}}; my @to_sort = map { { old_pos => $_->position, order_by => $method->($_) } } @{ $self->order->items_sorted }; if ($::form->{sort_dir}) { - @to_sort = sort { $a->{order_by} cmp $b->{order_by} } @to_sort; + @to_sort = sort { Sort::Naturally::ncmp($a->{order_by}, $b->{order_by} ) } @to_sort; } else { - @to_sort = sort { $b->{order_by} cmp $a->{order_by} } @to_sort; + @to_sort = sort { Sort::Naturally::ncmp($b->{order_by}, $a->{order_by} ) } @to_sort; } $self->js ->run('kivi.Order.redisplay_items', \@to_sort)