@@ -, +, @@ 2.1. Drop&create your database (take backups first if needed) 2.2. Navigate to web installer 2.3. Continue until you reach onboarding tool step where circulation rules are added. 2.4. Observe new drop down selection "Checkout type". 2.5. Select any checkout type and continue the onboarding process. 2.6. Investigate your database table "circulation_rules". You should now have rules with checkout_type of your choice. --- installer/onboarding.pl | 4 +++ .../en/modules/onboarding/onboardingstep5.tt | 10 +++++++ t/db_dependent/Circulation.t | 28 +++++++++++++++++++ t/db_dependent/Circulation/CalcDateDue.t | 4 +++ t/db_dependent/Circulation/GetHardDueDate.t | 4 +++ .../IssuingRules/maxsuspensiondays.t | 2 ++ t/db_dependent/Circulation/Returns.t | 1 + t/db_dependent/Circulation/issue.t | 2 ++ t/db_dependent/DecreaseLoanHighHolds.t | 1 + t/db_dependent/Fines.t | 2 ++ .../Holds/DisallowHoldIfItemsAvailable.t | 2 ++ t/db_dependent/Koha/Item.t | 1 + t/db_dependent/SIP/ILS.t | 1 + t/db_dependent/SIP/Transaction.t | 2 ++ t/db_dependent/api/v1/checkouts.t | 1 + t/db_dependent/selenium/basic_workflow.t | 6 ++++ 16 files changed, 71 insertions(+) --- a/installer/onboarding.pl +++ a/installer/onboarding.pl @@ -237,6 +237,7 @@ if ( $step == 5 ) { my $branchcode = $input->param('branch'); my $categorycode = $input->param('categorycode'); my $itemtype = $input->param('itemtype'); + my $checkout_type = $input->param('checkout_type'); my $maxissueqty = $input->param('maxissueqty'); my $issuelength = $input->param('issuelength'); my $lengthunit = $input->param('lengthunit'); @@ -254,6 +255,7 @@ if ( $step == 5 ) { branchcode => $branchcode, categorycode => $categorycode, itemtype => $itemtype, + checkout_type => $checkout_type, rules => { renewalsallowed => $renewalsallowed, renewalperiod => $renewalperiod, @@ -288,6 +290,7 @@ if ( $step == 5 ) { my $params_2 = { branchcode => $branchcode, categorycode => $categorycode, + checkout_type => $checkout_type, rules => { patron_maxissueqty => "", max_holds => "", @@ -321,6 +324,7 @@ if ( $step == 5 ) { categorycode => $categorycode, itemtype => $itemtype, branchcode => $branchcode, + checkout_type => $checkout_type, rules => { maxissueqty => $maxissueqty, } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt @@ -67,6 +67,16 @@ Required +
  • + + + Required +
  • --- a/t/db_dependent/Circulation.t +++ a/t/db_dependent/Circulation.t @@ -255,6 +255,7 @@ Koha::CirculationRules->set_rules( categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { reservesallowed => 25, issuelength => 14, @@ -762,6 +763,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { norenewalbefore => '7', no_auto_renewal_after => '9', @@ -778,6 +780,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { norenewalbefore => '7', no_auto_renewal_after => '10', @@ -794,6 +797,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { norenewalbefore => '7', no_auto_renewal_after => '11', @@ -810,6 +814,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { norenewalbefore => '10', no_auto_renewal_after => '11', @@ -826,6 +831,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { norenewalbefore => '10', no_auto_renewal_after => undef, @@ -843,6 +849,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { norenewalbefore => '7', no_auto_renewal_after => '15', @@ -860,6 +867,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { norenewalbefore => '10', no_auto_renewal_after => undef, @@ -893,6 +901,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { norenewalbefore => '10', no_auto_renewal_after => '11', @@ -985,6 +994,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { norenewalbefore => 10, no_auto_renewal_after => 11, @@ -1051,6 +1061,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { norenewalbefore => '7', no_auto_renewal_after => '', @@ -1066,6 +1077,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { norenewalbefore => '10', no_auto_renewal_after => '5', @@ -1087,6 +1099,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { norenewalbefore => '10', no_auto_renewal_after => '15', @@ -1105,6 +1118,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { norenewalbefore => '10', no_auto_renewal_after => '', @@ -1122,6 +1136,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { norenewalbefore => '10', no_auto_renewal_after => '15', @@ -1144,6 +1159,7 @@ subtest "CanBookBeRenewed tests" => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { norenewalbefore => undef, renewalsallowed => 0, @@ -1390,6 +1406,7 @@ subtest "AllowRenewalIfOtherItemsAvailable tests" => sub { categorycode => undef, itemtype => undef, branchcode => undef, + checkout_type => undef, rules => { reservesallowed => 25, issuelength => 14, @@ -1457,6 +1474,7 @@ subtest "AllowRenewalIfOtherItemsAvailable tests" => sub { categorycode => undef, itemtype => undef, branchcode => undef, + checkout_type => undef, rules => { onshelfholds => 0, } @@ -1471,6 +1489,7 @@ subtest "AllowRenewalIfOtherItemsAvailable tests" => sub { categorycode => undef, itemtype => undef, branchcode => undef, + checkout_type => undef, rules => { onshelfholds => 0, } @@ -1485,6 +1504,7 @@ subtest "AllowRenewalIfOtherItemsAvailable tests" => sub { categorycode => undef, itemtype => undef, branchcode => undef, + checkout_type => undef, rules => { onshelfholds => 1, } @@ -1499,6 +1519,7 @@ subtest "AllowRenewalIfOtherItemsAvailable tests" => sub { categorycode => undef, itemtype => undef, branchcode => undef, + checkout_type => undef, rules => { onshelfholds => 1, } @@ -2019,6 +2040,7 @@ subtest 'AddReturn + CumulativeRestrictionPeriods' => sub { categorycode => undef, itemtype => undef, branchcode => undef, + checkout_type => undef, rules => { issuelength => 1, firstremind => 1, # 1 day of grace @@ -2125,6 +2147,7 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { categorycode => '*', itemtype => '*', branchcode => '*', + checkout_type => '*', rules => { issuelength => 1, firstremind => 0, # 0 day of grace @@ -2181,6 +2204,7 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { suspension_chargeperiod => 3, firstremind => 1, @@ -2205,6 +2229,7 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { finedays => 2, suspension_chargeperiod => 1, @@ -2362,6 +2387,7 @@ subtest 'AddReturn | is_overdue' => sub { categorycode => undef, itemtype => undef, branchcode => undef, + checkout_type => undef, rules => { issuelength => 6, lengthunit => 'days', @@ -3048,6 +3074,7 @@ subtest 'CanBookBeIssued | is_overdue' => sub { categorycode => undef, branchcode => undef, itemtype => undef, + checkout_type => undef, rules => { maxissueqty => 1, reservesallowed => 25, @@ -3094,6 +3121,7 @@ subtest 'ItemsDeniedRenewal preference' => sub { categorycode => '*', itemtype => '*', branchcode => $idr_lib->branchcode, + checkout_type => '*', rules => { reservesallowed => 25, issuelength => 14, --- a/t/db_dependent/Circulation/CalcDateDue.t +++ a/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 $checkout_type = $Koha::Checkouts::type->{checkout}; my $issuelength = 10; my $renewalperiod = 5; my $lengthunit = 'days'; @@ -31,6 +33,7 @@ Koha::CirculationRules->set_rules( categorycode => $categorycode, itemtype => $itemtype, branchcode => $branchcode, + checkout_type => $checkout_type, rules => { issuelength => $issuelength, renewalperiod => $renewalperiod, @@ -169,6 +172,7 @@ Koha::CirculationRules->set_rules( categorycode => $dayweek_categorycode, itemtype => $dayweek_itemtype, branchcode => $dayweek_branchcode, + checkout_type => $checkout_type, rules => { issuelength => $dayweek_issuelength, renewalperiod => $dayweek_renewalperiod, --- a/t/db_dependent/Circulation/GetHardDueDate.t +++ a/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, + checkout_type => $Koha::Checkouts::type->{checkout}, rules => { finedays => 0, lengthunit => 'days', @@ -153,6 +155,7 @@ my $sampleissuingrule2 = { branchcode => $samplebranch2->{branchcode}, categorycode => $samplecat->{categorycode}, itemtype => $sampleitemtype1, + checkout_type => $Koha::Checkouts::type->{checkout}, rules => { renewalsallowed => 0, renewalperiod => 2, @@ -182,6 +185,7 @@ my $sampleissuingrule3 = { branchcode => $samplebranch1->{branchcode}, categorycode => $samplecat->{categorycode}, itemtype => $sampleitemtype2, + checkout_type => $Koha::Checkouts::type->{checkout}, rules => { renewalsallowed => 0, renewalperiod => 3, --- a/t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t +++ a/t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t @@ -115,6 +115,7 @@ subtest "suspension_chargeperiod" => sub { categorycode => undef, itemtype => undef, branchcode => undef, + checkout_type => undef, rules => { firstremind => 0, finedays => 7, @@ -141,6 +142,7 @@ subtest "maxsuspensiondays" => sub { categorycode => undef, itemtype => undef, branchcode => undef, + checkout_type => undef, rules => { firstremind => 0, finedays => 15, --- a/t/db_dependent/Circulation/Returns.t +++ a/t/db_dependent/Circulation/Returns.t @@ -254,6 +254,7 @@ subtest 'Handle ids duplication' => sub { categorycode => undef, itemtype => undef, branchcode => undef, + checkout_type => undef, rules => { chargeperiod => 1, fine => 1, --- a/t/db_dependent/Circulation/issue.t +++ a/t/db_dependent/Circulation/issue.t @@ -93,6 +93,7 @@ Koha::CirculationRules->set_rules( itemtype => '*', categorycode => '*', branchcode => '*', + checkout_type => '*', rules => { lengthunit => 'days', issuelength => 0, @@ -355,6 +356,7 @@ Koha::CirculationRules->set_rules( categorycode => undef, itemtype => undef, branchcode => undef, + checkout_type => undef, rules => { renewalsallowed => 3, } --- a/t/db_dependent/DecreaseLoanHighHolds.t +++ a/t/db_dependent/DecreaseLoanHighHolds.t @@ -101,6 +101,7 @@ Koha::CirculationRules->set_rules( branchcode => undef, categorycode => undef, itemtype => $item->itype, + checkout_type => undef, rules => { issuelength => '14', lengthunit => 'days', --- a/t/db_dependent/Fines.t +++ a/t/db_dependent/Fines.t @@ -20,6 +20,7 @@ my $issuingrule = Koha::CirculationRules->set_rules( categorycode => undef, itemtype => undef, branchcode => undef, + checkout_type => undef, rules => { fine => 1, finedays => 0, @@ -49,6 +50,7 @@ $issuingrule = Koha::CirculationRules->set_rules( categorycode => undef, itemtype => undef, branchcode => undef, + checkout_type => undef, rules => { chargeperiod_charge_at => 1, } --- a/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t +++ a/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t @@ -87,6 +87,7 @@ Koha::CirculationRules->set_rules( categorycode => undef, itemtype => $itemtype, branchcode => undef, + checkout_type => undef, rules => { issuelength => 7, lengthunit => 8, @@ -272,6 +273,7 @@ Koha::CirculationRules->set_rules( categorycode => undef, itemtype => $itemtype2, branchcode => undef, + checkout_type => undef, rules => { maxissueqty => 99, onshelfholds => 0, --- a/t/db_dependent/Koha/Item.t +++ a/t/db_dependent/Koha/Item.t @@ -174,6 +174,7 @@ subtest 'pickup_locations' => sub { categorycode => undef, itemtype => undef, branchcode => undef, + checkout_type => undef, rules => { reservesallowed => 25, } --- a/t/db_dependent/SIP/ILS.t +++ a/t/db_dependent/SIP/ILS.t @@ -92,6 +92,7 @@ subtest cancel_hold => sub { categorycode => $patron->categorycode, branchcode => $library->branchcode, itemtype => $item->effective_itemtype, + checkout_type => undef, rules => { onshelfholds => 1, reservesallowed => 3, --- a/t/db_dependent/SIP/Transaction.t +++ a/t/db_dependent/SIP/Transaction.t @@ -71,6 +71,7 @@ subtest fill_holds_at_checkout => sub { categorycode => $borrower->{categorycode}, branchcode => $branch->{branchcode}, itemtype => $itype->{itemtype}, + checkout_type => undef, rules => { onshelfholds => 1, reservesallowed => 3, @@ -177,6 +178,7 @@ subtest cancel_hold => sub { categorycode => $patron->categorycode, branchcode => $library->branchcode, itemtype => $item->effective_itemtype, + checkout_type => undef, rules => { onshelfholds => 1, reservesallowed => 3, --- a/t/db_dependent/api/v1/checkouts.t +++ a/t/db_dependent/api/v1/checkouts.t @@ -76,6 +76,7 @@ Koha::CirculationRules->set_rules( categorycode => undef, itemtype => undef, branchcode => undef, + checkout_type => undef, rules => { renewalperiod => 7, renewalsallowed => 1, --- a/t/db_dependent/selenium/basic_workflow.t +++ a/t/db_dependent/selenium/basic_workflow.t @@ -70,6 +70,11 @@ our $sample_data = { rentalcharge => 0, notforloan => 0, }, + checkout_type => { + itemtype => 'CHECKOUT', + description => 'Just a checkout_type 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}, + checkout_type => $issuing_rules->{checkout_type}, rules => { maxissueqty => $issuing_rules->{maxissueqty}, issuelength => $issuing_rules->{issuelength}, --