View | Details | Raw Unified | Return to bug 36018
Collapse All | Expand All

(-)a/Koha/Acquisition/Orders.pm (-4 / +7 lines)
Lines 149-155 sub filter_by_lates { Link Here
149
149
150
    my $new_rs = $orders->filter_by_active;
150
    my $new_rs = $orders->filter_by_active;
151
151
152
Returns a new resultset filtering orders that are not active.
152
Returns a new resultset containing active orders only.
153
154
Note: An active order (line) has status ordered or partial, or it has status new
155
and the basket is marked as standing order.
153
156
154
=cut
157
=cut
155
158
Lines 167-181 sub filter_by_active { Link Here
167
    );
170
    );
168
}
171
}
169
172
170
=head3 filter_by_current
173
=head3 filter_out_cancelled
171
174
172
    $orders->filter_by_current
175
    $orders->filter_out_cancelled
173
176
174
Return the orders of the set that have not been cancelled.
177
Return the orders of the set that have not been cancelled.
175
178
176
=cut
179
=cut
177
180
178
sub filter_by_current {
181
sub filter_out_cancelled {
179
    my ($self) = @_;
182
    my ($self) = @_;
180
    return $self->search(
183
    return $self->search(
181
        {
184
        {
(-)a/acqui/basket.pl (-1 / +1 lines)
Lines 127-133 if ( $op eq 'cud-delete_confirm' ) { Link Here
127
    my $delbiblio  = $query->param('delbiblio');
127
    my $delbiblio  = $query->param('delbiblio');
128
    my $basket_obj = Koha::Acquisition::Baskets->find($basketno);
128
    my $basket_obj = Koha::Acquisition::Baskets->find($basketno);
129
129
130
    my $orders = $basket_obj->orders->filter_by_current;
130
    my $orders = $basket_obj->orders->filter_out_cancelled;
131
131
132
    my @cannotdelbiblios;
132
    my @cannotdelbiblios;
133
133
(-)a/t/db_dependent/Koha/Acquisition/Order.t (-3 / +2 lines)
Lines 590-596 subtest 'filter_by_late' => sub { Link Here
590
    $schema->storage->txn_rollback;
590
    $schema->storage->txn_rollback;
591
};
591
};
592
592
593
subtest 'filter_by_current & filter_by_cancelled' => sub {
593
subtest 'filter_out_cancelled & filter_by_cancelled' => sub {
594
    plan tests => 2;
594
    plan tests => 2;
595
595
596
    $schema->storage->txn_begin;
596
    $schema->storage->txn_begin;
Lines 631-637 subtest 'filter_by_current & filter_by_cancelled' => sub { Link Here
631
        }
631
        }
632
    );
632
    );
633
633
634
    is( $orders->filter_by_current->count, 2);
634
    is( $orders->filter_out_cancelled->count, 2);
635
    is( $orders->filter_by_cancelled->count, 1);
635
    is( $orders->filter_by_cancelled->count, 1);
636
636
637
637
638
- 

Return to bug 36018