|
Lines 14-24
use Data::Dumper;
Link Here
|
| 14 |
|
14 |
|
| 15 |
use Test::More tests => 21; |
15 |
use Test::More tests => 21; |
| 16 |
|
16 |
|
| 17 |
|
|
|
| 18 |
use C4::Branch; |
17 |
use C4::Branch; |
| 19 |
use C4::ItemType; |
18 |
use C4::Branch; |
| 20 |
use C4::Members; |
19 |
use C4::Members; |
| 21 |
|
20 |
|
|
|
21 |
use Koha::ItemTypes; |
| 22 |
|
| 22 |
BEGIN { |
23 |
BEGIN { |
| 23 |
use FindBin; |
24 |
use FindBin; |
| 24 |
use lib $FindBin::Bin; |
25 |
use lib $FindBin::Bin; |
|
Lines 49-57
my $branches = C4::Branch::GetBranches;
Link Here
|
| 49 |
my @other_branches = grep { $_ ne $borrower_branchcode } keys %$branches; |
50 |
my @other_branches = grep { $_ ne $borrower_branchcode } keys %$branches; |
| 50 |
my $least_cost_branch_code = pop @other_branches |
51 |
my $least_cost_branch_code = pop @other_branches |
| 51 |
or BAIL_OUT("No point testing only one branch..."); |
52 |
or BAIL_OUT("No point testing only one branch..."); |
| 52 |
my @item_types = C4::ItemType->all; |
53 |
my $itemtype = Koha::ItemTypes->search({ notforloan => 1 })->next; |
| 53 |
my $itemtype = grep { $_->{notforloan} == 1 } @item_types |
54 |
$itemtype or BAIL_OUT("No adequate itemtype"); |
| 54 |
or BAIL_OUT("No adequate itemtype"); |
|
|
| 55 |
|
55 |
|
| 56 |
#Set up the stage |
56 |
#Set up the stage |
| 57 |
# Sysprefs and cost matrix |
57 |
# Sysprefs and cost matrix |
|
Lines 168-174
$dbh->do("DELETE FROM default_circ_rules");
Link Here
|
| 168 |
C4::Context->set_preference('UseTransportCostMatrix', 0); |
168 |
C4::Context->set_preference('UseTransportCostMatrix', 0); |
| 169 |
|
169 |
|
| 170 |
my @branchcodes = keys %$branches; |
170 |
my @branchcodes = keys %$branches; |
| 171 |
( $itemtype ) = @{ $dbh->selectrow_arrayref("SELECT itemtype FROM itemtypes LIMIT 1") }; |
171 |
$itemtype = Koha::ItemTypes->search->next; |
| 172 |
|
172 |
|
| 173 |
my $borrowernumber1 = AddMember( |
173 |
my $borrowernumber1 = AddMember( |
| 174 |
( |
174 |
( |
| 175 |
- |
|
|