From 0305bcc60b92fcb44b2665e235fc4542cc745d77 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Sat, 11 Apr 2020 17:25:57 +0000 Subject: [PATCH] Bug 26814: Add onsite_checkout to set_rules To test: 1. Find all occurrences of set_rules that are missing onsite_checkout where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' -Przo '(?s)(::|->)set_rules.*?\)' \ --exclude="smart-rules.pl" --exclude="smart-rules.tt" | \ grep -avz 'onsite_checkout' && echo "" The only occasions this should return anything are cases where a HASH or HASHref is given to set_rules(), or that we are explicitly testing missing parameters in an unit test. 1.2 Verify the HASH/HASHref cases. The hash should contain a onsite_checkout (unless the rule is related to holds) 2. Find all subroutines using set_rules() git grep --no-index -n -p -P 'set_rules\s*\(' | grep -v 'sub {' \ | grep -P 'sub .*' 2.1 The only return should be t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t=401= sub set_holdallowed_rule { 3. The boring step. Find all occurrences of set_rules() with the following command: grep --exclude-dir='.git' -Prn 'set_rules' Go through this list and make sure all neccessary locations are updated. A change is required when the rule scope includes onsite_checkout. See Koha/CirculationRules.pm for scopes. Hold/reserve related rules do not require it. Sponsored-by: The National Library of Finland --- installer/onboarding.pl | 2 + .../en/modules/onboarding/onboardingstep5.tt | 10 +++ t/db_dependent/Circulation.t | 67 ++++++++++++++++++- t/db_dependent/Circulation/CalcDateDue.t | 4 ++ t/db_dependent/Circulation/GetHardDueDate.t | 43 +++++++++--- .../IssuingRules/maxsuspensiondays.t | 4 ++ t/db_dependent/Circulation/Returns.t | 1 + t/db_dependent/Circulation/issue.t | 2 + t/db_dependent/DecreaseLoanHighHolds.t | 11 +++ t/db_dependent/Fines.t | 2 + t/db_dependent/Holds.t | 11 +++ .../Holds/DisallowHoldIfItemsAvailable.t | 48 +++++++++++-- t/db_dependent/Koha/Charges/Fees.t | 2 + t/db_dependent/SIP/ILS.t | 11 +++ t/db_dependent/SIP/Transaction.t | 23 +++++++ t/db_dependent/api/v1/checkouts.t | 1 + t/db_dependent/selenium/basic_workflow.t | 6 ++ 17 files changed, 232 insertions(+), 16 deletions(-) diff --git a/installer/onboarding.pl b/installer/onboarding.pl index e9d6f28229..61146e5e10 100755 --- a/installer/onboarding.pl +++ b/installer/onboarding.pl @@ -241,6 +241,7 @@ if ( $step == 5 ) { my $branchcode = $input->param('branch'); my $categorycode = $input->param('categorycode'); my $itemtype = $input->param('itemtype'); + my $onsite_checkout = $input->param('onsite_checkout'); my $maxissueqty = $input->param('maxissueqty'); my $issuelength = $input->param('issuelength'); my $lengthunit = $input->param('lengthunit'); @@ -258,6 +259,7 @@ if ( $step == 5 ) { branchcode => $branchcode, categorycode => $categorycode, itemtype => $itemtype, + onsite_checkout => $onsite_checkout, rules => { renewalsallowed => $renewalsallowed, renewalperiod => $renewalperiod, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt index e70870f500..8cd4fe27c4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt @@ -67,6 +67,16 @@ Required +
  • + + + Required +
  • diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 3d334d6f24..9d15ff21aa 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -264,6 +264,17 @@ Koha::CirculationRules->set_rules( itemtype => undef, rules => { reservesallowed => 25, + } + } +); + +Koha::CirculationRules->set_rules( + { + categorycode => undef, + branchcode => undef, + itemtype => undef, + onsite_checkout => undef, + rules => { issuelength => 14, lengthunit => 'days', renewalsallowed => 1, @@ -772,6 +783,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + onsite_checkout => undef, rules => { norenewalbefore => '7', no_auto_renewal_after => '9', @@ -788,6 +800,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + onsite_checkout => undef, rules => { norenewalbefore => '7', no_auto_renewal_after => '10', @@ -804,6 +817,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + onsite_checkout => undef, rules => { norenewalbefore => '7', no_auto_renewal_after => '11', @@ -820,6 +834,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + onsite_checkout => undef, rules => { norenewalbefore => '10', no_auto_renewal_after => '11', @@ -836,6 +851,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + onsite_checkout => undef, rules => { norenewalbefore => '10', no_auto_renewal_after => undef, @@ -853,6 +869,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + onsite_checkout => undef, rules => { norenewalbefore => '7', no_auto_renewal_after => '15', @@ -870,6 +887,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + onsite_checkout => undef, rules => { norenewalbefore => '10', no_auto_renewal_after => undef, @@ -901,6 +919,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + onsite_checkout => undef, rules => { norenewalbefore => '10', no_auto_renewal_after => '11', @@ -991,6 +1010,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + onsite_checkout => undef, rules => { norenewalbefore => 10, no_auto_renewal_after => 11, @@ -1054,6 +1074,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + onsite_checkout => undef, rules => { norenewalbefore => '7', no_auto_renewal_after => '', @@ -1069,6 +1090,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + onsite_checkout => undef, rules => { norenewalbefore => '10', no_auto_renewal_after => '5', @@ -1090,6 +1112,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + onsite_checkout => undef, rules => { norenewalbefore => '10', no_auto_renewal_after => '15', @@ -1108,6 +1131,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + onsite_checkout => undef, rules => { norenewalbefore => '10', no_auto_renewal_after => '', @@ -1125,6 +1149,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + onsite_checkout => undef, rules => { norenewalbefore => '10', no_auto_renewal_after => '15', @@ -1147,6 +1172,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + onsite_checkout => undef, rules => { norenewalbefore => undef, renewalsallowed => 0, @@ -1395,6 +1421,16 @@ subtest "AllowRenewalIfOtherItemsAvailable tests" => sub { branchcode => undef, rules => { reservesallowed => 25, + } + } + ); + Koha::CirculationRules->set_rules( + { + categorycode => undef, + itemtype => undef, + branchcode => undef, + onsite_checkout => undef, + rules => { issuelength => 14, lengthunit => 'days', renewalsallowed => 1, @@ -2022,6 +2058,7 @@ subtest 'AddReturn + CumulativeRestrictionPeriods' => sub { categorycode => undef, itemtype => undef, branchcode => undef, + onsite_checkout => undef, rules => { issuelength => 1, firstremind => 1, # 1 day of grace @@ -2128,6 +2165,7 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { categorycode => '*', itemtype => '*', branchcode => '*', + onsite_checkout => '*', rules => { issuelength => 1, firstremind => 0, # 0 day of grace @@ -2160,6 +2198,7 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { categorycode => '*', itemtype => '*', branchcode => '*', + onsite_checkout => '*', rules => { issuelength => 1, firstremind => undef, # 0 day of grace @@ -2216,6 +2255,7 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { categorycode => undef, branchcode => undef, itemtype => undef, + onsite_checkout => undef, rules => { suspension_chargeperiod => 3, firstremind => 1, @@ -2240,6 +2280,7 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { categorycode => undef, branchcode => undef, itemtype => undef, + onsite_checkout => undef, rules => { finedays => 2, suspension_chargeperiod => 1, @@ -2409,6 +2450,7 @@ subtest 'AddReturn | is_overdue' => sub { categorycode => undef, itemtype => undef, branchcode => undef, + onsite_checkout => undef, rules => { issuelength => 6, lengthunit => 'days', @@ -2904,8 +2946,19 @@ subtest 'CanBookBeIssued | is_overdue' => sub { branchcode => undef, itemtype => undef, rules => { - maxissueqty => 1, reservesallowed => 25, + } + } + ); + + Koha::CirculationRules->set_rules( + { + categorycode => undef, + branchcode => undef, + itemtype => undef, + onsite_checkout => undef, + rules => { + maxissueqty => 1, issuelength => 14, lengthunit => 'days', renewalsallowed => 1, @@ -2951,6 +3004,16 @@ subtest 'ItemsDeniedRenewal preference' => sub { branchcode => $idr_lib->branchcode, rules => { reservesallowed => 25, + } + } + ); + Koha::CirculationRules->set_rules( + { + categorycode => '*', + itemtype => '*', + branchcode => $idr_lib->branchcode, + onsite_checkout => '*', + rules => { issuelength => 14, lengthunit => 'days', renewalsallowed => 10, @@ -3710,6 +3773,7 @@ subtest 'Tests for NoRefundOnLostReturnedItemsAge with AddReturn' => sub { categorycode => undef, itemtype => undef, branchcode => undef, + onsite_checkout => undef, rules => { issuelength => 14, lengthunit => 'days', @@ -3903,6 +3967,7 @@ subtest 'Tests for NoRefundOnLostReturnedItemsAge with AddIssue' => sub { categorycode => undef, itemtype => undef, branchcode => undef, + onsite_checkout => undef, rules => { issuelength => 14, lengthunit => 'days', diff --git a/t/db_dependent/Circulation/CalcDateDue.t b/t/db_dependent/Circulation/CalcDateDue.t index 8085dbd486..0c235d0bee 100755 --- a/t/db_dependent/Circulation/CalcDateDue.t +++ b/t/db_dependent/Circulation/CalcDateDue.t @@ -10,6 +10,7 @@ use t::lib::Mocks; use t::lib::TestBuilder; use C4::Calendar; +use Koha::Checkouts; use Koha::CirculationRules; use_ok('C4::Circulation'); @@ -21,6 +22,7 @@ my $builder = t::lib::TestBuilder->new; my $categorycode = 'B'; my $itemtype = 'MX'; my $branchcode = 'FPL'; +my $onsite_checkout = 0; my $issuelength = 10; my $renewalperiod = 5; my $lengthunit = 'days'; @@ -31,6 +33,7 @@ Koha::CirculationRules->set_rules( categorycode => $categorycode, itemtype => $itemtype, branchcode => $branchcode, + onsite_checkout => $onsite_checkout, rules => { issuelength => $issuelength, renewalperiod => $renewalperiod, @@ -170,6 +173,7 @@ Koha::CirculationRules->set_rules( categorycode => $dayweek_categorycode, itemtype => $dayweek_itemtype, branchcode => $dayweek_branchcode, + onsite_checkout => $onsite_checkout, rules => { issuelength => $dayweek_issuelength, renewalperiod => $dayweek_renewalperiod, diff --git a/t/db_dependent/Circulation/GetHardDueDate.t b/t/db_dependent/Circulation/GetHardDueDate.t index 275ecc426e..70cab35f5e 100755 --- a/t/db_dependent/Circulation/GetHardDueDate.t +++ b/t/db_dependent/Circulation/GetHardDueDate.t @@ -5,6 +5,7 @@ use C4::Context; use DateTime; use Koha::Database; use Koha::DateUtils; +use Koha::Checkouts; use Koha::CirculationRules; use Koha::Library; @@ -120,6 +121,7 @@ my $sampleissuingrule1 = { branchcode => $samplebranch1->{branchcode}, categorycode => $samplecat->{categorycode}, itemtype => $sampleitemtype1, + onsite_checkout => 0, rules => { finedays => 0, lengthunit => 'days', @@ -130,7 +132,6 @@ my $sampleissuingrule1 = { chargeperiod => 0, chargeperiod_charge_at => 0, rentaldiscount => 2, - reservesallowed => 0, hardduedate => '2013-01-01', fine => 0, hardduedatecompare => 5, @@ -138,14 +139,21 @@ my $sampleissuingrule1 = { renewalsallowed => 0, firstremind => 0, maxsuspensiondays => 0, - onshelfholds => 0, - opacitemholds => 'N', cap_fine_to_replacement_price => 0, - holds_per_record => 1, - article_requests => 'yes', no_auto_renewal_after => undef, no_auto_renewal_after_hard_limit => undef, suspension_chargeperiod => 1, + } +}; +my $sampleissuingrule1_holds = { + branchcode => $samplebranch1->{branchcode}, + categorycode => $samplecat->{categorycode}, + itemtype => $sampleitemtype1, + rules => { + onshelfholds => 0, + opacitemholds => 'N', + holds_per_record => 1, + article_requests => 'yes', holds_per_day => undef, } }; @@ -153,12 +161,12 @@ my $sampleissuingrule2 = { branchcode => $samplebranch2->{branchcode}, categorycode => $samplecat->{categorycode}, itemtype => $sampleitemtype1, + onsite_checkout => 0, rules => { renewalsallowed => 0, renewalperiod => 2, norenewalbefore => 7, auto_renew => 0, - reservesallowed => 0, issuelength => 2, lengthunit => 'days', hardduedate => 2, @@ -171,9 +179,16 @@ my $sampleissuingrule2 = { rentaldiscount => 2.00, overduefinescap => undef, maxsuspensiondays => 0, + cap_fine_to_replacement_price => 0, + } +}; +my $sampleissuingrule2_holds = { + branchcode => $samplebranch2->{branchcode}, + categorycode => $samplecat->{categorycode}, + itemtype => $sampleitemtype1, + rules => { onshelfholds => 1, opacitemholds => 'Y', - cap_fine_to_replacement_price => 0, holds_per_record => 1, article_requests => 'yes', } @@ -182,12 +197,12 @@ my $sampleissuingrule3 = { branchcode => $samplebranch1->{branchcode}, categorycode => $samplecat->{categorycode}, itemtype => $sampleitemtype2, + onsite_checkout => 0, rules => { renewalsallowed => 0, renewalperiod => 3, norenewalbefore => 8, auto_renew => 0, - reservesallowed => 0, issuelength => 3, lengthunit => 'days', hardduedate => 3, @@ -200,9 +215,16 @@ my $sampleissuingrule3 = { rentaldiscount => 3.00, overduefinescap => undef, maxsuspensiondays => 0, + cap_fine_to_replacement_price => 0, + } +}; +my $sampleissuingrule3_holds = { + branchcode => $samplebranch1->{branchcode}, + categorycode => $samplecat->{categorycode}, + itemtype => $sampleitemtype2, + rules => { onshelfholds => 1, opacitemholds => 'F', - cap_fine_to_replacement_price => 0, holds_per_record => 1, article_requests => 'yes', } @@ -211,6 +233,9 @@ my $sampleissuingrule3 = { Koha::CirculationRules->set_rules( $sampleissuingrule1 ); Koha::CirculationRules->set_rules( $sampleissuingrule2 ); Koha::CirculationRules->set_rules( $sampleissuingrule3 ); +Koha::CirculationRules->set_rules( $sampleissuingrule1_holds ); +Koha::CirculationRules->set_rules( $sampleissuingrule2_holds ); +Koha::CirculationRules->set_rules( $sampleissuingrule3_holds ); #Test GetLoanLength is_deeply( diff --git a/t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t b/t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t index bdb9d5aee6..0198c3f219 100755 --- a/t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t +++ b/t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t @@ -33,6 +33,7 @@ Koha::CirculationRules->set_rules( categorycode => undef, itemtype => undef, branchcode => undef, + onsite_checkout => undef, rules => { firstremind => 0, finedays => 2, @@ -90,6 +91,7 @@ Koha::CirculationRules->set_rules( categorycode => undef, itemtype => undef, branchcode => undef, + onsite_checkout => undef, rules => { maxsuspensiondays => 10, } @@ -113,6 +115,7 @@ subtest "suspension_chargeperiod" => sub { categorycode => undef, itemtype => undef, branchcode => undef, + onsite_checkout => undef, rules => { firstremind => 0, finedays => 7, @@ -139,6 +142,7 @@ subtest "maxsuspensiondays" => sub { categorycode => undef, itemtype => undef, branchcode => undef, + onsite_checkout => undef, rules => { firstremind => 0, finedays => 15, diff --git a/t/db_dependent/Circulation/Returns.t b/t/db_dependent/Circulation/Returns.t index 5a2c4ded1b..4c614842aa 100755 --- a/t/db_dependent/Circulation/Returns.t +++ b/t/db_dependent/Circulation/Returns.t @@ -237,6 +237,7 @@ subtest 'Handle ids duplication' => sub { categorycode => undef, itemtype => undef, branchcode => undef, + onsite_checkout => undef, rules => { chargeperiod => 1, fine => 1, diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t index 2a75da7de4..1b009ca9fc 100755 --- a/t/db_dependent/Circulation/issue.t +++ b/t/db_dependent/Circulation/issue.t @@ -93,6 +93,7 @@ Koha::CirculationRules->set_rules( itemtype => '*', categorycode => '*', branchcode => '*', + onsite_checkout => '*', rules => { lengthunit => 'days', issuelength => 0, @@ -355,6 +356,7 @@ Koha::CirculationRules->set_rules( categorycode => undef, itemtype => undef, branchcode => undef, + onsite_checkout => undef, rules => { renewalsallowed => 3, } diff --git a/t/db_dependent/DecreaseLoanHighHolds.t b/t/db_dependent/DecreaseLoanHighHolds.t index 9228f32c93..b456197bcb 100755 --- a/t/db_dependent/DecreaseLoanHighHolds.t +++ b/t/db_dependent/DecreaseLoanHighHolds.t @@ -104,9 +104,20 @@ Koha::CirculationRules->set_rules( branchcode => undef, categorycode => undef, itemtype => $item->itype, + onsite_checkout => undef, rules => { issuelength => '14', lengthunit => 'days', + } + } +); + +Koha::CirculationRules->set_rules( + { + branchcode => undef, + categorycode => undef, + itemtype => $item->itype, + rules => { reservesallowed => '99', holds_per_record => '99', } diff --git a/t/db_dependent/Fines.t b/t/db_dependent/Fines.t index 76cc0638a9..f132f1e78b 100755 --- a/t/db_dependent/Fines.t +++ b/t/db_dependent/Fines.t @@ -20,6 +20,7 @@ my $issuingrule = Koha::CirculationRules->set_rules( categorycode => undef, itemtype => undef, branchcode => undef, + onsite_checkout => undef, rules => { fine => 1, finedays => 0, @@ -49,6 +50,7 @@ $issuingrule = Koha::CirculationRules->set_rules( categorycode => undef, itemtype => undef, branchcode => undef, + onsite_checkout => undef, rules => { chargeperiod_charge_at => 1, } diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t index 7ad86b9783..d0a97403a1 100755 --- a/t/db_dependent/Holds.t +++ b/t/db_dependent/Holds.t @@ -1244,10 +1244,21 @@ subtest 'non priority holds' => sub { Koha::CirculationRules->set_rules( { branchcode => undef, + onsite_checkout => undef, categorycode => undef, itemtype => undef, rules => { renewalsallowed => 5, + } + } + ); + + Koha::CirculationRules->set_rules( + { + branchcode => undef, + categorycode => undef, + itemtype => undef, + rules => { reservesallowed => 5, } } diff --git a/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t b/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t index a815713d43..f224784ff5 100755 --- a/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t +++ b/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t @@ -88,13 +88,22 @@ Koha::CirculationRules->set_rules( itemtype => $itemtype, branchcode => undef, rules => { - issuelength => 7, - lengthunit => 8, reservesallowed => 99, onshelfholds => 2, } } ); +Koha::CirculationRules->set_rules( + { categorycode => undef, + itemtype => $itemtype, + branchcode => undef, + onsite_checkout => undef, + rules => { + issuelength => 7, + lengthunit => 8, + } + } +); my $is; @@ -303,11 +312,20 @@ Koha::CirculationRules->set_rules( itemtype => $itemtype2, branchcode => undef, rules => { - maxissueqty => 99, onshelfholds => 0, } } ); +Koha::CirculationRules->set_rules( + { categorycode => undef, + itemtype => $itemtype2, + branchcode => undef, + onsite_checkout => undef, + rules => { + maxissueqty => 99, + } + } +); $is = ItemsAnyAvailableAndNotRestricted( { biblionumber => $biblionumber, patron => $patron1 } ); # patron1 in library A, library A 1 item is( $is, 1, "Items availability: 1 item is available, 1 item held in T" ); @@ -349,8 +367,6 @@ subtest 'Check holds availability with different item types' => sub { itemtype => $itemtype, branchcode => undef, rules => { - issuelength => 7, - lengthunit => 8, reservesallowed => 99, holds_per_record => 99, onshelfholds => 2, @@ -359,17 +375,37 @@ subtest 'Check holds availability with different item types' => sub { ); Koha::CirculationRules->set_rules( { categorycode => undef, - itemtype => $itemtype2, + itemtype => $itemtype, branchcode => undef, + onsite_checkout => undef, rules => { issuelength => 7, lengthunit => 8, + } + } + ); + Koha::CirculationRules->set_rules( + { categorycode => undef, + itemtype => $itemtype2, + branchcode => undef, + rules => { reservesallowed => 0, holds_per_record => 0, onshelfholds => 2, } } ); + Koha::CirculationRules->set_rules( + { categorycode => undef, + itemtype => $itemtype2, + branchcode => undef, + onsite_checkout => undef, + rules => { + issuelength => 7, + lengthunit => 8, + } + } + ); $is = ItemsAnyAvailableAndNotRestricted( { biblionumber => $biblionumber1, patron => $patron1 } ); is( $is, 1, "Items availability: 2 items, one allowed by smart rule but not checked out, another one not allowed to be held by smart rule" ); diff --git a/t/db_dependent/Koha/Charges/Fees.t b/t/db_dependent/Koha/Charges/Fees.t index 637aaa278f..0cc067a15c 100755 --- a/t/db_dependent/Koha/Charges/Fees.t +++ b/t/db_dependent/Koha/Charges/Fees.t @@ -327,6 +327,7 @@ subtest 'accumulate_rentalcharge tests' => sub { categorycode => $patron->categorycode, itemtype => $itemtype->id, branchcode => $library->id, + onsite_checkout => undef, rules => { lengthunit => 'days', } @@ -388,6 +389,7 @@ subtest 'accumulate_rentalcharge tests' => sub { categorycode => $patron->categorycode, itemtype => $itemtype->id, branchcode => $library->id, + onsite_checkout => undef, rules => { lengthunit => 'hours', } diff --git a/t/db_dependent/SIP/ILS.t b/t/db_dependent/SIP/ILS.t index f08a259621..0e21a4a0c9 100755 --- a/t/db_dependent/SIP/ILS.t +++ b/t/db_dependent/SIP/ILS.t @@ -96,6 +96,17 @@ subtest cancel_hold => sub { onshelfholds => 1, reservesallowed => 3, holds_per_record => 3, + } + } + ); + + Koha::CirculationRules->set_rules( + { + categorycode => $patron->categorycode, + branchcode => $library->branchcode, + itemtype => $item->effective_itemtype, + onsite_checkout => undef, + rules => { issuelength => 5, lengthunit => 'days', } diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t index c4c164adb1..56c0ed1474 100755 --- a/t/db_dependent/SIP/Transaction.t +++ b/t/db_dependent/SIP/Transaction.t @@ -75,12 +75,24 @@ subtest fill_holds_at_checkout => sub { onshelfholds => 1, reservesallowed => 3, holds_per_record => 3, + } + } + ); + + Koha::CirculationRules->set_rules( + { + categorycode => $borrower->{categorycode}, + branchcode => $branch->{branchcode}, + itemtype => $itype->{itemtype}, + onsite_checkout => undef, + rules => { issuelength => 5, lengthunit => 'days', } } ); + my $reserve1 = AddReserve( { branchcode => $branch->{branchcode}, @@ -181,6 +193,17 @@ subtest cancel_hold => sub { onshelfholds => 1, reservesallowed => 3, holds_per_record => 3, + } + } + ); + + Koha::CirculationRules->set_rules( + { + categorycode => $patron->categorycode, + branchcode => $library->branchcode, + itemtype => $item->effective_itemtype, + onsite_checkout => undef, + rules => { issuelength => 5, lengthunit => 'days', } diff --git a/t/db_dependent/api/v1/checkouts.t b/t/db_dependent/api/v1/checkouts.t index ee47e1ef47..5da225dd72 100755 --- a/t/db_dependent/api/v1/checkouts.t +++ b/t/db_dependent/api/v1/checkouts.t @@ -76,6 +76,7 @@ Koha::CirculationRules->set_rules( categorycode => undef, itemtype => undef, branchcode => undef, + onsite_checkout => undef, rules => { renewalperiod => 7, renewalsallowed => 1, diff --git a/t/db_dependent/selenium/basic_workflow.t b/t/db_dependent/selenium/basic_workflow.t index c4bb0310c5..f8fc8fac2d 100755 --- a/t/db_dependent/selenium/basic_workflow.t +++ b/t/db_dependent/selenium/basic_workflow.t @@ -70,6 +70,11 @@ our $sample_data = { rentalcharge => 0, notforloan => 0, }, + onsite_checkout => { + itemtype => 'CHECKOUT', + description => 'Just a onsite_checkout for tests', + maxissueqty => 80100, + }, issuingrule => { categorycode => 'test_cat', itemtype => 'IT4test', @@ -159,6 +164,7 @@ SKIP: { categorycode => $issuing_rules->{categorycode}, itemtype => $issuing_rules->{itemtype}, branchcode => $issuing_rules->{branchcode}, + onsite_checkout => $issuing_rules->{onsite_checkout}, rules => { maxissueqty => $issuing_rules->{maxissueqty}, issuelength => $issuing_rules->{issuelength}, -- 2.17.1