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