sub items { goto &invoiceitems; }
+sub items_sorted {
+ my ($self) = @_;
+
+ return [ sort {$a->id <=> $b->id } @{ $self->items } ];
+}
+
sub is_sales {
# For compatibility with Order, DeliveryOrder
croak 'not an accessor' if @_ > 1;
base_qty subtotal longdescription lastcost price_factor_id)),
deliverydate => $source_item->reqdate,
fxsellprice => $source_item->sellprice,);
- } @{ $source->items };
+ } @{ $source->items_sorted };
$invoice->invoiceitems(\@items);