Lines 19-25
use Modern::Perl;
Link Here
|
19 |
|
19 |
|
20 |
use POSIX qw(strftime); |
20 |
use POSIX qw(strftime); |
21 |
|
21 |
|
22 |
use Test::More tests => 72; |
22 |
use Test::More tests => 73; |
23 |
use t::lib::Mocks; |
23 |
use t::lib::Mocks; |
24 |
use Koha::Database; |
24 |
use Koha::Database; |
25 |
use Koha::DateUtils qw(dt_from_string output_pref); |
25 |
use Koha::DateUtils qw(dt_from_string output_pref); |
Lines 965-970
subtest 'ModReceiveOrder invoice_unitprice and invoice_currency' => sub {
Link Here
|
965 |
|
965 |
|
966 |
}; |
966 |
}; |
967 |
|
967 |
|
|
|
968 |
subtest 'GetHistory status search' => sub { |
969 |
plan tests => 3; |
970 |
|
971 |
my $builder = t::lib::TestBuilder->new; |
972 |
my $order_basket = $builder->build( { source => 'Aqbasket', value => { is_standing => 0 } } ); |
973 |
my $orderinfo = { |
974 |
basketno => $order_basket->{basketno}, |
975 |
rrp => 19.99, |
976 |
replacementprice => undef, |
977 |
quantity => 1, |
978 |
quantityreceived => 0, |
979 |
datereceived => undef, |
980 |
orderstatus => 'cancelled', |
981 |
datecancellationprinted => '1990-01-01', |
982 |
order_vendornote => 'status search' |
983 |
}; |
984 |
my $order = $builder->build( { source => 'Aqorder', value => $orderinfo } ); |
985 |
my $orderinfo2 = { |
986 |
basketno => $order_basket->{basketno}, |
987 |
rrp => 19.99, |
988 |
replacementprice => undef, |
989 |
quantity => 1, |
990 |
quantityreceived => 0, |
991 |
datereceived => undef, |
992 |
orderstatus => 'new', |
993 |
datecancellationprinted => undef, |
994 |
order_vendornote => 'status search' |
995 |
}; |
996 |
$order = $builder->build( { source => 'Aqorder', value => $orderinfo2 } ); |
997 |
|
998 |
$orders = GetHistory( order_status => "new", vendornote => 'status search' ); |
999 |
is( scalar(@$orders), 1, 'GetHistory with order status "new" returns 1 order' ); |
1000 |
|
1001 |
my $orders = GetHistory( get_canceled_order => 1, order_status => "any", vendornote => 'status search' ); |
1002 |
is( scalar(@$orders), 2, 'GetHistory with order status "any" returns all orders' ); |
1003 |
|
1004 |
$orders = GetHistory( order_status => "", vendornote => 'status search' ); |
1005 |
is( scalar(@$orders), 1, 'GetHistory with order status "all except cancelled" returns zero orders' ); |
1006 |
}; |
1007 |
|
968 |
subtest 'GetHistory with additional fields' => sub { |
1008 |
subtest 'GetHistory with additional fields' => sub { |
969 |
plan tests => 3; |
1009 |
plan tests => 3; |
970 |
my $builder = t::lib::TestBuilder->new; |
1010 |
my $builder = t::lib::TestBuilder->new; |
971 |
- |
|
|