X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FInvoice.pm;h=302179c807777fb9eafef980f8d70482c8bf6cfb;hb=a34ae1630d888a6c824dad13db000bd7e0e1c3e6;hp=18aa8dbdbeb51df05632b985db6af999125fb563;hpb=56b91fb4030432fde4159c11a0ca97a7571535f3;p=kivitendo-erp.git diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 18aa8dbdb..302179c80 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -50,8 +50,7 @@ sub items { goto &invoiceitems; } sub items_sorted { my ($self) = @_; - my @sorted = sort {$a->id <=> $b->id } @{ $self->items }; - return wantarray ? @sorted : \@sorted; + return [ sort {$a->id <=> $b->id } @{ $self->items } ]; } sub is_sales { @@ -135,7 +134,7 @@ sub new_from { base_qty subtotal longdescription lastcost price_factor_id)), deliverydate => $source_item->reqdate, fxsellprice => $source_item->sellprice,); - } @{ $source->items }; + } @{ $source->items_sorted }; $invoice->invoiceitems(\@items);