Merge branch 'master' of github.com:kivitendo/kivitendo-erp
[kivitendo-erp.git] / SL / DB / Order.pm
index 63d23f7..00886d6 100644 (file)
@@ -39,6 +39,12 @@ __PACKAGE__->meta->initialize;
 
 sub items { goto &orderitems; }
 
+sub items_sorted {
+  my ($self) = @_;
+
+  return [ sort {$a->id <=> $b->id } @{ $self->items } ];
+}
+
 sub type {
   my $self = shift;