Lines 2-8
Link Here
|
2 |
|
2 |
|
3 |
use Modern::Perl; |
3 |
use Modern::Perl; |
4 |
|
4 |
|
5 |
use Test::More tests => 10; |
5 |
use Test::More tests => 14; |
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 86-94
C4::Acquisition::DelOrder( $biblionumber1, $ordernumber1 );
Link Here
|
86 |
my ( $order ) = C4::Acquisition::GetOrders( $basketno, {cancelled => 1} ); |
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' ); |
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' ); |
88 |
is( $order->{orderstatus}, 'cancelled', 'DelOrder should have set status to cancelled' ); |
|
|
89 |
|
89 |
C4::Acquisition::CloseBasket( $basketno ); |
90 |
C4::Acquisition::CloseBasket( $basketno ); |
90 |
( $order ) = C4::Acquisition::GetOrders( $basketno, {cancelled => 1} ); |
91 |
( $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->{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 |
is( $order->{orderstatus}, 'cancelled', 'CloseBasket should not reset the status to ordered for cancelled orders' ); |
93 |
|
94 |
|
|
|
95 |
C4::Acquisition::ReopenBasket( $basketno ); |
96 |
( $order ) = C4::Acquisition::GetOrders( $basketno, {cancelled => 1} ); |
97 |
is( $order->{ordernumber}, $ordernumber1, 'The expected order is cancelled, the basket is reopened' ); |
98 |
is( $order->{orderstatus}, 'cancelled', 'ReopenBasket should not reset the status for cancelled orders' ); |
99 |
|
100 |
( $order ) = C4::Acquisition::GetOrders( $basketno, { cancelled => 0 } ); |
101 |
is ( $order->{ordernumber}, $ordernumber2, "The expect order is not cancelled, the basket is reopened" ); |
102 |
is ( $order->{orderstatus}, 'new', 'The expected order is new, the basket is reopened' ); |
103 |
|
94 |
$schema->storage->txn_rollback(); |
104 |
$schema->storage->txn_rollback(); |
95 |
- |
|
|