Revision 4108834d
Von Jan Büren vor etwa 3 Jahren hinzugefügt
SL/Controller/RecordLinks.pm | ||
---|---|---|
252 | 252 |
|
253 | 253 |
my $all_linked_records = $self->object->linked_records(direction => 'from', recursive => 1); |
254 | 254 |
my $filtered_orders = [ grep { 'SL::DB::Order' eq ref $_ && $_->is_type('sales_order') } @$all_linked_records ]; |
255 |
|
|
256 |
# no orders no call to linked_records via batch mode |
|
257 |
# but instead return default list |
|
258 |
return $self->object->linked_records(direction => 'both', recursive => 1, save_path => 1) |
|
259 |
unless scalar @$filtered_orders; |
|
260 |
|
|
261 |
# we have a order, therefore get the tree view from the top (order) |
|
255 | 262 |
my $id_ref = [ map { $_->id } @$filtered_orders ]; |
256 | 263 |
my $linked_records = SL::DB::Order->new->linked_records(direction => 'to', recursive => 1, batch => $id_ref); |
257 | 264 |
push @{ $linked_records }, @$filtered_orders; |
Auch abrufbar als: Unified diff
Auftragzentrische verknüpfte Belege: Leere Ergebnismengen berücksichtigen
Falls keine Aufträge gefunden werden, auch keinen Aufruf