- $self->{filter} = {};
- my %args = parse_filter(
- $self->_pre_parse_filter($::form->{filter}, $self->{filter}),
- with_objects => [ 'customer' ],
- launder_to => $self->{filter},
- );
-
- $self->db_args(\%args);
-}
-
-# unfortunately ParseFilter can't handle compount filters.
-# so we clone the original filter (still need that for serializing)
-# rip out the options we know an replace them with the compound options.
-# ParseFilter will take care of the prefixing then.
-sub _pre_parse_filter {
- my ($self, $orig_filter, $launder_to) = @_;
-
- return undef unless $orig_filter;
-
- my $filter = clone($orig_filter);
-
- $launder_to->{active} = delete $filter->{active};
- if ($orig_filter->{active} ne 'both') {
- push @{ $filter->{and} }, $orig_filter->{active} eq 'active' ? (active => 1) : (or => [ active => 0, active => undef ]);
- }
-
- $launder_to->{valid} = delete $filter->{valid};
- if ($orig_filter->{valid} ne 'both') {
- push @{ $filter->{and} }, $orig_filter->{valid} eq 'valid' ? (valid => 1) : (or => [ valid => 0, valid => undef ]);
- }
-
- $launder_to->{status} = delete $filter->{status};
- if ($orig_filter->{status} ne 'all') {
- push @{ $filter->{and} }, SL::DB::Manager::Project->is_not_used_filter;
- }
-
- return $filter;
+ $self->linked_records([
+ map { @{ $_ } }
+ grep { $_ } (
+ SL::DB::Manager::Order-> get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'customer', 'vendor' ], sort_by => 'transdate ASC'),
+ SL::DB::Manager::DeliveryOrder-> get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'customer', 'vendor' ], sort_by => 'transdate ASC'),
+ SL::DB::Manager::Invoice-> get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'customer' ], sort_by => 'transdate ASC'),
+ SL::DB::Manager::PurchaseInvoice->get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'vendor' ], sort_by => 'transdate ASC'),
+ )]);