Revision c8e09e7c
Von Bernd Bleßmann vor mehr als 11 Jahren hinzugefügt
SL/DB/DeliveryOrder.pm | ||
---|---|---|
28 | 28 |
sub items_sorted { |
29 | 29 |
my ($self) = @_; |
30 | 30 |
|
31 |
my @sorted = sort {$a->id <=> $b->id } @{ $self->items }; |
|
32 |
return wantarray ? @sorted : \@sorted; |
|
31 |
return [ sort {$a->id <=> $b->id } @{ $self->items } ]; |
|
33 | 32 |
} |
34 | 33 |
|
35 | 34 |
sub sales_order { |
SL/DB/Invoice.pm | ||
---|---|---|
50 | 50 |
sub items_sorted { |
51 | 51 |
my ($self) = @_; |
52 | 52 |
|
53 |
my @sorted = sort {$a->id <=> $b->id } @{ $self->items }; |
|
54 |
return wantarray ? @sorted : \@sorted; |
|
53 |
return [ sort {$a->id <=> $b->id } @{ $self->items } ]; |
|
55 | 54 |
} |
56 | 55 |
|
57 | 56 |
sub is_sales { |
SL/DB/Order.pm | ||
---|---|---|
42 | 42 |
sub items_sorted { |
43 | 43 |
my ($self) = @_; |
44 | 44 |
|
45 |
my @sorted = sort {$a->id <=> $b->id } @{ $self->items }; |
|
46 |
return wantarray ? @sorted : \@sorted; |
|
45 |
return [ sort {$a->id <=> $b->id } @{ $self->items } ]; |
|
47 | 46 |
} |
48 | 47 |
|
49 | 48 |
sub type { |
SL/DB/PurchaseInvoice.pm | ||
---|---|---|
32 | 32 |
sub items_sorted { |
33 | 33 |
my ($self) = @_; |
34 | 34 |
|
35 |
my @sorted = sort {$a->id <=> $b->id } @{ $self->items }; |
|
36 |
return wantarray ? @sorted : \@sorted; |
|
35 |
return [ sort {$a->id <=> $b->id } @{ $self->items } ]; |
|
37 | 36 |
} |
38 | 37 |
|
39 | 38 |
sub is_sales { |
Auch abrufbar als: Unified diff
itmes_sorted liefert immer eine Array-Referenz ...
um unvorhersehbare Dinge durch wantarray zu vermeiden.