Lines 15-26
use Data::Dumper;
Link Here
|
15 |
use Test::More tests => 23; |
15 |
use Test::More tests => 23; |
16 |
|
16 |
|
17 |
use C4::Branch; |
17 |
use C4::Branch; |
18 |
use C4::ItemType; |
|
|
19 |
use C4::Members; |
18 |
use C4::Members; |
20 |
use Koha::Database; |
19 |
use Koha::Database; |
21 |
|
20 |
|
22 |
use t::lib::TestBuilder; |
21 |
use t::lib::TestBuilder; |
23 |
|
22 |
|
|
|
23 |
use Koha::ItemTypes; |
24 |
|
24 |
BEGIN { |
25 |
BEGIN { |
25 |
use FindBin; |
26 |
use FindBin; |
26 |
use lib $FindBin::Bin; |
27 |
use lib $FindBin::Bin; |
Lines 60-69
my $borrower_branchcode = $borrower->{branchcode};
Link Here
|
60 |
my @branchcodes = ( $library1->{branchcode}, $library2->{branchcode}, $library3->{branchcode} ); |
61 |
my @branchcodes = ( $library1->{branchcode}, $library2->{branchcode}, $library3->{branchcode} ); |
61 |
my @other_branches = ( $library2->{branchcode}, $library3->{branchcode} ); |
62 |
my @other_branches = ( $library2->{branchcode}, $library3->{branchcode} ); |
62 |
my $least_cost_branch_code = pop @other_branches; |
63 |
my $least_cost_branch_code = pop @other_branches; |
63 |
my @item_types = C4::ItemType->all; |
64 |
my $itemtype = Koha::ItemTypes->search({ notforloan => 1 })->next; |
64 |
my @for_loan = grep { $_->{notforloan} == 0 } @item_types |
65 |
$itemtype or BAIL_OUT("No adequate itemtype"); #FIXME Should be $itemtype = $itemtype->itemtype |
65 |
or BAIL_OUT("No adequate itemtype"); |
|
|
66 |
my $itemtype = $for_loan[0]->{itemtype}; |
67 |
|
66 |
|
68 |
#Set up the stage |
67 |
#Set up the stage |
69 |
# Sysprefs and cost matrix |
68 |
# Sysprefs and cost matrix |
Lines 179-185
$dbh->do("DELETE FROM default_circ_rules");
Link Here
|
179 |
|
178 |
|
180 |
C4::Context->set_preference('UseTransportCostMatrix', 0); |
179 |
C4::Context->set_preference('UseTransportCostMatrix', 0); |
181 |
|
180 |
|
182 |
( $itemtype ) = @{ $dbh->selectrow_arrayref("SELECT itemtype FROM itemtypes LIMIT 1") }; |
181 |
$itemtype = Koha::ItemTypes->search->next->itemtype; |
183 |
|
182 |
|
184 |
$library1 = $builder->build({ |
183 |
$library1 = $builder->build({ |
185 |
source => 'Branch', |
184 |
source => 'Branch', |
Lines 309-315
is( @$holds_queue, 3, "Holds queue filling correct number for holds for default
Link Here
|
309 |
#warn "HOLDS QUEUE: " . Data::Dumper::Dumper( $holds_queue ); |
308 |
#warn "HOLDS QUEUE: " . Data::Dumper::Dumper( $holds_queue ); |
310 |
|
309 |
|
311 |
# Bug 14297 |
310 |
# Bug 14297 |
312 |
$itemtype = $item_types[0]->{itemtype}; |
311 |
$itemtype = Koha::ItemTypes->search->next->itemtype; |
313 |
$borrowernumber = $borrower3->{borrowernumber}; |
312 |
$borrowernumber = $borrower3->{borrowernumber}; |
314 |
my $library_A = $library1->{branchcode}; |
313 |
my $library_A = $library1->{branchcode}; |
315 |
my $library_B = $library2->{branchcode}; |
314 |
my $library_B = $library2->{branchcode}; |
Lines 366-372
is( @$holds_queue, 1, "Bug 14297 - Holds Queue building ignoring holds where pic
Link Here
|
366 |
# End Bug 14297 |
365 |
# End Bug 14297 |
367 |
|
366 |
|
368 |
# Bug 15062 |
367 |
# Bug 15062 |
369 |
$itemtype = $item_types[0]->{itemtype}; |
368 |
$itemtype = Koha::ItemTypes->search->next->itemtype; |
370 |
$borrowernumber = $borrower2->{borrowernumber}; |
369 |
$borrowernumber = $borrower2->{borrowernumber}; |
371 |
$library_A = $library1->{branchcode}; |
370 |
$library_A = $library1->{branchcode}; |
372 |
$library_B = $library2->{branchcode}; |
371 |
$library_B = $library2->{branchcode}; |
373 |
- |
|
|