sub items { goto &orderitems; }
+sub items_sorted {
+ my ($self) = @_;
+
+ my @sorted = sort {$a->id <=> $b->id } @{ $self->items };
+ return wantarray ? @sorted : \@sorted;
+}
+
sub sales_order {
my $self = shift;
my %params = @_;
sub items { goto &invoiceitems; }
+sub items_sorted {
+ my ($self) = @_;
+
+ my @sorted = sort {$a->id <=> $b->id } @{ $self->items };
+ return wantarray ? @sorted : \@sorted;
+}
+
sub is_sales {
# For compatibility with Order, DeliveryOrder
croak 'not an accessor' if @_ > 1;
sub items { goto &orderitems; }
+sub items_sorted {
+ my ($self) = @_;
+
+ my @sorted = sort {$a->id <=> $b->id } @{ $self->items };
+ return wantarray ? @sorted : \@sorted;
+}
+
sub type {
my $self = shift;
sub items { goto &invoiceitems; }
+sub items_sorted {
+ my ($self) = @_;
+
+ my @sorted = sort {$a->id <=> $b->id } @{ $self->items };
+ return wantarray ? @sorted : \@sorted;
+}
+
sub is_sales {
# For compatibility with Order, DeliveryOrder
croak 'not an accessor' if @_ > 1;