Lines 2-8
Link Here
|
2 |
|
2 |
|
3 |
use Modern::Perl; |
3 |
use Modern::Perl; |
4 |
|
4 |
|
5 |
use Test::More tests => 6; |
5 |
use Test::More tests => 10; |
6 |
use C4::Acquisition; |
6 |
use C4::Acquisition; |
7 |
use C4::Biblio qw( AddBiblio DelBiblio ); |
7 |
use C4::Biblio qw( AddBiblio DelBiblio ); |
8 |
use C4::Budgets; |
8 |
use C4::Budgets; |
Lines 82-85
C4::Acquisition::ReopenBasket( $basketno );
Link Here
|
82 |
is ( scalar( map { $_->{orderstatus} eq 'ordered' ? 1 : () } @orders ), 0, "No order are ordered, the basket is reopen" ); |
82 |
is ( scalar( map { $_->{orderstatus} eq 'ordered' ? 1 : () } @orders ), 0, "No order are ordered, the basket is reopen" ); |
83 |
is ( scalar( map { $_->{orderstatus} eq 'new' ? 1 : () } @orders ), 2, "2 orders are new, the basket is reopen" ); |
83 |
is ( scalar( map { $_->{orderstatus} eq 'new' ? 1 : () } @orders ), 2, "2 orders are new, the basket is reopen" ); |
84 |
|
84 |
|
|
|
85 |
C4::Acquisition::DelOrder( $biblionumber1, $ordernumber1 ); |
86 |
my ( $order ) = C4::Acquisition::GetOrders( $basketno, {cancelled => 1} ); |
87 |
is( $order->{ordernumber}, $ordernumber1, 'The order returned by GetOrders should have been the right one' ); |
88 |
is( $order->{orderstatus}, 'cancelled', 'DelOrder should have set status to cancelled' ); |
89 |
C4::Acquisition::CloseBasket( $basketno ); |
90 |
( $order ) = C4::Acquisition::GetOrders( $basketno, {cancelled => 1} ); |
91 |
is( $order->{ordernumber}, $ordernumber1, 'The order returned by GetOrders should have been the right one' ); |
92 |
is( $order->{orderstatus}, 'cancelled', 'CloseBasket should not reset the status to ordered for cancelled orders' ); |
93 |
|
85 |
$schema->storage->txn_rollback(); |
94 |
$schema->storage->txn_rollback(); |
86 |
- |
|
|