Lines 110-115
my $test_sth = $dbh->prepare("SELECT * FROM hold_fill_targets
Link Here
|
110 |
WHERE borrowernumber = $borrowernumber"); |
110 |
WHERE borrowernumber = $borrowernumber"); |
111 |
|
111 |
|
112 |
# We have a book available homed in borrower branch, no point fiddling with AutomaticItemReturn |
112 |
# We have a book available homed in borrower branch, no point fiddling with AutomaticItemReturn |
|
|
113 |
C4::Context->set_preference('AutomaticItemReturn', 0); |
113 |
test_queue ('take from homebranch', 0, $borrower_branchcode, $borrower_branchcode); |
114 |
test_queue ('take from homebranch', 0, $borrower_branchcode, $borrower_branchcode); |
114 |
test_queue ('take from homebranch', 1, $borrower_branchcode, $borrower_branchcode); |
115 |
test_queue ('take from homebranch', 1, $borrower_branchcode, $borrower_branchcode); |
115 |
|
116 |
|
Lines 118-124
$dbh->do("DELETE FROM hold_fill_targets");
Link Here
|
118 |
$dbh->do("DELETE FROM issues WHERE itemnumber IN (SELECT itemnumber FROM items WHERE homebranch = '$borrower_branchcode' AND holdingbranch = '$borrower_branchcode')"); |
119 |
$dbh->do("DELETE FROM issues WHERE itemnumber IN (SELECT itemnumber FROM items WHERE homebranch = '$borrower_branchcode' AND holdingbranch = '$borrower_branchcode')"); |
119 |
$dbh->do("DELETE FROM items WHERE homebranch = '$borrower_branchcode' AND holdingbranch = '$borrower_branchcode'"); |
120 |
$dbh->do("DELETE FROM items WHERE homebranch = '$borrower_branchcode' AND holdingbranch = '$borrower_branchcode'"); |
120 |
# test_queue will flush |
121 |
# test_queue will flush |
121 |
$dbh->do("UPDATE systempreferences SET value = 1 WHERE variable = 'AutomaticItemReturn'"); |
122 |
C4::Context->set_preference('AutomaticItemReturn', 1); |
122 |
# Not sure how to make this test more difficult - holding branch does not matter |
123 |
# Not sure how to make this test more difficult - holding branch does not matter |
123 |
test_queue ('take from holdingbranch AutomaticItemReturn on', 0, $borrower_branchcode, undef); |
124 |
test_queue ('take from holdingbranch AutomaticItemReturn on', 0, $borrower_branchcode, undef); |
124 |
test_queue ('take from holdingbranch AutomaticItemReturn on', 1, $borrower_branchcode, $least_cost_branch_code); |
125 |
test_queue ('take from holdingbranch AutomaticItemReturn on', 1, $borrower_branchcode, $least_cost_branch_code); |
Lines 127-133
$dbh->do("DELETE FROM tmp_holdsqueue");
Link Here
|
127 |
$dbh->do("DELETE FROM hold_fill_targets"); |
128 |
$dbh->do("DELETE FROM hold_fill_targets"); |
128 |
$dbh->do("DELETE FROM issues WHERE itemnumber IN (SELECT itemnumber FROM items WHERE homebranch = '$borrower_branchcode')"); |
129 |
$dbh->do("DELETE FROM issues WHERE itemnumber IN (SELECT itemnumber FROM items WHERE homebranch = '$borrower_branchcode')"); |
129 |
$dbh->do("DELETE FROM items WHERE homebranch = '$borrower_branchcode'"); |
130 |
$dbh->do("DELETE FROM items WHERE homebranch = '$borrower_branchcode'"); |
130 |
$dbh->do("UPDATE systempreferences SET value = 0 WHERE variable = 'AutomaticItemReturn'"); |
131 |
C4::Context->set_preference('AutomaticItemReturn', 0); |
131 |
# We have a book available held in borrower branch |
132 |
# We have a book available held in borrower branch |
132 |
test_queue ('take from holdingbranch', 0, $borrower_branchcode, $borrower_branchcode); |
133 |
test_queue ('take from holdingbranch', 0, $borrower_branchcode, $borrower_branchcode); |
133 |
test_queue ('take from holdingbranch', 1, $borrower_branchcode, $borrower_branchcode); |
134 |
test_queue ('take from holdingbranch', 1, $borrower_branchcode, $borrower_branchcode); |
134 |
- |
|
|