Lieferwertbericht um Filter nach Warengruppen erweitert
[kivitendo-erp.git] / SL / Controller / PriceFactor.pm
index 31f0e46..5f220cb 100644 (file)
@@ -15,14 +15,9 @@ __PACKAGE__->run_before('check_auth');
 sub action_reorder {
   my ($self) = @_;
 
-  my @ids = @{ $::form->{price_factor_id} || [] };
-  my $result = SL::DB::PriceFactor->new->db->do_transaction(sub {
-    foreach my $idx (0 .. scalar(@ids) - 1) {
-      SL::DB::PriceFactor->new(id => $ids[$idx])->load->update_attributes(sortkey => $idx + 1);
-    }
-  });
-
-  $self->render(type => 'js', inline => '1;');
+  SL::DB::PriceFactor->reorder_list(@{ $::form->{price_factor_id} || [] });
+
+  $self->render(\'', { type => 'json' });
 }
 
 #