Lines 18-26
Link Here
|
18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
use Test::More tests => 6; |
21 |
use Test::More tests => 7; |
|
|
22 |
use t::lib::TestBuilder; |
22 |
|
23 |
|
23 |
use Koha::AuthorisedValues; |
24 |
use Koha::AuthorisedValues; |
|
|
25 |
use C4::ClassSource; |
24 |
|
26 |
|
25 |
$| = 1; |
27 |
$| = 1; |
26 |
|
28 |
|
Lines 43-48
my ($newResults, $newCount) = GetItemsForInventory;
Link Here
|
43 |
is_deeply($newResults,$oldResults,"Inventory results unchanged."); |
45 |
is_deeply($newResults,$oldResults,"Inventory results unchanged."); |
44 |
|
46 |
|
45 |
$dbh->rollback; |
47 |
$dbh->rollback; |
|
|
48 |
$dbh->{AutoCommit} = 1; |
49 |
|
50 |
subtest 'Use cn_sort rather than callnumber to determine correct location' => sub { |
51 |
|
52 |
plan tests => 1; |
53 |
my $builder = t::lib::TestBuilder->new; |
54 |
my $schema = Koha::Database->new->schema; |
55 |
$schema->storage->txn_begin; |
56 |
$builder->schema->resultset( 'Issue' )->delete_all; |
57 |
$builder->schema->resultset( 'Item' )->delete_all; |
58 |
|
59 |
my $class_rule = $builder->build({ |
60 |
source => 'ClassSortRule', |
61 |
value => { sort_routine => "LCC" } |
62 |
}); |
63 |
my $class_source = $builder->build({ |
64 |
source => 'ClassSource', |
65 |
value => { |
66 |
class_sort_rule => $class_rule->{class_sort_rule}, |
67 |
} |
68 |
}); |
69 |
my $item_1 = $builder->build({ |
70 |
source => 'Item', |
71 |
value => { |
72 |
itemcallnumber => 'GT95', |
73 |
cn_sort => GetClassSort($class_source->{cn_source},undef,'GT95'), |
74 |
} |
75 |
}); |
76 |
|
77 |
my( undef, $item_count) = GetItemsForInventory({ |
78 |
maxlocation => 'GT100', |
79 |
minlocation => 'GT90', |
80 |
class_source => $class_source->{cn_source}, |
81 |
}); |
82 |
is($item_count,1,"We should return GT95 as betwen GT90 and GT100"); |
83 |
$schema->storage->txn_rollback; |
84 |
|
85 |
}; |
46 |
|
86 |
|
47 |
sub OldWay { |
87 |
sub OldWay { |
48 |
my ($tdbh) = @_; |
88 |
my ($tdbh) = @_; |
49 |
- |
|
|