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

(-)a/Koha/Acquisition/Basket.pm (-4 / +4 lines)
Lines 156-170 sub authorizer { Link Here
156
    return scalar Koha::Patrons->find($self->authorisedby);
156
    return scalar Koha::Patrons->find($self->authorisedby);
157
}
157
}
158
158
159
=head3 closed
159
=head3 is_closed
160
160
161
    if ( $basket->closed ) { ... }
161
    if ( $basket->is_closed ) { ... }
162
162
163
Returns a boolean value representing if the basket is closed.
163
Returns a boolean value representing if the basket is closed.
164
164
165
=cut
165
=cut
166
166
167
sub closed {
167
sub is_closed {
168
    my ($self) = @_;
168
    my ($self) = @_;
169
169
170
    return ($self->closedate) ? 1 : 0;
170
    return ($self->closedate) ? 1 : 0;
Lines 185-191 sub close { Link Here
185
    my ($self) = @_;
185
    my ($self) = @_;
186
186
187
    Koha::Exceptions::Acquisition::Basket::AlreadyClosed->throw
187
    Koha::Exceptions::Acquisition::Basket::AlreadyClosed->throw
188
        if $self->closed;
188
        if $self->is_closed;
189
189
190
    $self->_result->result_source->schema->txn_do(
190
    $self->_result->result_source->schema->txn_do(
191
        sub {
191
        sub {
(-)a/t/db_dependent/Koha/Acquisition/Basket.t (-5 / +4 lines)
Lines 303-309 subtest 'orders' => sub { Link Here
303
    $schema->storage->txn_rollback;
303
    $schema->storage->txn_rollback;
304
};
304
};
305
305
306
subtest 'closed() tests' => sub {
306
subtest 'is_closed() tests' => sub {
307
307
308
    plan tests => 2;
308
    plan tests => 2;
309
309
Lines 327-334 subtest 'closed() tests' => sub { Link Here
327
        }
327
        }
328
    );
328
    );
329
329
330
    ok( $closed_basket->closed, 'Closed basket is tested as closed' );
330
    ok( $closed_basket->is_closed, 'Closed basket is tested as closed' );
331
    ok( !$open_basket->closed, 'Open basket is tested as open' );
331
    ok( !$open_basket->is_closed, 'Open basket is tested as open' );
332
332
333
    $schema->storage->txn_rollback;
333
    $schema->storage->txn_rollback;
334
};
334
};
Lines 363-369 subtest 'close() tests' => sub { Link Here
363
363
364
    $basket->close;
364
    $basket->close;
365
365
366
    ok( $basket->closed, 'Basket is closed' );
366
    ok( $basket->is_closed, 'Basket is closed' );
367
    my $ordered_orders = $basket->orders->search({ orderstatus => 'ordered' });
367
    my $ordered_orders = $basket->orders->search({ orderstatus => 'ordered' });
368
    is( $ordered_orders->count, 3, 'Only open orders have been marked as ordered' );
368
    is( $ordered_orders->count, 3, 'Only open orders have been marked as ordered' );
369
369
370
- 

Return to bug 26582