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